Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
include/lldb/Symbol/TypeSystem.h
Show All 10 Lines | |||||
#include <functional> | #include <functional> | ||||
#include <map> | #include <map> | ||||
#include <mutex> | #include <mutex> | ||||
#include <string> | #include <string> | ||||
#include "llvm/ADT/APSInt.h" | #include "llvm/ADT/APSInt.h" | ||||
#include "llvm/Support/Casting.h" | #include "llvm/Support/Casting.h" | ||||
#include "llvm/Support/Error.h" | |||||
#include "lldb/Core/PluginInterface.h" | #include "lldb/Core/PluginInterface.h" | ||||
#include "lldb/Expression/Expression.h" | #include "lldb/Expression/Expression.h" | ||||
#include "lldb/Symbol/CompilerDecl.h" | #include "lldb/Symbol/CompilerDecl.h" | ||||
#include "lldb/Symbol/CompilerDeclContext.h" | #include "lldb/Symbol/CompilerDeclContext.h" | ||||
#include "lldb/lldb-private.h" | #include "lldb/lldb-private.h" | ||||
class DWARFDIE; | class DWARFDIE; | ||||
▲ Show 20 Lines • Show All 459 Lines • ▼ Show 20 Lines | public: | ||||
// Clear calls Finalize on all the TypeSystems managed by this map, and then | // Clear calls Finalize on all the TypeSystems managed by this map, and then | ||||
// empties the map. | // empties the map. | ||||
void Clear(); | void Clear(); | ||||
// Iterate through all of the type systems that are created. Return true from | // Iterate through all of the type systems that are created. Return true from | ||||
// callback to keep iterating, false to stop iterating. | // callback to keep iterating, false to stop iterating. | ||||
void ForEach(std::function<bool(TypeSystem *)> const &callback); | void ForEach(std::function<bool(TypeSystem *)> const &callback); | ||||
TypeSystem *GetTypeSystemForLanguage(lldb::LanguageType language, | llvm::Expected<TypeSystem &> | ||||
Module *module, bool can_create); | GetTypeSystemForLanguage(lldb::LanguageType language, Module *module, | ||||
bool can_create); | |||||
TypeSystem *GetTypeSystemForLanguage(lldb::LanguageType language, | |||||
Target *target, bool can_create); | llvm::Expected<TypeSystem &> | ||||
GetTypeSystemForLanguage(lldb::LanguageType language, Target *target, | |||||
bool can_create); | |||||
protected: | protected: | ||||
// This function does not take the map mutex, and should only be called from | |||||
// functions that do take the mutex. | |||||
void AddToMap(lldb::LanguageType language, | |||||
lldb::TypeSystemSP const &type_system_sp); | |||||
typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> collection; | typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> collection; | ||||
mutable std::mutex m_mutex; ///< A mutex to keep this object happy in | mutable std::mutex m_mutex; ///< A mutex to keep this object happy in | ||||
///multi-threaded environments. | ///multi-threaded environments. | ||||
collection m_map; | collection m_map; | ||||
bool m_clear_in_progress; | bool m_clear_in_progress; | ||||
}; | }; | ||||
} // namespace lldb_private | } // namespace lldb_private | ||||
#endif // liblldb_TypeSystem_h_ | #endif // liblldb_TypeSystem_h_ |