LLDB mainline
lldb_private::npdb::PdbAstBuilder Class Reference

#include <PdbAstBuilder.h>

Public Member Functions

 PdbAstBuilder (TypeSystemClang &clang)
lldb_private::CompilerDeclContext GetTranslationUnitDecl ()
std::optional< lldb_private::CompilerDeclGetOrCreateDeclForUid (PdbSymUid uid)
clang::DeclContext * GetOrCreateDeclContextForUid (PdbSymUid uid)
clang::DeclContext * GetParentDeclContext (PdbSymUid uid)
clang::FunctionDecl * GetOrCreateFunctionDecl (PdbCompilandSymId func_id)
clang::FunctionDecl * GetOrCreateInlinedFunctionDecl (PdbCompilandSymId inlinesite_id)
clang::BlockDecl * GetOrCreateBlockDecl (PdbCompilandSymId block_id)
clang::VarDecl * GetOrCreateVariableDecl (PdbCompilandSymId scope_id, PdbCompilandSymId var_id)
clang::VarDecl * GetOrCreateVariableDecl (PdbGlobalSymId var_id)
clang::TypedefNameDecl * GetOrCreateTypedefDecl (PdbGlobalSymId id)
void ParseDeclsForContext (clang::DeclContext &context)
clang::QualType GetBasicType (lldb::BasicType type)
clang::QualType GetOrCreateType (PdbTypeSymId type)
bool CompleteTagDecl (clang::TagDecl &tag)
bool CompleteType (clang::QualType qt)
CompilerDecl ToCompilerDecl (clang::Decl &decl)
CompilerType ToCompilerType (clang::QualType qt)
CompilerDeclContext ToCompilerDeclContext (clang::DeclContext &context)
clang::Decl * FromCompilerDecl (CompilerDecl decl)
clang::DeclContext * FromCompilerDeclContext (CompilerDeclContext context)
TypeSystemClangclang ()
ClangASTImporterGetClangASTImporter ()
void Dump (Stream &stream, llvm::StringRef filter, bool show_color)
clang::NamespaceDecl * FindNamespaceDecl (const clang::DeclContext *parent, llvm::StringRef name)

Private Types

using TypeIndex = llvm::codeview::TypeIndex
using NamespaceSet = llvm::DenseSet<clang::NamespaceDecl *>

Private Member Functions

clang::Decl * TryGetDecl (PdbSymUid uid) const
clang::QualType CreatePointerType (const llvm::codeview::PointerRecord &pointer)
clang::QualType CreateModifierType (const llvm::codeview::ModifierRecord &modifier)
clang::QualType CreateArrayType (const llvm::codeview::ArrayRecord &array)
clang::QualType CreateRecordType (PdbTypeSymId id, const llvm::codeview::TagRecord &record)
clang::QualType CreateEnumType (PdbTypeSymId id, const llvm::codeview::EnumRecord &record)
clang::QualType CreateFunctionType (TypeIndex args_type_idx, TypeIndex return_type_idx, llvm::codeview::CallingConvention calling_convention)
clang::QualType CreateType (PdbTypeSymId type)
void CreateFunctionParameters (PdbCompilandSymId func_id, clang::FunctionDecl &function_decl, uint32_t param_count)
clang::Decl * GetOrCreateSymbolForId (PdbCompilandSymId id)
clang::VarDecl * CreateVariableDecl (PdbSymUid uid, llvm::codeview::CVSymbol sym, clang::DeclContext &scope)
clang::NamespaceDecl * GetOrCreateNamespaceDecl (const char *name, clang::DeclContext &context)
clang::FunctionDecl * CreateFunctionDeclFromId (PdbTypeSymId func_tid, PdbCompilandSymId func_sid)
clang::FunctionDecl * CreateFunctionDecl (PdbCompilandSymId func_id, llvm::StringRef func_name, TypeIndex func_ti, CompilerType func_ct, uint32_t param_count, clang::StorageClass func_storage, bool is_inline, clang::DeclContext *parent)
void ParseNamespace (clang::DeclContext &parent)
void ParseAllTypes ()
void ParseAllFunctionsAndNonLocalVars ()
void ParseDeclsForSimpleContext (clang::DeclContext &context)
void ParseBlockChildren (PdbCompilandSymId block_id)
std::pair< clang::DeclContext *, std::string > CreateDeclInfoForType (const llvm::codeview::TagRecord &record, TypeIndex ti)
std::pair< clang::DeclContext *, std::string > CreateDeclInfoForUndecoratedName (llvm::StringRef uname)
clang::QualType CreateSimpleType (TypeIndex ti)

Private Attributes

TypeSystemClangm_clang
ClangASTImporter m_importer
llvm::once_flag m_parse_functions_and_non_local_vars
llvm::once_flag m_parse_all_types
llvm::DenseMap< clang::Decl *, DeclStatusm_decl_to_status
llvm::DenseMap< lldb::user_id_t, clang::Decl * > m_uid_to_decl
llvm::DenseMap< lldb::user_id_t, clang::QualType > m_uid_to_type
llvm::DenseMap< lldb::opaque_compiler_type_t, llvm::SmallSet< std::pair< llvm::StringRef, CompilerType >, 8 > > m_cxx_record_map
NamespaceSet m_parsed_namespaces
NamespaceSet m_known_namespaces
llvm::DenseMap< clang::DeclContext *, NamespaceSetm_parent_to_namespaces

Detailed Description

Definition at line 53 of file PdbAstBuilder.h.

Member Typedef Documentation

◆ NamespaceSet

using lldb_private::npdb::PdbAstBuilder::NamespaceSet = llvm::DenseSet<clang::NamespaceDecl *>
private

Definition at line 157 of file PdbAstBuilder.h.

◆ TypeIndex

using lldb_private::npdb::PdbAstBuilder::TypeIndex = llvm::codeview::TypeIndex
private

Definition at line 98 of file PdbAstBuilder.h.

Constructor & Destructor Documentation

◆ PdbAstBuilder()

PdbAstBuilder::PdbAstBuilder ( TypeSystemClang & clang)

Definition at line 163 of file PdbAstBuilder.cpp.

References m_clang.

Member Function Documentation

◆ clang()

TypeSystemClang & lldb_private::npdb::PdbAstBuilder::clang ( )
inline

Definition at line 87 of file PdbAstBuilder.h.

References m_clang.

◆ CompleteTagDecl()

◆ CompleteType()

bool PdbAstBuilder::CompleteType ( clang::QualType qt)

◆ CreateArrayType()

clang::QualType PdbAstBuilder::CreateArrayType ( const llvm::codeview::ArrayRecord & array)
private

◆ CreateDeclInfoForType()

std::pair< clang::DeclContext *, std::string > PdbAstBuilder::CreateDeclInfoForType ( const llvm::codeview::TagRecord & record,
TypeIndex ti )
private

◆ CreateDeclInfoForUndecoratedName()

std::pair< clang::DeclContext *, std::string > PdbAstBuilder::CreateDeclInfoForUndecoratedName ( llvm::StringRef uname)
private

◆ CreateEnumType()

clang::QualType PdbAstBuilder::CreateEnumType ( PdbTypeSymId id,
const llvm::codeview::EnumRecord & record )
private

◆ CreateFunctionDecl()

clang::FunctionDecl * PdbAstBuilder::CreateFunctionDecl ( PdbCompilandSymId func_id,
llvm::StringRef func_name,
TypeIndex func_ti,
CompilerType func_ct,
uint32_t param_count,
clang::StorageClass func_storage,
bool is_inline,
clang::DeclContext * parent )
private

◆ CreateFunctionDeclFromId()

◆ CreateFunctionParameters()

◆ CreateFunctionType()

clang::QualType PdbAstBuilder::CreateFunctionType ( TypeIndex args_type_idx,
TypeIndex return_type_idx,
llvm::codeview::CallingConvention calling_convention )
private

◆ CreateModifierType()

clang::QualType PdbAstBuilder::CreateModifierType ( const llvm::codeview::ModifierRecord & modifier)
private

Definition at line 590 of file PdbAstBuilder.cpp.

References GetOrCreateType().

Referenced by CreateType().

◆ CreatePointerType()

clang::QualType PdbAstBuilder::CreatePointerType ( const llvm::codeview::PointerRecord & pointer)
private

Definition at line 517 of file PdbAstBuilder.cpp.

References GetOrCreateType(), and m_clang.

Referenced by CreateType().

◆ CreateRecordType()

◆ CreateSimpleType()

clang::QualType PdbAstBuilder::CreateSimpleType ( TypeIndex ti)
private

◆ CreateType()

◆ CreateVariableDecl()

◆ Dump()

void PdbAstBuilder::Dump ( Stream & stream,
llvm::StringRef filter,
bool show_color )

Definition at line 1457 of file PdbAstBuilder.cpp.

References lldb_private::Stream::AsRawOstream(), and m_clang.

◆ FindNamespaceDecl()

clang::NamespaceDecl * PdbAstBuilder::FindNamespaceDecl ( const clang::DeclContext * parent,
llvm::StringRef name )

◆ FromCompilerDecl()

clang::Decl * PdbAstBuilder::FromCompilerDecl ( CompilerDecl decl)

Definition at line 1448 of file PdbAstBuilder.cpp.

References lldb_private::ClangUtil::GetDecl().

Referenced by GetOrCreateDeclContextForUid().

◆ FromCompilerDeclContext()

◆ GetBasicType()

clang::QualType PdbAstBuilder::GetBasicType ( lldb::BasicType type)

Definition at line 753 of file PdbAstBuilder.cpp.

References lldb_private::CompilerType::GetOpaqueQualType(), and m_clang.

Referenced by CreateSimpleType().

◆ GetClangASTImporter()

ClangASTImporter & lldb_private::npdb::PdbAstBuilder::GetClangASTImporter ( )
inline

Definition at line 88 of file PdbAstBuilder.h.

References m_importer.

Referenced by lldb_private::npdb::SymbolFileNativePDB::CompleteType().

◆ GetOrCreateBlockDecl()

◆ GetOrCreateDeclContextForUid()

◆ GetOrCreateDeclForUid()

◆ GetOrCreateFunctionDecl()

◆ GetOrCreateInlinedFunctionDecl()

◆ GetOrCreateNamespaceDecl()

clang::NamespaceDecl * PdbAstBuilder::GetOrCreateNamespaceDecl ( const char * name,
clang::DeclContext & context )
private

◆ GetOrCreateSymbolForId()

◆ GetOrCreateType()

◆ GetOrCreateTypedefDecl()

◆ GetOrCreateVariableDecl() [1/2]

clang::VarDecl * PdbAstBuilder::GetOrCreateVariableDecl ( PdbCompilandSymId scope_id,
PdbCompilandSymId var_id )

◆ GetOrCreateVariableDecl() [2/2]

clang::VarDecl * PdbAstBuilder::GetOrCreateVariableDecl ( PdbGlobalSymId var_id)

◆ GetParentDeclContext()

◆ GetTranslationUnitDecl()

◆ ParseAllFunctionsAndNonLocalVars()

◆ ParseAllTypes()

void PdbAstBuilder::ParseAllTypes ( )
private

◆ ParseBlockChildren()

◆ ParseDeclsForContext()

void PdbAstBuilder::ParseDeclsForContext ( clang::DeclContext & context)

◆ ParseDeclsForSimpleContext()

void PdbAstBuilder::ParseDeclsForSimpleContext ( clang::DeclContext & context)
private

◆ ParseNamespace()

◆ ToCompilerDecl()

CompilerDecl PdbAstBuilder::ToCompilerDecl ( clang::Decl & decl)

Definition at line 1435 of file PdbAstBuilder.cpp.

References m_clang.

Referenced by GetOrCreateDeclForUid().

◆ ToCompilerDeclContext()

◆ ToCompilerType()

◆ TryGetDecl()

Member Data Documentation

◆ m_clang

◆ m_cxx_record_map

llvm::DenseMap<lldb::opaque_compiler_type_t, llvm::SmallSet<std::pair<llvm::StringRef, CompilerType>, 8> > lldb_private::npdb::PdbAstBuilder::m_cxx_record_map
private

Definition at line 155 of file PdbAstBuilder.h.

Referenced by CompleteTagDecl(), and CreateFunctionDecl().

◆ m_decl_to_status

llvm::DenseMap<clang::Decl *, DeclStatus> lldb_private::npdb::PdbAstBuilder::m_decl_to_status
private

◆ m_importer

ClangASTImporter lldb_private::npdb::PdbAstBuilder::m_importer
private

Definition at line 144 of file PdbAstBuilder.h.

Referenced by GetClangASTImporter().

◆ m_known_namespaces

NamespaceSet lldb_private::npdb::PdbAstBuilder::m_known_namespaces
private

Definition at line 163 of file PdbAstBuilder.h.

Referenced by FindNamespaceDecl(), and GetOrCreateNamespaceDecl().

◆ m_parent_to_namespaces

llvm::DenseMap<clang::DeclContext *, NamespaceSet> lldb_private::npdb::PdbAstBuilder::m_parent_to_namespaces
private

Definition at line 164 of file PdbAstBuilder.h.

Referenced by FindNamespaceDecl(), and GetOrCreateNamespaceDecl().

◆ m_parse_all_types

llvm::once_flag lldb_private::npdb::PdbAstBuilder::m_parse_all_types
private

Definition at line 146 of file PdbAstBuilder.h.

Referenced by ParseAllTypes().

◆ m_parse_functions_and_non_local_vars

llvm::once_flag lldb_private::npdb::PdbAstBuilder::m_parse_functions_and_non_local_vars
private

Definition at line 145 of file PdbAstBuilder.h.

Referenced by ParseAllFunctionsAndNonLocalVars().

◆ m_parsed_namespaces

NamespaceSet lldb_private::npdb::PdbAstBuilder::m_parsed_namespaces
private

Definition at line 160 of file PdbAstBuilder.h.

Referenced by ParseNamespace().

◆ m_uid_to_decl

llvm::DenseMap<lldb::user_id_t, clang::Decl *> lldb_private::npdb::PdbAstBuilder::m_uid_to_decl
private

◆ m_uid_to_type

llvm::DenseMap<lldb::user_id_t, clang::QualType> lldb_private::npdb::PdbAstBuilder::m_uid_to_type
private

Definition at line 149 of file PdbAstBuilder.h.

Referenced by GetOrCreateType().


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