LLDB mainline
|
#include <TypeSystem.h>
Public Member Functions | |
TypeSystemMap () | |
~TypeSystemMap () | |
void | Clear () |
void | ForEach (std::function< bool(lldb::TypeSystemSP)> const &callback) |
llvm::Expected< lldb::TypeSystemSP > | GetTypeSystemForLanguage (lldb::LanguageType language, Module *module, bool can_create) |
llvm::Expected< lldb::TypeSystemSP > | GetTypeSystemForLanguage (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::TypeSystemSP > | collection |
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::TypeSystemSP > | GetTypeSystemForLanguage (lldb::LanguageType language, std::optional< CreateCallback > create_callback=std::nullopt) |
Finds the type system for the given language. | |
Definition at line 548 of file TypeSystem.h.
|
protected |
Definition at line 573 of file TypeSystem.h.
|
private |
Definition at line 580 of file TypeSystem.h.
TypeSystemMap::TypeSystemMap | ( | ) |
Definition at line 211 of file TypeSystem.cpp.
|
default |
void TypeSystemMap::Clear | ( | ) |
Definition at line 215 of file TypeSystem.cpp.
References m_clear_in_progress, m_map, and m_mutex.
Referenced by lldb_private::Target::ClearModules(), and lldb_private::Target::ModulesDidUnload().
void TypeSystemMap::ForEach | ( | std::function< bool(lldb::TypeSystemSP)> const & | callback | ) |
Definition at line 238 of file TypeSystem.cpp.
References m_map, and m_mutex.
Referenced by lldb_private::Module::ForEachTypeSystem(), lldb_private::Target::GetPersistentSymbol(), and lldb_private::Target::GetPersistentVariable().
bool lldb_private::TypeSystemMap::GetHasForcefullyCompletedTypes | ( | ) | const |
Check all type systems in the map to see if any have forcefully completed types;.
llvm::Expected< lldb::TypeSystemSP > TypeSystemMap::GetTypeSystemForLanguage | ( | lldb::LanguageType | language, |
Module * | module, | ||
bool | can_create | ||
) |
Definition at line 316 of file TypeSystem.cpp.
References lldb_private::TypeSystem::CreateInstance(), and GetTypeSystemForLanguage().
Referenced by lldb_private::Target::GetScratchTypeSystemForLanguage(), lldb_private::Module::GetTypeSystemForLanguage(), and GetTypeSystemForLanguage().
|
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.
language | The language for which the type system should be found. |
create_callback | A 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. |
Definition at line 265 of file TypeSystem.cpp.
References lldb_private::Language::GetNameForLanguageType(), m_clear_in_progress, m_map, and m_mutex.
llvm::Expected< lldb::TypeSystemSP > TypeSystemMap::GetTypeSystemForLanguage | ( | lldb::LanguageType | language, |
Target * | target, | ||
bool | can_create | ||
) |
Definition at line 328 of file TypeSystem.cpp.
References lldb_private::TypeSystem::CreateInstance(), and GetTypeSystemForLanguage().
|
protected |
Definition at line 577 of file TypeSystem.h.
Referenced by Clear(), and GetTypeSystemForLanguage().
|
protected |
Definition at line 576 of file TypeSystem.h.
Referenced by Clear(), ForEach(), and GetTypeSystemForLanguage().
|
mutableprotected |
A mutex to keep this object happy in multi-threaded environments.
Definition at line 574 of file TypeSystem.h.
Referenced by Clear(), ForEach(), and GetTypeSystemForLanguage().