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>

Collaboration diagram for lldb_private::TypeSystemMap:
Collaboration graph
[legend]

Public Member Functions

 TypeSystemMap ()
 
 ~TypeSystemMap ()
 
void Clear ()
 
void ForEach (std::function< bool(TypeSystem *)> const &callback)
 
llvm::Expected< TypeSystem & > GetTypeSystemForLanguage (lldb::LanguageType language, Module *module, bool can_create)
 
llvm::Expected< TypeSystem & > GetTypeSystemForLanguage (lldb::LanguageType language, Target *target, bool can_create)
 

Protected Types

typedef std::map< lldb::LanguageType, lldb::TypeSystemSP > collection
 

Protected Attributes

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

Private Types

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

Private Member Functions

llvm::Expected< TypeSystem & > GetTypeSystemForLanguage (lldb::LanguageType language, llvm::Optional< CreateCallback > create_callback=llvm::None)
 Finds the type system for the given language. More...
 

Detailed Description

Definition at line 501 of file TypeSystem.h.

Member Typedef Documentation

◆ collection

typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> lldb_private::TypeSystemMap::collection
protected

Definition at line 523 of file TypeSystem.h.

◆ CreateCallback

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

Definition at line 530 of file TypeSystem.h.

Constructor & Destructor Documentation

◆ TypeSystemMap()

TypeSystemMap::TypeSystemMap ( )

Definition at line 181 of file TypeSystem.cpp.

◆ ~TypeSystemMap()

TypeSystemMap::~TypeSystemMap ( )
default

Member Function Documentation

◆ Clear()

void TypeSystemMap::Clear ( )

◆ ForEach()

void TypeSystemMap::ForEach ( std::function< bool(TypeSystem *)> const &  callback)

◆ GetTypeSystemForLanguage() [1/3]

llvm::Expected< TypeSystem & > TypeSystemMap::GetTypeSystemForLanguage ( lldb::LanguageType  language,
llvm::Optional< CreateCallback create_callback = llvm::None 
)
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 223 of file TypeSystem.cpp.

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

◆ GetTypeSystemForLanguage() [2/3]

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

◆ GetTypeSystemForLanguage() [3/3]

llvm::Expected< TypeSystem & > 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 527 of file TypeSystem.h.

Referenced by Clear(), and GetTypeSystemForLanguage().

◆ m_map

collection lldb_private::TypeSystemMap::m_map
protected

Definition at line 526 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 524 of file TypeSystem.h.

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


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