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>

Collaboration diagram for lldb_private::npdb::PdbAstBuilder:
Collaboration graph
[legend]

Public Member Functions

 PdbAstBuilder (ObjectFile &obj, PdbIndex &index, TypeSystemClang &clang)
 
lldb_private::CompilerDeclContext GetTranslationUnitDecl ()
 
llvm::Optional< lldb_private::CompilerDeclGetOrCreateDeclForUid (PdbSymUid uid)
 
clang::DeclContext * GetOrCreateDeclContextForUid (PdbSymUid uid)
 
clang::DeclContext * GetParentDeclContext (PdbSymUid uid)
 
clang::FunctionDecl * GetOrCreateFunctionDecl (PdbCompilandSymId func_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 ()
 
ClangASTImporterimporter ()
 
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::DeclContext * GetParentDeclContextForSymbol (const llvm::codeview::CVSymbol &sym)
 
clang::NamespaceDecl * GetOrCreateNamespaceDecl (const char *name, clang::DeclContext &context)
 
void ParseAllNamespacesPlusChildrenOf (llvm::Optional< llvm::StringRef > parent)
 
void ParseDeclsForSimpleContext (clang::DeclContext &context)
 
void ParseBlockChildren (PdbCompilandSymId block_id)
 
void BuildParentMap ()
 
std::pair< clang::DeclContext *, std::stringCreateDeclInfoForType (const llvm::codeview::TagRecord &record, TypeIndex ti)
 
std::pair< clang::DeclContext *, std::stringCreateDeclInfoForUndecoratedName (llvm::StringRef uname)
 
clang::QualType CreateSimpleType (TypeIndex ti)
 

Private Attributes

PdbIndexm_index
 
TypeSystemClangm_clang
 
ClangASTImporter m_importer
 
llvm::DenseMap< TypeIndex, TypeIndexm_parent_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
 

Detailed Description

Definition at line 51 of file PdbAstBuilder.h.

Member Typedef Documentation

◆ TypeIndex

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

Definition at line 91 of file PdbAstBuilder.h.

Constructor & Destructor Documentation

◆ PdbAstBuilder()

PdbAstBuilder::PdbAstBuilder ( ObjectFile obj,
PdbIndex index,
TypeSystemClang clang 
)

Definition at line 205 of file PdbAstBuilder.cpp.

References BuildParentMap().

Member Function Documentation

◆ BuildParentMap()

void PdbAstBuilder::BuildParentMap ( )
private

◆ 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

◆ 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 753 of file PdbAstBuilder.cpp.

References GetOrCreateType().

Referenced by CreateType().

◆ CreatePointerType()

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

Definition at line 716 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 1352 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)

◆ GetOrCreateBlockDecl()

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

◆ GetOrCreateDeclContextForUid()

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

◆ GetOrCreateDeclForUid()

llvm::Optional< CompilerDecl > PdbAstBuilder::GetOrCreateDeclForUid ( PdbSymUid  uid)

◆ GetOrCreateFunctionDecl()

clang::FunctionDecl * PdbAstBuilder::GetOrCreateFunctionDecl ( PdbCompilandSymId  func_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)

◆ GetParentDeclContextForSymbol()

clang::DeclContext * PdbAstBuilder::GetParentDeclContextForSymbol ( const llvm::codeview::CVSymbol &  sym)
private

◆ GetTranslationUnitDecl()

lldb_private::CompilerDeclContext PdbAstBuilder::GetTranslationUnitDecl ( )

◆ importer()

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

Definition at line 84 of file PdbAstBuilder.h.

References m_importer.

Referenced by lldb_private::npdb::UdtRecordCompleter::complete().

◆ ParseAllNamespacesPlusChildrenOf()

void PdbAstBuilder::ParseAllNamespacesPlusChildrenOf ( llvm::Optional< llvm::StringRef >  parent)
private

◆ ParseBlockChildren()

void PdbAstBuilder::ParseBlockChildren ( PdbCompilandSymId  block_id)
private

◆ ParseDeclsForContext()

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

◆ ParseDeclsForSimpleContext()

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

◆ ToCompilerDecl()

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

Definition at line 1339 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_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 134 of file PdbAstBuilder.h.

Referenced by importer().

◆ m_index

PdbIndex& lldb_private::npdb::PdbAstBuilder::m_index
private

◆ m_parent_types

llvm::DenseMap<TypeIndex, TypeIndex> lldb_private::npdb::PdbAstBuilder::m_parent_types
private

Definition at line 136 of file PdbAstBuilder.h.

Referenced by BuildParentMap(), CreateDeclInfoForType(), and GetParentDeclContext().

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

Referenced by GetOrCreateType().


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