LLDB mainline
ClangExpressionVariable.cpp
Go to the documentation of this file.
1//===-- ClangExpressionVariable.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//===----------------------------------------------------------------------===//
8
10
11#include "lldb/Core/Value.h"
14#include "lldb/Target/Process.h"
17#include "lldb/Utility/Stream.h"
18#include "clang/AST/ASTContext.h"
19
20using namespace lldb_private;
21using namespace clang;
22
24 ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order,
25 uint32_t addr_byte_size)
26 : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
27 m_jit_vars() {
30 ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);
31}
32
34 ExecutionContextScope *exe_scope, Value &value, ConstString name,
35 uint16_t flags)
36 : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
37 m_jit_vars() {
38 m_flags = flags;
39 m_frozen_sp = ValueObjectConstResult::Create(exe_scope, value, name);
40}
41
43 const lldb::ValueObjectSP &valobj_sp)
44 : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
45 m_jit_vars() {
47 m_frozen_sp = valobj_sp;
48}
49
51 ExecutionContextScope *exe_scope, ConstString name,
52 const TypeFromUser &user_type, lldb::ByteOrder byte_order,
53 uint32_t addr_byte_size)
54 : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
55 m_jit_vars() {
58 ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);
59 SetName(name);
60 SetCompilerType(user_type);
61}
62
64 TypeFromUser tfu(m_frozen_sp->GetCompilerType());
65 return tfu;
66}
ClangExpressionVariable(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size)
A uniqued constant string class.
Definition: ConstString.h:39
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
void SetCompilerType(const CompilerType &compiler_type)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
A class that represents a running process on the host machine.
ByteOrder
Byte ordering definitions.