LLDB mainline
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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)
 

Private Types

using TypeIndex = llvm::codeview::TypeIndex
 

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
 
llvm::DenseSet< clang::NamespaceDecl * > m_parsed_namespaces
 

Detailed Description

Definition at line 53 of file PdbAstBuilder.h.

Member Typedef Documentation

◆ TypeIndex

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

Definition at line 95 of file PdbAstBuilder.h.

Constructor & Destructor Documentation

◆ PdbAstBuilder()

PdbAstBuilder::PdbAstBuilder ( TypeSystemClang clang)

Definition at line 163 of file PdbAstBuilder.cpp.

Member Function Documentation

◆ clang()

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

◆ CompleteTagDecl()

bool PdbAstBuilder::CompleteTagDecl ( clang::TagDecl &  tag)

◆ 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()

clang::FunctionDecl * PdbAstBuilder::CreateFunctionDeclFromId ( PdbTypeSymId  func_tid,
PdbCompilandSymId  func_sid 
)
private

◆ CreateFunctionParameters()

void PdbAstBuilder::CreateFunctionParameters ( PdbCompilandSymId  func_id,
clang::FunctionDecl &  function_decl,
uint32_t  param_count 
)
private

◆ 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 589 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 lldb_private::TypeSystemClang::getASTContext(), GetOrCreateType(), and m_clang.

Referenced by CreateType().

◆ CreateRecordType()

clang::QualType PdbAstBuilder::CreateRecordType ( PdbTypeSymId  id,
const llvm::codeview::TagRecord &  record 
)
private

◆ CreateSimpleType()

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

◆ CreateType()

clang::QualType PdbAstBuilder::CreateType ( PdbTypeSymId  type)
private

◆ CreateVariableDecl()

clang::VarDecl * PdbAstBuilder::CreateVariableDecl ( PdbSymUid  uid,
llvm::codeview::CVSymbol  sym,
clang::DeclContext &  scope 
)
private

◆ Dump()

void PdbAstBuilder::Dump ( Stream stream)

◆ FromCompilerDecl()

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

Definition at line 1443 of file PdbAstBuilder.cpp.

References lldb_private::ClangUtil::GetDecl().

Referenced by GetOrCreateDeclContextForUid().

◆ FromCompilerDeclContext()

clang::DeclContext * PdbAstBuilder::FromCompilerDeclContext ( CompilerDeclContext  context)

◆ GetBasicType()

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

◆ GetClangASTImporter()

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

◆ GetOrCreateBlockDecl()

clang::BlockDecl * PdbAstBuilder::GetOrCreateBlockDecl ( PdbCompilandSymId  block_id)

◆ GetOrCreateDeclContextForUid()

clang::DeclContext * PdbAstBuilder::GetOrCreateDeclContextForUid ( PdbSymUid  uid)

◆ GetOrCreateDeclForUid()

std::optional< CompilerDecl > PdbAstBuilder::GetOrCreateDeclForUid ( PdbSymUid  uid)

◆ GetOrCreateFunctionDecl()

clang::FunctionDecl * PdbAstBuilder::GetOrCreateFunctionDecl ( PdbCompilandSymId  func_id)

◆ GetOrCreateInlinedFunctionDecl()

clang::FunctionDecl * PdbAstBuilder::GetOrCreateInlinedFunctionDecl ( PdbCompilandSymId  inlinesite_id)

◆ GetOrCreateNamespaceDecl()

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

◆ GetOrCreateSymbolForId()

clang::Decl * PdbAstBuilder::GetOrCreateSymbolForId ( PdbCompilandSymId  id)
private

◆ GetOrCreateType()

clang::QualType PdbAstBuilder::GetOrCreateType ( PdbTypeSymId  type)

◆ GetOrCreateTypedefDecl()

clang::TypedefNameDecl * PdbAstBuilder::GetOrCreateTypedefDecl ( PdbGlobalSymId  id)

◆ GetOrCreateVariableDecl() [1/2]

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

◆ GetOrCreateVariableDecl() [2/2]

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

◆ GetParentDeclContext()

clang::DeclContext * PdbAstBuilder::GetParentDeclContext ( PdbSymUid  uid)

◆ GetTranslationUnitDecl()

lldb_private::CompilerDeclContext PdbAstBuilder::GetTranslationUnitDecl ( )

◆ ParseAllFunctionsAndNonLocalVars()

void PdbAstBuilder::ParseAllFunctionsAndNonLocalVars ( )
private

◆ ParseAllTypes()

void PdbAstBuilder::ParseAllTypes ( )
private

◆ ParseBlockChildren()

void PdbAstBuilder::ParseBlockChildren ( PdbCompilandSymId  block_id)
private

◆ ParseDeclsForContext()

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

◆ ParseDeclsForSimpleContext()

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

◆ ParseNamespace()

void PdbAstBuilder::ParseNamespace ( clang::DeclContext &  parent)
private

◆ ToCompilerDecl()

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

Definition at line 1430 of file PdbAstBuilder.cpp.

References lldb_private::TypeSystemClang::GetCompilerDecl(), and m_clang.

Referenced by GetOrCreateDeclForUid().

◆ ToCompilerDeclContext()

CompilerDeclContext PdbAstBuilder::ToCompilerDeclContext ( clang::DeclContext &  context)

◆ ToCompilerType()

CompilerType PdbAstBuilder::ToCompilerType ( clang::QualType  qt)

◆ TryGetDecl()

clang::Decl * PdbAstBuilder::TryGetDecl ( PdbSymUid  uid) const
private

Member Data Documentation

◆ m_clang

TypeSystemClang& lldb_private::npdb::PdbAstBuilder::m_clang
private

◆ 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 152 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 141 of file PdbAstBuilder.h.

Referenced by GetClangASTImporter().

◆ m_parse_all_types

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

Definition at line 143 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 142 of file PdbAstBuilder.h.

Referenced by ParseAllFunctionsAndNonLocalVars().

◆ m_parsed_namespaces

llvm::DenseSet<clang::NamespaceDecl *> lldb_private::npdb::PdbAstBuilder::m_parsed_namespaces
private

Definition at line 153 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 146 of file PdbAstBuilder.h.

Referenced by GetOrCreateType().


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