1 //===-- ClangExpressionVariable.cpp -----------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "ClangExpressionVariable.h"
12 #include "lldb/Core/Value.h"
13 #include "lldb/Core/ValueObjectConstResult.h"
14 #include "lldb/Target/ExecutionContext.h"
15 #include "lldb/Target/Process.h"
16 #include "lldb/Utility/ConstString.h"
17 #include "lldb/Utility/DataExtractor.h"
18 #include "lldb/Utility/Stream.h"
19 #include "clang/AST/ASTContext.h"
21 using namespace lldb_private;
22 using namespace clang;
24 ClangExpressionVariable::ClangExpressionVariable(
25 ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order,
26 uint32_t addr_byte_size)
27 : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
31 ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);
34 ClangExpressionVariable::ClangExpressionVariable(
35 ExecutionContextScope *exe_scope, Value &value, const ConstString &name,
37 : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
40 m_frozen_sp = ValueObjectConstResult::Create(exe_scope, value, name);
43 ClangExpressionVariable::ClangExpressionVariable(
44 const lldb::ValueObjectSP &valobj_sp)
45 : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
48 m_frozen_sp = valobj_sp;
51 ClangExpressionVariable::ClangExpressionVariable(
52 ExecutionContextScope *exe_scope, const ConstString &name,
53 const TypeFromUser &user_type, lldb::ByteOrder byte_order,
54 uint32_t addr_byte_size)
55 : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
59 ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);
61 SetCompilerType(user_type);
64 TypeFromUser ClangExpressionVariable::GetTypeFromUser() {
65 TypeFromUser tfu(m_frozen_sp->GetCompilerType());