LLDB mainline
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Attributes | List of all members
lldb_private::ClangPersistentVariables Class Reference

"lldb/Expression/ClangPersistentVariables.h" Manages persistent values that need to be preserved between expression invocations. More...

#include <ClangPersistentVariables.h>

Inheritance diagram for lldb_private::ClangPersistentVariables:
Inheritance graph
[legend]

Classes

struct  PersistentDecl
 

Public Member Functions

 ClangPersistentVariables (std::shared_ptr< Target > target_sp)
 
 ~ClangPersistentVariables () override=default
 
std::shared_ptr< ClangASTImporterGetClangASTImporter ()
 
std::shared_ptr< ClangModulesDeclVendorGetClangModulesDeclVendor ()
 
lldb::ExpressionVariableSP CreatePersistentVariable (const lldb::ValueObjectSP &valobj_sp) override
 
lldb::ExpressionVariableSP CreatePersistentVariable (ExecutionContextScope *exe_scope, ConstString name, const CompilerType &compiler_type, lldb::ByteOrder byte_order, uint32_t addr_byte_size) override
 
void RemovePersistentVariable (lldb::ExpressionVariableSP variable) override
 
ConstString GetNextPersistentVariableName (bool is_error=false) override
 
std::string GetNextExprFileName ()
 Returns the next file name that should be used for user expressions.
 
std::optional< CompilerTypeGetCompilerTypeFromPersistentDecl (ConstString type_name) override
 
void RegisterPersistentDecl (ConstString name, clang::NamedDecl *decl, std::shared_ptr< TypeSystemClang > ctx)
 
clang::NamedDecl * GetPersistentDecl (ConstString name)
 
void AddHandLoadedClangModule (ClangModulesDeclVendor::ModuleID module)
 
const ClangModulesDeclVendor::ModuleVectorGetHandLoadedClangModules ()
 

Static Public Attributes

static char ID
 

Protected Member Functions

llvm::StringRef GetPersistentVariablePrefix (bool is_error=false) const override
 

Private Types

typedef llvm::DenseMap< const char *, PersistentDeclPersistentDeclMap
 

Private Attributes

uint32_t m_next_user_file_id = 0
 The counter used by GetNextExprFileName.
 
uint32_t m_next_persistent_variable_id = 0
 
PersistentDeclMap m_persistent_decls
 Persistent entities declared by the user.
 
ClangModulesDeclVendor::ModuleVector m_hand_loaded_clang_modules
 These are Clang modules we hand-loaded; these are the highest- priority source for macros.
 
std::shared_ptr< ClangASTImporterm_ast_importer_sp
 
std::shared_ptr< ClangModulesDeclVendorm_modules_decl_vendor_sp
 
std::shared_ptr< Targetm_target_sp
 

Detailed Description

"lldb/Expression/ClangPersistentVariables.h" Manages persistent values that need to be preserved between expression invocations.

A list of variables that can be accessed and updated by any expression. See ClangPersistentVariable for more discussion. Also provides an increasing, 0-based counter for naming result variables.

Definition at line 34 of file ClangPersistentVariables.h.

Member Typedef Documentation

◆ PersistentDeclMap

typedef llvm::DenseMap<const char *, PersistentDecl> lldb_private::ClangPersistentVariables::PersistentDeclMap
private

Definition at line 104 of file ClangPersistentVariables.h.

Constructor & Destructor Documentation

◆ ClangPersistentVariables()

ClangPersistentVariables::ClangPersistentVariables ( std::shared_ptr< Target target_sp)

Definition at line 31 of file ClangPersistentVariables.cpp.

◆ ~ClangPersistentVariables()

lldb_private::ClangPersistentVariables::~ClangPersistentVariables ( )
overridedefault

Member Function Documentation

◆ AddHandLoadedClangModule()

void lldb_private::ClangPersistentVariables::AddHandLoadedClangModule ( ClangModulesDeclVendor::ModuleID  module)
inline

◆ CreatePersistentVariable() [1/2]

ExpressionVariableSP ClangPersistentVariables::CreatePersistentVariable ( const lldb::ValueObjectSP valobj_sp)
override

Definition at line 35 of file ClangPersistentVariables.cpp.

◆ CreatePersistentVariable() [2/2]

ExpressionVariableSP ClangPersistentVariables::CreatePersistentVariable ( ExecutionContextScope exe_scope,
ConstString  name,
const CompilerType compiler_type,
lldb::ByteOrder  byte_order,
uint32_t  addr_byte_size 
)
override

Definition at line 40 of file ClangPersistentVariables.cpp.

◆ GetClangASTImporter()

std::shared_ptr< ClangASTImporter > ClangPersistentVariables::GetClangASTImporter ( )

Definition at line 111 of file ClangPersistentVariables.cpp.

References m_ast_importer_sp.

◆ GetClangModulesDeclVendor()

std::shared_ptr< ClangModulesDeclVendor > ClangPersistentVariables::GetClangModulesDeclVendor ( )

◆ GetCompilerTypeFromPersistentDecl()

std::optional< CompilerType > ClangPersistentVariables::GetCompilerTypeFromPersistentDecl ( ConstString  type_name)
override

◆ GetHandLoadedClangModules()

const ClangModulesDeclVendor::ModuleVector & lldb_private::ClangPersistentVariables::GetHandLoadedClangModules ( )
inline

Definition at line 81 of file ClangPersistentVariables.h.

References m_hand_loaded_clang_modules.

◆ GetNextExprFileName()

std::string lldb_private::ClangPersistentVariables::GetNextExprFileName ( )
inline

Returns the next file name that should be used for user expressions.

Definition at line 61 of file ClangPersistentVariables.h.

References m_next_user_file_id.

Referenced by lldb_private::ClangUserExpression::PrepareForParsing().

◆ GetNextPersistentVariableName()

ConstString ClangPersistentVariables::GetNextPersistentVariableName ( bool  is_error = false)
override

◆ GetPersistentDecl()

clang::NamedDecl * ClangPersistentVariables::GetPersistentDecl ( ConstString  name)

◆ GetPersistentVariablePrefix()

llvm::StringRef lldb_private::ClangPersistentVariables::GetPersistentVariablePrefix ( bool  is_error = false) const
inlineoverrideprotected

◆ RegisterPersistentDecl()

void ClangPersistentVariables::RegisterPersistentDecl ( ConstString  name,
clang::NamedDecl *  decl,
std::shared_ptr< TypeSystemClang ctx 
)

◆ RemovePersistentVariable()

void ClangPersistentVariables::RemovePersistentVariable ( lldb::ExpressionVariableSP  variable)
override

Member Data Documentation

◆ ID

char ClangPersistentVariables::ID
static

Definition at line 39 of file ClangPersistentVariables.h.

◆ m_ast_importer_sp

std::shared_ptr<ClangASTImporter> lldb_private::ClangPersistentVariables::m_ast_importer_sp
private

Definition at line 112 of file ClangPersistentVariables.h.

Referenced by GetClangASTImporter().

◆ m_hand_loaded_clang_modules

ClangModulesDeclVendor::ModuleVector lldb_private::ClangPersistentVariables::m_hand_loaded_clang_modules
private

These are Clang modules we hand-loaded; these are the highest- priority source for macros.

Definition at line 109 of file ClangPersistentVariables.h.

Referenced by AddHandLoadedClangModule(), and GetHandLoadedClangModules().

◆ m_modules_decl_vendor_sp

std::shared_ptr<ClangModulesDeclVendor> lldb_private::ClangPersistentVariables::m_modules_decl_vendor_sp
private

Definition at line 113 of file ClangPersistentVariables.h.

Referenced by GetClangModulesDeclVendor().

◆ m_next_persistent_variable_id

uint32_t lldb_private::ClangPersistentVariables::m_next_persistent_variable_id = 0
private

◆ m_next_user_file_id

uint32_t lldb_private::ClangPersistentVariables::m_next_user_file_id = 0
private

The counter used by GetNextExprFileName.

Definition at line 93 of file ClangPersistentVariables.h.

Referenced by GetNextExprFileName().

◆ m_persistent_decls

PersistentDeclMap lldb_private::ClangPersistentVariables::m_persistent_decls
private

Persistent entities declared by the user.

Definition at line 106 of file ClangPersistentVariables.h.

Referenced by GetCompilerTypeFromPersistentDecl(), GetPersistentDecl(), and RegisterPersistentDecl().

◆ m_target_sp

std::shared_ptr<Target> lldb_private::ClangPersistentVariables::m_target_sp
private

Definition at line 114 of file ClangPersistentVariables.h.

Referenced by GetClangModulesDeclVendor().


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