LLDB mainline
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Attributes | List of all members
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:
Inheritance graph


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
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

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.

◆ 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 )


Member Function Documentation

◆ DisableJITVars()

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

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)

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)

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)

◆ FindVariableInList()

static ClangExpressionVariable * lldb_private::ClangExpressionVariable::FindVariableInList ( ExpressionVariableList list,
const clang::NamedDecl *  decl,
uint64_t  parser_id 

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

Finds a variable by NamedDecl in the list.

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

Definition at line 87 of file ClangExpressionVariable.h.

References 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)

◆ GetParserVars()

ParserVars * lldb_private::ClangExpressionVariable::GetParserVars ( uint64_t  parser_id)

◆ GetTypeFromUser()

TypeFromUser ClangExpressionVariable::GetTypeFromUser ( )

Definition at line 61 of file ClangExpressionVariable.cpp.

◆ operator=()

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

◆ 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.

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

Member Data Documentation

◆ ID

char ClangExpressionVariable::ID

Definition at line 64 of file ClangExpressionVariable.h.

◆ m_jit_vars

JITVarMap lldb_private::ClangExpressionVariable::m_jit_vars

Definition at line 181 of file ClangExpressionVariable.h.

Referenced by DisableJITVars(), EnableJITVars(), and GetJITVars().

◆ m_parser_vars

ParserVarMap lldb_private::ClangExpressionVariable::m_parser_vars

Definition at line 146 of file ClangExpressionVariable.h.

Referenced by DisableParserVars(), EnableParserVars(), and GetParserVars().

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