Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / ExpressionParser / Clang / ClangExpressionUtil.cpp
blob723a3d7e59849e28a9225a90a0f0d120efc6b787
1 //===-- ClangExpressionUtil.cpp -------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "ClangExpressionUtil.h"
11 #include "lldb/Core/ValueObject.h"
12 #include "lldb/Target/StackFrame.h"
13 #include "lldb/Utility/ConstString.h"
15 namespace lldb_private {
16 namespace ClangExpressionUtil {
17 lldb::ValueObjectSP GetLambdaValueObject(StackFrame *frame) {
18 assert(frame);
20 if (auto this_val_sp = frame->FindVariable(ConstString("this")))
21 if (this_val_sp->GetChildMemberWithName("this"))
22 return this_val_sp;
24 return nullptr;
26 } // namespace ClangExpressionUtil
27 } // namespace lldb_private