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 "clang/AST/ASTContext.h"
13 #include "lldb/Core/ConstString.h"
14 #include "lldb/Core/DataExtractor.h"
15 #include "lldb/Core/Stream.h"
16 #include "lldb/Core/Value.h"
17 #include "lldb/Core/ValueObjectConstResult.h"
18 #include "lldb/Target/ExecutionContext.h"
19 #include "lldb/Target/Process.h"
21 using namespace lldb_private;
22 using namespace clang;
24 const char *g_clang_expression_variable_kind_name = "ClangExpressionVariable";
26 ClangExpressionVariable::ClangExpressionVariable(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size) :
27 ExpressionVariable(LLVMCastKind::eKindClang),
32 m_frozen_sp = ValueObjectConstResult::Create (exe_scope, byte_order, addr_byte_size);
35 ClangExpressionVariable::ClangExpressionVariable (ExecutionContextScope *exe_scope,
37 const ConstString &name,
39 ExpressionVariable(LLVMCastKind::eKindClang),
44 m_frozen_sp = ValueObjectConstResult::Create (exe_scope, value, name);
47 ClangExpressionVariable::ClangExpressionVariable (const lldb::ValueObjectSP &valobj_sp) :
48 ExpressionVariable(LLVMCastKind::eKindClang),
53 m_frozen_sp = valobj_sp;
56 ClangExpressionVariable::ClangExpressionVariable(ExecutionContextScope *exe_scope,
57 const ConstString &name,
58 const TypeFromUser& user_type,
59 lldb::ByteOrder byte_order,
60 uint32_t addr_byte_size) :
61 ExpressionVariable(LLVMCastKind::eKindClang),
66 m_frozen_sp = ValueObjectConstResult::Create (exe_scope, byte_order, addr_byte_size);
68 SetCompilerType (user_type);
72 ClangExpressionVariable::GetTypeFromUser()
74 TypeFromUser tfu (m_frozen_sp->GetCompilerType());