1*8184b252SMichael Buch //===-- ClangExpressionUtil.cpp -------------------------------------------===//
2*8184b252SMichael Buch //
3*8184b252SMichael Buch // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*8184b252SMichael Buch // See https://llvm.org/LICENSE.txt for license information.
5*8184b252SMichael Buch // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*8184b252SMichael Buch //
7*8184b252SMichael Buch //===----------------------------------------------------------------------===//
8*8184b252SMichael Buch 
9*8184b252SMichael Buch #include "ClangExpressionUtil.h"
10*8184b252SMichael Buch 
11*8184b252SMichael Buch #include "lldb/Core/ValueObject.h"
12*8184b252SMichael Buch #include "lldb/Target/StackFrame.h"
13*8184b252SMichael Buch #include "lldb/Utility/ConstString.h"
14*8184b252SMichael Buch 
15*8184b252SMichael Buch namespace lldb_private {
16*8184b252SMichael Buch namespace ClangExpressionUtil {
GetLambdaValueObject(StackFrame * frame)17*8184b252SMichael Buch lldb::ValueObjectSP GetLambdaValueObject(StackFrame *frame) {
18*8184b252SMichael Buch   assert(frame);
19*8184b252SMichael Buch 
20*8184b252SMichael Buch   if (auto this_val_sp = frame->FindVariable(ConstString("this")))
21*8184b252SMichael Buch     if (this_val_sp->GetChildMemberWithName(ConstString("this"), true))
22*8184b252SMichael Buch       return this_val_sp;
23*8184b252SMichael Buch 
24*8184b252SMichael Buch   return nullptr;
25*8184b252SMichael Buch }
26*8184b252SMichael Buch } // namespace ClangExpressionUtil
27*8184b252SMichael Buch } // namespace lldb_private
28