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

This class tracks the state and results of a TypeQuery. More...

#include <Type.h>

Public Member Functions

 TypeResults ()=default
 Construct a type results object.
 
bool InsertUnique (const lldb::TypeSP &type_sp)
 When types that match a TypeQuery are found, this API is used to insert the matching types.
 
bool Done (const TypeQuery &query) const
 Check if the type matching has found all of the matches that it needs.
 
bool AlreadySearched (lldb_private::SymbolFile *sym_file)
 Check if a SymbolFile object has already been searched by this type match object.
 
llvm::DenseSet< lldb_private::SymbolFile * > & GetSearchedSymbolFiles ()
 Access the set of searched symbol files.
 
lldb::TypeSP GetFirstType () const
 
TypeMapGetTypeMap ()
 
const TypeMapGetTypeMap () const
 

Private Attributes

TypeMap m_type_map
 Matching types get added to this map as type search continues.
 
llvm::DenseSet< lldb_private::SymbolFile * > m_searched_symbol_files
 This set is used to track and make sure we only perform lookups in a symbol file one time.
 

Detailed Description

This class tracks the state and results of a TypeQuery.

Any mutable state required for type lookups and the results are tracked in this object.

Definition at line 310 of file Type.h.

Constructor & Destructor Documentation

◆ TypeResults()

lldb_private::TypeResults::TypeResults ( )
default

Construct a type results object.

Member Function Documentation

◆ AlreadySearched()

bool TypeResults::AlreadySearched ( lldb_private::SymbolFile sym_file)

Check if a SymbolFile object has already been searched by this type match object.

This function will add sym_file to the set of SymbolFile objects if it isn't already in the set and return false. Returns true if sym_file was already in the set and doesn't need to be searched.

Any clients that search for types should first check that the symbol file has not already been searched. If this function returns true, the type search function should early return to avoid duplicating type searchihng efforts.

Parameters
[in]sym_fileA SymbolFile pointer that will be used to track which symbol files have already been searched.
Returns
True if the symbol file has been search already, false otherwise.

Definition at line 169 of file Type.cpp.

References m_searched_symbol_files.

Referenced by lldb_private::SymbolFileCTF::FindTypes(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindTypes(), lldb_private::npdb::SymbolFileNativePDB::FindTypes(), SymbolFilePDB::FindTypes(), and DWARFASTParserClang::ParseTypeFromClangModule().

◆ Done()

bool TypeResults::Done ( const TypeQuery query) const

◆ GetFirstType()

lldb::TypeSP lldb_private::TypeResults::GetFirstType ( ) const
inline

◆ GetSearchedSymbolFiles()

llvm::DenseSet< lldb_private::SymbolFile * > & lldb_private::TypeResults::GetSearchedSymbolFiles ( )
inline

Access the set of searched symbol files.

Definition at line 347 of file Type.h.

References m_searched_symbol_files.

Referenced by DWARFASTParserClang::ParseTypeFromClangModule().

◆ GetTypeMap() [1/2]

TypeMap & lldb_private::TypeResults::GetTypeMap ( )
inline

◆ GetTypeMap() [2/2]

const TypeMap & lldb_private::TypeResults::GetTypeMap ( ) const
inline

Definition at line 353 of file Type.h.

References m_type_map.

◆ InsertUnique()

bool TypeResults::InsertUnique ( const lldb::TypeSP type_sp)

When types that match a TypeQuery are found, this API is used to insert the matching types.

Returns
True if the type was added, false if the type_sp was already in the results.

Definition at line 173 of file Type.cpp.

References lldb_private::TypeMap::InsertUnique(), and m_type_map.

Referenced by lldb_private::SymbolFileCTF::FindTypes(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindTypes(), lldb_private::npdb::SymbolFileNativePDB::FindTypes(), and SymbolFilePDB::FindTypes().

Member Data Documentation

◆ m_searched_symbol_files

llvm::DenseSet<lldb_private::SymbolFile *> lldb_private::TypeResults::m_searched_symbol_files
private

This set is used to track and make sure we only perform lookups in a symbol file one time.

Definition at line 360 of file Type.h.

Referenced by AlreadySearched(), and GetSearchedSymbolFiles().

◆ m_type_map

TypeMap lldb_private::TypeResults::m_type_map
private

Matching types get added to this map as type search continues.

Definition at line 357 of file Type.h.

Referenced by Done(), GetFirstType(), GetTypeMap(), and InsertUnique().


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