LLDB mainline
lldb_private::ClangExpressionVariable Class Reference

"lldb/Expression/ClangExpressionVariable.h" Encapsulates one variable for the expression parser. More...

#include <ClangExpressionVariable.h>

Inheritance diagram for lldb_private::ClangExpressionVariable:
[legend]

Classes

struct  JITVars
 The following values are valid if the variable is used by JIT code. More...
class  ParserVars
 The following values should not live beyond parsing. More...

Public Member Functions

 ClangExpressionVariable (ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size)
 ClangExpressionVariable (ExecutionContextScope *exe_scope, Value &value, ConstString name, uint16_t flags=EVNone)
 ClangExpressionVariable (const lldb::ValueObjectSP &valobj_sp)
 ClangExpressionVariable (ExecutionContextScope *exe_scope, ConstString name, const TypeFromUser &user_type, lldb::ByteOrder byte_order, uint32_t addr_byte_size)
bool PointValueAtData (Value &value, ExecutionContext *exe_ctx)
 If the variable contains its own data, make a Value point at it.
void EnableParserVars (uint64_t parser_id)
 Make this variable usable by the parser by allocating space for parser- specific variables.
void DisableParserVars (uint64_t parser_id)
 Deallocate parser-specific variables.
ParserVarsGetParserVars (uint64_t parser_id)
 Access parser-specific variables.
void EnableJITVars (uint64_t parser_id)
 Make this variable usable for materializing for the JIT by allocating space for JIT-specific variables.
void DisableJITVars (uint64_t parser_id)
 Deallocate JIT-specific variables.
JITVarsGetJITVars (uint64_t parser_id)
TypeFromUser GetTypeFromUser ()
 ClangExpressionVariable (const ClangExpressionVariable &)=delete
 Members.
const ClangExpressionVariableoperator= (const ClangExpressionVariable &)=delete

Static Public Member Functions

static ClangExpressionVariableFindVariableInList (ExpressionVariableList &list, const clang::NamedDecl *decl, uint64_t parser_id)
 Utility functions for dealing with ExpressionVariableLists in Clang- specific ways.

Static Public Attributes

static char ID

Private Types

typedef std::map< uint64_t, ParserVarsParserVarMap
typedef std::map< uint64_t, JITVarsJITVarMap

Private Attributes

ParserVarMap m_parser_vars
JITVarMap m_jit_vars

Detailed Description

"lldb/Expression/ClangExpressionVariable.h" Encapsulates one variable for the expression parser.

The expression parser uses variables in three different contexts:

First, it stores persistent variables along with the process for use in expressions. These persistent variables contain their own data and are typed.

Second, in an interpreted expression, it stores the local variables for the expression along with the expression. These variables contain their own data and are typed.

Third, in a JIT-compiled expression, it stores the variables that the expression needs to have materialized and dematerialized at each execution. These do not contain their own data but are named and typed.

This class supports all of these use cases using simple type polymorphism, and provides necessary support methods. Its interface is RTTI-neutral.

Definition at line 60 of file ClangExpressionVariable.h.

Member Typedef Documentation

◆ JITVarMap

typedef std::map<uint64_t, JITVars> lldb_private::ClangExpressionVariable::JITVarMap
private

Definition at line 180 of file ClangExpressionVariable.h.

◆ ParserVarMap

Definition at line 145 of file ClangExpressionVariable.h.

Constructor & Destructor Documentation

◆ ClangExpressionVariable() [1/5]

ClangExpressionVariable::ClangExpressionVariable ( ExecutionContextScope * exe_scope,
lldb::ByteOrder byte_order,
uint32_t addr_byte_size )

◆ ClangExpressionVariable() [2/5]

ClangExpressionVariable::ClangExpressionVariable ( ExecutionContextScope * exe_scope,
Value & value,
ConstString name,
uint16_t flags = EVNone )

◆ ClangExpressionVariable() [3/5]

ClangExpressionVariable::ClangExpressionVariable ( const lldb::ValueObjectSP & valobj_sp)

Definition at line 42 of file ClangExpressionVariable.cpp.

References m_jit_vars, and m_parser_vars.

◆ ClangExpressionVariable() [4/5]

ClangExpressionVariable::ClangExpressionVariable ( ExecutionContextScope * exe_scope,
ConstString name,
const TypeFromUser & user_type,
lldb::ByteOrder byte_order,
uint32_t addr_byte_size )

◆ ClangExpressionVariable() [5/5]

lldb_private::ClangExpressionVariable::ClangExpressionVariable ( const ClangExpressionVariable & )
delete

Members.

References ClangExpressionVariable().

Member Function Documentation

◆ DisableJITVars()

void lldb_private::ClangExpressionVariable::DisableJITVars ( uint64_t parser_id)
inline

Deallocate JIT-specific variables.

Definition at line 191 of file ClangExpressionVariable.h.

References m_jit_vars.

◆ DisableParserVars()

void lldb_private::ClangExpressionVariable::DisableParserVars ( uint64_t parser_id)
inline

Deallocate parser-specific variables.

Definition at line 156 of file ClangExpressionVariable.h.

References m_parser_vars.

◆ EnableJITVars()

void lldb_private::ClangExpressionVariable::EnableJITVars ( uint64_t parser_id)
inline

Make this variable usable for materializing for the JIT by allocating space for JIT-specific variables.

Definition at line 186 of file ClangExpressionVariable.h.

References m_jit_vars.

Referenced by lldb_private::ClangExpressionDeclMap::AddPersistentVariable().

◆ EnableParserVars()

void lldb_private::ClangExpressionVariable::EnableParserVars ( uint64_t parser_id)
inline

◆ FindVariableInList()

ClangExpressionVariable * lldb_private::ClangExpressionVariable::FindVariableInList ( ExpressionVariableList & list,
const clang::NamedDecl * decl,
uint64_t parser_id )
inlinestatic

Utility functions for dealing with ExpressionVariableLists in Clang- specific ways.

Finds a variable by NamedDecl in the list.

Returns
The variable requested, or NULL if that variable is not in the list.

Definition at line 87 of file ClangExpressionVariable.h.

References ClangExpressionVariable(), lldb_private::ExpressionVariableList::GetSize(), lldb_private::ExpressionVariableList::GetVariableAtIndex(), and lldb_private::ClangExpressionVariable::ParserVars::m_named_decl.

Referenced by lldb_private::ClangExpressionDeclMap::AddValueToStruct(), and lldb_private::ClangExpressionDeclMap::GetFunctionInfo().

◆ GetJITVars()

JITVars * lldb_private::ClangExpressionVariable::GetJITVars ( uint64_t parser_id)
inline

◆ GetParserVars()

◆ GetTypeFromUser()

TypeFromUser ClangExpressionVariable::GetTypeFromUser ( )

Definition at line 61 of file ClangExpressionVariable.cpp.

◆ operator=()

const ClangExpressionVariable & lldb_private::ClangExpressionVariable::operator= ( const ClangExpressionVariable & )
delete

◆ PointValueAtData()

bool lldb_private::ClangExpressionVariable::PointValueAtData ( Value & value,
ExecutionContext * exe_ctx )

If the variable contains its own data, make a Value point at it.

If exe_ctx in not NULL, the value will be resolved in with that execution context.

Parameters
[in]valueThe value to point at the data.
[in]exe_ctxThe execution context to use to resolve value.
Returns
True on success; false otherwise (in particular, if this variable does not contain its own data).

Member Data Documentation

◆ ID

char ClangExpressionVariable::ID
static

Definition at line 64 of file ClangExpressionVariable.h.

◆ m_jit_vars

JITVarMap lldb_private::ClangExpressionVariable::m_jit_vars
private

◆ m_parser_vars


The documentation for this class was generated from the following files: