Path: blob/main/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
39648 views
//===-- ClangExpressionVariable.cpp ---------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "ClangExpressionVariable.h"910#include "lldb/Core/Value.h"11#include "lldb/Core/ValueObjectConstResult.h"12#include "lldb/Target/ExecutionContext.h"13#include "lldb/Target/Process.h"14#include "lldb/Utility/ConstString.h"15#include "lldb/Utility/DataExtractor.h"16#include "lldb/Utility/Stream.h"17#include "clang/AST/ASTContext.h"1819using namespace lldb_private;20using namespace clang;2122char ClangExpressionVariable::ID;2324ClangExpressionVariable::ClangExpressionVariable(25ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order,26uint32_t addr_byte_size)27: m_parser_vars(), m_jit_vars() {28m_flags = EVNone;29m_frozen_sp =30ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);31}3233ClangExpressionVariable::ClangExpressionVariable(34ExecutionContextScope *exe_scope, Value &value, ConstString name,35uint16_t flags)36: m_parser_vars(), m_jit_vars() {37m_flags = flags;38m_frozen_sp = ValueObjectConstResult::Create(exe_scope, value, name);39}4041ClangExpressionVariable::ClangExpressionVariable(42const lldb::ValueObjectSP &valobj_sp)43: m_parser_vars(), m_jit_vars() {44m_flags = EVNone;45m_frozen_sp = valobj_sp;46}4748ClangExpressionVariable::ClangExpressionVariable(49ExecutionContextScope *exe_scope, ConstString name,50const TypeFromUser &user_type, lldb::ByteOrder byte_order,51uint32_t addr_byte_size)52: m_parser_vars(), m_jit_vars() {53m_flags = EVNone;54m_frozen_sp =55ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);56SetName(name);57SetCompilerType(user_type);58}5960TypeFromUser ClangExpressionVariable::GetTypeFromUser() {61TypeFromUser tfu(m_frozen_sp->GetCompilerType());62return tfu;63}646566