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

#include <TypeSystem.h>

Public Member Functions

 TypeSystemMap ()
 
 ~TypeSystemMap ()
 
void Clear ()
 
void ForEach (std::function< bool(lldb::TypeSystemSP)> const &callback)
 
llvm::Expected< lldb::TypeSystemSPGetTypeSystemForLanguage (lldb::LanguageType language, Module *module, bool can_create)
 
llvm::Expected< lldb::TypeSystemSPGetTypeSystemForLanguage (lldb::LanguageType language, Target *target, bool can_create)
 
bool GetHasForcefullyCompletedTypes () const
 Check all type systems in the map to see if any have forcefully completed types;.
 

Protected Types

typedef llvm::DenseMap< uint16_t, lldb::TypeSystemSPcollection
 

Protected Attributes

std::mutex m_mutex
 A mutex to keep this object happy in multi-threaded environments.
 
collection m_map
 
bool m_clear_in_progress = false
 

Private Types

typedef llvm::function_ref< lldb::TypeSystemSP()> CreateCallback
 

Private Member Functions

llvm::Expected< lldb::TypeSystemSPGetTypeSystemForLanguage (lldb::LanguageType language, std::optional< CreateCallback > create_callback=std::nullopt)
 Finds the type system for the given language.
 

Detailed Description

Definition at line 529 of file TypeSystem.h.

Member Typedef Documentation

◆ collection

typedef llvm::DenseMap<uint16_t, lldb::TypeSystemSP> lldb_private::TypeSystemMap::collection
protected

Definition at line 554 of file TypeSystem.h.

◆ CreateCallback

typedef llvm::function_ref<lldb::TypeSystemSP()> lldb_private::TypeSystemMap::CreateCallback
private

Definition at line 561 of file TypeSystem.h.

Constructor & Destructor Documentation

◆ TypeSystemMap()

TypeSystemMap::TypeSystemMap ( )

Definition at line 206 of file TypeSystem.cpp.

◆ ~TypeSystemMap()

TypeSystemMap::~TypeSystemMap ( )
default

Member Function Documentation

◆ Clear()

void TypeSystemMap::Clear ( )

◆ ForEach()

void TypeSystemMap::ForEach ( std::function< bool(lldb::TypeSystemSP)> const &  callback)

◆ GetHasForcefullyCompletedTypes()

bool lldb_private::TypeSystemMap::GetHasForcefullyCompletedTypes ( ) const

Check all type systems in the map to see if any have forcefully completed types;.

◆ GetTypeSystemForLanguage() [1/3]

llvm::Expected< lldb::TypeSystemSP > TypeSystemMap::GetTypeSystemForLanguage ( lldb::LanguageType  language,
Module module,
bool  can_create 
)

◆ GetTypeSystemForLanguage() [2/3]

llvm::Expected< lldb::TypeSystemSP > TypeSystemMap::GetTypeSystemForLanguage ( lldb::LanguageType  language,
std::optional< CreateCallback create_callback = std::nullopt 
)
private

Finds the type system for the given language.

If no type system could be found for a language and a CreateCallback was provided, the value returned by the callback will be treated as the TypeSystem for the language.

Parameters
languageThe language for which the type system should be found.
create_callbackA callback that will be called if no previously created TypeSystem that fits the given language could found. Can be omitted if a non-existent type system should be treated as an error instead.
Returns
The found type system or an error.

Definition at line 260 of file TypeSystem.cpp.

References lldb_private::Language::GetNameForLanguageType(), m_clear_in_progress, m_map, and m_mutex.

◆ GetTypeSystemForLanguage() [3/3]

llvm::Expected< lldb::TypeSystemSP > TypeSystemMap::GetTypeSystemForLanguage ( lldb::LanguageType  language,
Target target,
bool  can_create 
)

Member Data Documentation

◆ m_clear_in_progress

bool lldb_private::TypeSystemMap::m_clear_in_progress = false
protected

Definition at line 558 of file TypeSystem.h.

Referenced by Clear(), and GetTypeSystemForLanguage().

◆ m_map

collection lldb_private::TypeSystemMap::m_map
protected

Definition at line 557 of file TypeSystem.h.

Referenced by Clear(), ForEach(), and GetTypeSystemForLanguage().

◆ m_mutex

std::mutex lldb_private::TypeSystemMap::m_mutex
mutableprotected

A mutex to keep this object happy in multi-threaded environments.

Definition at line 555 of file TypeSystem.h.

Referenced by Clear(), ForEach(), and GetTypeSystemForLanguage().


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