LLDB  mainline
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
lldb_private::ClangASTImporter Class Reference

#include <ClangASTImporter.h>

Collaboration diagram for lldb_private::ClangASTImporter:
Collaboration graph


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, CompilerDeclContextNamespaceMapItem
typedef std::vector< NamespaceMapItemNamespaceMap
typedef std::shared_ptr< NamespaceMapNamespaceMapSP
typedef std::shared_ptr< ASTImporterDelegateImporterDelegateSP
typedef llvm::DenseMap< clang::ASTContext *, ImporterDelegateSPDelegateMap
typedef llvm::DenseMap< const clang::NamespaceDecl *, NamespaceMapSPNamespaceMetaMap
typedef std::shared_ptr< ASTContextMetadataASTContextMetadataSP
typedef llvm::DenseMap< const clang::ASTContext *, ASTContextMetadataSPContextMetadataMap
typedef llvm::DenseMap< const clang::RecordDecl *, LayoutInfoRecordDeclToLayoutMap

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

Detailed Description

Definition at line 37 of file ClangASTImporter.h.

Member Typedef Documentation

◆ ASTContextMetadataSP

Definition at line 317 of file ClangASTImporter.h.

◆ ContextMetadataMap

typedef llvm::DenseMap<const clang::ASTContext *, ASTContextMetadataSP> lldb_private::ClangASTImporter::ContextMetadataMap

Definition at line 319 of file ClangASTImporter.h.

◆ DelegateMap

typedef llvm::DenseMap<clang::ASTContext *, ImporterDelegateSP> lldb_private::ClangASTImporter::DelegateMap

Definition at line 256 of file ClangASTImporter.h.

◆ ImporterDelegateSP

Definition at line 255 of file ClangASTImporter.h.

◆ NamespaceMap

Definition at line 106 of file ClangASTImporter.h.

◆ NamespaceMapItem

Definition at line 105 of file ClangASTImporter.h.

◆ NamespaceMapSP

Definition at line 107 of file ClangASTImporter.h.

◆ NamespaceMetaMap

typedef llvm::DenseMap<const clang::NamespaceDecl *, NamespaceMapSP> lldb_private::ClangASTImporter::NamespaceMetaMap

Definition at line 258 of file ClangASTImporter.h.

◆ RecordDeclToLayoutMap

typedef llvm::DenseMap<const clang::RecordDecl *, LayoutInfo> lldb_private::ClangASTImporter::RecordDeclToLayoutMap

Definition at line 363 of file ClangASTImporter.h.

Constructor & Destructor Documentation

◆ ClangASTImporter()

lldb_private::ClangASTImporter::ClangASTImporter ( )

Definition at line 51 of file ClangASTImporter.h.

Member Function Documentation

◆ BuildNamespaceMap()

void ClangASTImporter::BuildNamespaceMap ( const clang::NamespaceDecl *  decl)

Definition at line 760 of file ClangASTImporter.cpp.

◆ CanImport()

bool ClangASTImporter::CanImport ( const CompilerType type)

◆ CompleteAndFetchChildren()

bool ClangASTImporter::CompleteAndFetchChildren ( clang::QualType  type)

◆ CompleteObjCInterfaceDecl()

bool ClangASTImporter::CompleteObjCInterfaceDecl ( clang::ObjCInterfaceDecl *  interface_decl)

◆ CompleteTagDecl()

bool ClangASTImporter::CompleteTagDecl ( clang::TagDecl *  decl)

◆ CompleteTagDeclWithOrigin()

bool ClangASTImporter::CompleteTagDeclWithOrigin ( clang::TagDecl *  decl,
clang::TagDecl *  origin 

◆ CompleteType()

bool ClangASTImporter::CompleteType ( const CompilerType compiler_type)

◆ CopyDecl()

clang::Decl * ClangASTImporter::CopyDecl ( clang::ASTContext *  dst_ctx,
clang::Decl *  decl 

◆ CopyType()

CompilerType ClangASTImporter::CopyType ( TypeSystemClang dst,
const CompilerType src_type 

◆ DeportDecl()

clang::Decl * ClangASTImporter::DeportDecl ( clang::ASTContext *  dst_ctx,
clang::Decl *  decl 

◆ DeportType()

CompilerType ClangASTImporter::DeportType ( TypeSystemClang dst,
const CompilerType src_type 

◆ ForgetDestination()

void ClangASTImporter::ForgetDestination ( clang::ASTContext *  dst_ctx)

◆ ForgetSource()

void ClangASTImporter::ForgetSource ( clang::ASTContext *  dst_ctx,
clang::ASTContext *  src_ctx 

◆ GetContextMetadata()

ASTContextMetadataSP lldb_private::ClangASTImporter::GetContextMetadata ( clang::ASTContext *  dst_ctx)

Definition at line 323 of file ClangASTImporter.h.

References m_metadata_map.

Referenced by GetDelegate().

◆ GetDeclMetadata()

ClangASTMetadata * ClangASTImporter::GetDeclMetadata ( const clang::Decl *  decl)

◆ GetDeclOrigin()

ClangASTImporter::DeclOrigin ClangASTImporter::GetDeclOrigin ( const clang::Decl *  decl)

Definition at line 727 of file ClangASTImporter.cpp.

◆ GetDelegate()

ImporterDelegateSP lldb_private::ClangASTImporter::GetDelegate ( clang::ASTContext *  dst_ctx,
clang::ASTContext *  src_ctx 

Definition at line 343 of file ClangASTImporter.h.

References GetContextMetadata().

◆ GetNamespaceMap()

ClangASTImporter::NamespaceMapSP ClangASTImporter::GetNamespaceMap ( const clang::NamespaceDecl *  decl)

Definition at line 748 of file ClangASTImporter.cpp.

◆ Import()

bool ClangASTImporter::Import ( const CompilerType type)

◆ InstallMapCompleter()

void lldb_private::ClangASTImporter::InstallMapCompleter ( clang::ASTContext *  dst_ctx,
MapCompleter completer 

Definition at line 129 of file ClangASTImporter.h.

References m_metadata_map.

◆ LayoutRecordType()

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 

◆ MaybeGetContextMetadata()

ASTContextMetadataSP lldb_private::ClangASTImporter::MaybeGetContextMetadata ( clang::ASTContext *  dst_ctx)

Definition at line 335 of file ClangASTImporter.h.

References m_metadata_map.

◆ RegisterNamespaceMap()

void ClangASTImporter::RegisterNamespaceMap ( const clang::NamespaceDecl *  decl,
NamespaceMapSP namespace_map 

Definition at line 740 of file ClangASTImporter.cpp.

◆ RequireCompleteType()

bool ClangASTImporter::RequireCompleteType ( clang::QualType  type)

◆ SetDeclOrigin()

void ClangASTImporter::SetDeclOrigin ( const clang::Decl *  decl,
clang::Decl *  original_decl 

Definition at line 733 of file ClangASTImporter.cpp.

◆ SetRecordLayout()

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.

declThe RecordDecl to set the layout for.
layoutThe 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().

Member Data Documentation

◆ m_file_manager

clang::FileManager lldb_private::ClangASTImporter::m_file_manager

Definition at line 361 of file ClangASTImporter.h.

◆ m_metadata_map

ContextMetadataMap lldb_private::ClangASTImporter::m_metadata_map

◆ m_record_decl_to_layout_map

RecordDeclToLayoutMap lldb_private::ClangASTImporter::m_record_decl_to_layout_map

Definition at line 365 of file ClangASTImporter.h.

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