LLDB
mainline
|
#include <ClangASTImporter.h>
Classes | |
class | ASTContextMetadata |
struct | ASTImporterDelegate |
ASTImporter that intercepts and records the import process of the underlying ASTImporter. More... | |
struct | DeclOrigin |
struct | LayoutInfo |
class | MapCompleter |
struct | NewDeclListener |
Listener interface used by the ASTImporterDelegate to inform other code about decls that have been imported the first time. More... | |
Public Types | |
typedef std::pair< lldb::ModuleSP, CompilerDeclContext > | NamespaceMapItem |
typedef std::vector< NamespaceMapItem > | NamespaceMap |
typedef std::shared_ptr< NamespaceMap > | NamespaceMapSP |
typedef std::shared_ptr< ASTImporterDelegate > | ImporterDelegateSP |
typedef llvm::DenseMap< clang::ASTContext *, ImporterDelegateSP > | DelegateMap |
typedef llvm::DenseMap< const clang::NamespaceDecl *, NamespaceMapSP > | NamespaceMetaMap |
typedef std::shared_ptr< ASTContextMetadata > | ASTContextMetadataSP |
typedef llvm::DenseMap< const clang::ASTContext *, ASTContextMetadataSP > | ContextMetadataMap |
typedef llvm::DenseMap< const clang::RecordDecl *, LayoutInfo > | RecordDeclToLayoutMap |
Public Member Functions | |
ClangASTImporter () | |
CompilerType | CopyType (TypeSystemClang &dst, const CompilerType &src_type) |
clang::Decl * | CopyDecl (clang::ASTContext *dst_ctx, clang::Decl *decl) |
CompilerType | DeportType (TypeSystemClang &dst, const CompilerType &src_type) |
clang::Decl * | DeportDecl (clang::ASTContext *dst_ctx, clang::Decl *decl) |
void | SetRecordLayout (clang::RecordDecl *decl, const LayoutInfo &layout) |
Sets the layout for the given RecordDecl. More... | |
bool | LayoutRecordType (const clang::RecordDecl *record_decl, uint64_t &bit_size, uint64_t &alignment, llvm::DenseMap< const clang::FieldDecl *, uint64_t > &field_offsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &base_offsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &vbase_offsets) |
bool | CanImport (const CompilerType &type) |
bool | Import (const CompilerType &type) |
bool | CompleteType (const CompilerType &compiler_type) |
bool | CompleteTagDecl (clang::TagDecl *decl) |
bool | CompleteTagDeclWithOrigin (clang::TagDecl *decl, clang::TagDecl *origin) |
bool | CompleteObjCInterfaceDecl (clang::ObjCInterfaceDecl *interface_decl) |
bool | CompleteAndFetchChildren (clang::QualType type) |
bool | RequireCompleteType (clang::QualType type) |
void | SetDeclOrigin (const clang::Decl *decl, clang::Decl *original_decl) |
ClangASTMetadata * | GetDeclMetadata (const clang::Decl *decl) |
void | RegisterNamespaceMap (const clang::NamespaceDecl *decl, NamespaceMapSP &namespace_map) |
NamespaceMapSP | GetNamespaceMap (const clang::NamespaceDecl *decl) |
void | BuildNamespaceMap (const clang::NamespaceDecl *decl) |
void | InstallMapCompleter (clang::ASTContext *dst_ctx, MapCompleter &completer) |
void | ForgetDestination (clang::ASTContext *dst_ctx) |
void | ForgetSource (clang::ASTContext *dst_ctx, clang::ASTContext *src_ctx) |
ASTContextMetadataSP | GetContextMetadata (clang::ASTContext *dst_ctx) |
ASTContextMetadataSP | MaybeGetContextMetadata (clang::ASTContext *dst_ctx) |
ImporterDelegateSP | GetDelegate (clang::ASTContext *dst_ctx, clang::ASTContext *src_ctx) |
DeclOrigin | GetDeclOrigin (const clang::Decl *decl) |
Public Attributes | |
ContextMetadataMap | m_metadata_map |
clang::FileManager | m_file_manager |
RecordDeclToLayoutMap | m_record_decl_to_layout_map |
Definition at line 37 of file ClangASTImporter.h.
typedef std::shared_ptr<ASTContextMetadata> lldb_private::ClangASTImporter::ASTContextMetadataSP |
Definition at line 317 of file ClangASTImporter.h.
typedef llvm::DenseMap<const clang::ASTContext *, ASTContextMetadataSP> lldb_private::ClangASTImporter::ContextMetadataMap |
Definition at line 319 of file ClangASTImporter.h.
typedef llvm::DenseMap<clang::ASTContext *, ImporterDelegateSP> lldb_private::ClangASTImporter::DelegateMap |
Definition at line 256 of file ClangASTImporter.h.
typedef std::shared_ptr<ASTImporterDelegate> lldb_private::ClangASTImporter::ImporterDelegateSP |
Definition at line 255 of file ClangASTImporter.h.
typedef std::vector<NamespaceMapItem> lldb_private::ClangASTImporter::NamespaceMap |
Definition at line 106 of file ClangASTImporter.h.
typedef std::pair<lldb::ModuleSP, CompilerDeclContext> lldb_private::ClangASTImporter::NamespaceMapItem |
Definition at line 105 of file ClangASTImporter.h.
typedef std::shared_ptr<NamespaceMap> lldb_private::ClangASTImporter::NamespaceMapSP |
Definition at line 107 of file ClangASTImporter.h.
typedef llvm::DenseMap<const clang::NamespaceDecl *, NamespaceMapSP> lldb_private::ClangASTImporter::NamespaceMetaMap |
Definition at line 258 of file ClangASTImporter.h.
typedef llvm::DenseMap<const clang::RecordDecl *, LayoutInfo> lldb_private::ClangASTImporter::RecordDeclToLayoutMap |
Definition at line 363 of file ClangASTImporter.h.
|
inline |
Definition at line 51 of file ClangASTImporter.h.
void ClangASTImporter::BuildNamespaceMap | ( | const clang::NamespaceDecl * | decl | ) |
Definition at line 760 of file ClangASTImporter.cpp.
bool ClangASTImporter::CanImport | ( | const CompilerType & | type | ) |
Definition at line 358 of file ClangASTImporter.cpp.
References lldb_private::ClangUtil::GetCanonicalQualType(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::ClangUtil::IsClangType(), and lldb_private::ClangUtil::RemoveFastQualifiers().
Referenced by SymbolFileDWARF::CompleteType(), SymbolFileDWARF::HasForwardDeclForClangType(), and PrepareContextToReceiveMembers().
bool ClangASTImporter::CompleteAndFetchChildren | ( | clang::QualType | type | ) |
Definition at line 619 of file ClangASTImporter.cpp.
References lldb_private::ClangASTImporter::DeclOrigin::ctx, lldb_private::ClangASTImporter::DeclOrigin::decl, lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_EXPRESSIONS, LLDB_LOG_ERROR, RequireCompleteType(), and lldb_private::ClangASTImporter::DeclOrigin::Valid().
bool ClangASTImporter::CompleteObjCInterfaceDecl | ( | clang::ObjCInterfaceDecl * | interface_decl | ) |
bool ClangASTImporter::CompleteTagDecl | ( | clang::TagDecl * | decl | ) |
Definition at line 558 of file ClangASTImporter.cpp.
References lldb_private::ClangASTImporter::DeclOrigin::ctx, lldb_private::ClangASTImporter::DeclOrigin::decl, lldb_private::TypeSystemClang::GetCompleteDecl(), and lldb_private::ClangASTImporter::DeclOrigin::Valid().
Referenced by MaybeCompleteReturnType().
bool ClangASTImporter::CompleteTagDeclWithOrigin | ( | clang::TagDecl * | decl, |
clang::TagDecl * | origin | ||
) |
Definition at line 578 of file ClangASTImporter.cpp.
References lldb_private::TypeSystemClang::GetCompleteDecl().
bool ClangASTImporter::CompleteType | ( | const CompilerType & | compiler_type | ) |
Definition at line 510 of file ClangASTImporter.cpp.
References lldb_private::TypeSystemClang::CompleteTagDeclarationDefinition(), lldb_private::CompilerType::GetOpaqueQualType(), and lldb_private::TypeSystemClang::SetHasExternalStorage().
Referenced by SymbolFileDWARF::CompleteType(), and PDBASTParser::CompleteTypeFromPDB().
clang::Decl * ClangASTImporter::CopyDecl | ( | clang::ASTContext * | dst_ctx, |
clang::Decl * | decl | ||
) |
Definition at line 66 of file ClangASTImporter.cpp.
References lldb_private::GetLogIfAllCategoriesSet(), lldb_private::ClangASTMetadata::GetUserID(), LIBLLDB_LOG_EXPRESSIONS, LLDB_INVALID_UID, LLDB_LOG, and LLDB_LOG_ERROR.
CompilerType ClangASTImporter::CopyType | ( | TypeSystemClang & | dst, |
const CompilerType & | src_type | ||
) |
Definition at line 31 of file ClangASTImporter.cpp.
References lldb_private::TypeSystemClang::getASTContext(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::ClangUtil::GetQualType(), lldb_private::CompilerType::GetTypeSystem(), LIBLLDB_LOG_EXPRESSIONS, and LLDB_LOG_ERROR.
Referenced by DWARFASTParserClang::ParseTypeFromClangModule().
clang::Decl * ClangASTImporter::DeportDecl | ( | clang::ASTContext * | dst_ctx, |
clang::Decl * | decl | ||
) |
Definition at line 327 of file ClangASTImporter.cpp.
References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_EXPRESSIONS, LLDB_LOG, and DeclContextOverride::OverrideAllDeclsFromContainingFunction().
CompilerType ClangASTImporter::DeportType | ( | TypeSystemClang & | dst, |
const CompilerType & | src_type | ||
) |
Definition at line 304 of file ClangASTImporter.cpp.
References lldb_private::TypeSystemClang::getASTContext(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::CompilerType::GetOpaqueQualType(), lldb_private::ClangUtil::GetQualType(), lldb_private::CompilerType::GetTypeName(), lldb_private::CompilerType::GetTypeSystem(), LIBLLDB_LOG_EXPRESSIONS, LLDB_LOG, and DeclContextOverride::OverrideAllDeclsFromContainingFunction().
void ClangASTImporter::ForgetDestination | ( | clang::ASTContext * | dst_ctx | ) |
Definition at line 786 of file ClangASTImporter.cpp.
References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_EXPRESSIONS, and LLDB_LOG.
void ClangASTImporter::ForgetSource | ( | clang::ASTContext * | dst_ctx, |
clang::ASTContext * | src_ctx | ||
) |
Definition at line 796 of file ClangASTImporter.cpp.
References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_EXPRESSIONS, and LLDB_LOG.
Referenced by lldb_private::ScratchTypeSystemClang::ForgetSource().
|
inline |
Definition at line 323 of file ClangASTImporter.h.
References m_metadata_map.
Referenced by GetDelegate().
ClangASTMetadata * ClangASTImporter::GetDeclMetadata | ( | const clang::Decl * | decl | ) |
Definition at line 715 of file ClangASTImporter.cpp.
References lldb_private::ClangASTImporter::DeclOrigin::ctx, lldb_private::ClangASTImporter::DeclOrigin::decl, lldb_private::TypeSystemClang::GetASTContext(), lldb_private::TypeSystemClang::GetMetadata(), and lldb_private::ClangASTImporter::DeclOrigin::Valid().
ClangASTImporter::DeclOrigin ClangASTImporter::GetDeclOrigin | ( | const clang::Decl * | decl | ) |
Definition at line 727 of file ClangASTImporter.cpp.
|
inline |
Definition at line 343 of file ClangASTImporter.h.
References GetContextMetadata().
ClangASTImporter::NamespaceMapSP ClangASTImporter::GetNamespaceMap | ( | const clang::NamespaceDecl * | decl | ) |
Definition at line 748 of file ClangASTImporter.cpp.
bool ClangASTImporter::Import | ( | const CompilerType & | type | ) |
Definition at line 435 of file ClangASTImporter.cpp.
References lldb_private::ClangUtil::GetCanonicalQualType(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::ClangUtil::IsClangType(), and lldb_private::ClangUtil::RemoveFastQualifiers().
|
inline |
Definition at line 129 of file ClangASTImporter.h.
References m_metadata_map.
bool ClangASTImporter::LayoutRecordType | ( | const clang::RecordDecl * | record_decl, |
uint64_t & | bit_size, | ||
uint64_t & | alignment, | ||
llvm::DenseMap< const clang::FieldDecl *, uint64_t > & | field_offsets, | ||
llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > & | base_offsets, | ||
llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > & | vbase_offsets | ||
) |
Definition at line 524 of file ClangASTImporter.cpp.
Referenced by lldb_private::TypeSystemClang::LayoutRecordType().
|
inline |
Definition at line 335 of file ClangASTImporter.h.
References m_metadata_map.
void ClangASTImporter::RegisterNamespaceMap | ( | const clang::NamespaceDecl * | decl, |
NamespaceMapSP & | namespace_map | ||
) |
Definition at line 740 of file ClangASTImporter.cpp.
bool ClangASTImporter::RequireCompleteType | ( | clang::QualType | type | ) |
Definition at line 689 of file ClangASTImporter.cpp.
References RequireCompleteType().
Referenced by DWARFASTParserClang::ParseTypeFromClangModule(), and PrepareContextToReceiveMembers().
void ClangASTImporter::SetDeclOrigin | ( | const clang::Decl * | decl, |
clang::Decl * | original_decl | ||
) |
Definition at line 733 of file ClangASTImporter.cpp.
void ClangASTImporter::SetRecordLayout | ( | clang::RecordDecl * | decl, |
const LayoutInfo & | layout | ||
) |
Sets the layout for the given RecordDecl.
The layout will later be used by Clang's during code generation. Not calling this function for a RecordDecl will cause that Clang's codegen tries to layout the record by itself.
decl | The RecordDecl to set the layout for. |
layout | The layout for the record. |
Definition at line 553 of file ClangASTImporter.cpp.
Referenced by lldb_private::npdb::UdtRecordCompleter::complete(), DWARFASTParserClang::CompleteRecordType(), PDBASTParser::CompleteTypeFromUDT(), and DWARFASTParserClang::ParseStructureLikeDIE().
clang::FileManager lldb_private::ClangASTImporter::m_file_manager |
Definition at line 361 of file ClangASTImporter.h.
ContextMetadataMap lldb_private::ClangASTImporter::m_metadata_map |
Definition at line 321 of file ClangASTImporter.h.
Referenced by GetContextMetadata(), InstallMapCompleter(), and MaybeGetContextMetadata().
RecordDeclToLayoutMap lldb_private::ClangASTImporter::m_record_decl_to_layout_map |
Definition at line 365 of file ClangASTImporter.h.