Files
clang-p2996/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionUtil.cpp
Dave Lee 7d4fcd411b [lldb] Default can_create to true in GetChildMemberWithName (NFC)
It turns out all existing callers of `GetChildMemberWithName` pass true for `can_create`.
This change makes `true` the default value, callers don't have to pass an opaque true.

Differential Revision: https://reviews.llvm.org/D151966
2023-06-13 11:37:41 -07:00

28 lines
881 B
C++

//===-- ClangExpressionUtil.cpp -------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "ClangExpressionUtil.h"
#include "lldb/Core/ValueObject.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Utility/ConstString.h"
namespace lldb_private {
namespace ClangExpressionUtil {
lldb::ValueObjectSP GetLambdaValueObject(StackFrame *frame) {
assert(frame);
if (auto this_val_sp = frame->FindVariable(ConstString("this")))
if (this_val_sp->GetChildMemberWithName("this"))
return this_val_sp;
return nullptr;
}
} // namespace ClangExpressionUtil
} // namespace lldb_private