LLDB mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::ExternalASTSourceWrapper Class Reference

Wraps an ExternalASTSource into an ExternalSemaSource. More...

#include <ASTUtils.h>

Inheritance diagram for lldb_private::ExternalASTSourceWrapper:
Inheritance graph
[legend]

Public Member Functions

 ExternalASTSourceWrapper (ExternalASTSource *Source)
 
 ~ExternalASTSourceWrapper () override
 
clang::Decl * GetExternalDecl (clang::GlobalDeclID ID) override
 
clang::Selector GetExternalSelector (uint32_t ID) override
 
uint32_t GetNumExternalSelectors () override
 
clang::Stmt * GetExternalDeclStmt (uint64_t Offset) override
 
clang::CXXCtorInitializer ** GetExternalCXXCtorInitializers (uint64_t Offset) override
 
clang::CXXBaseSpecifier * GetExternalCXXBaseSpecifiers (uint64_t Offset) override
 
void updateOutOfDateIdentifier (const clang::IdentifierInfo &II) override
 
bool FindExternalVisibleDeclsByName (const clang::DeclContext *DC, clang::DeclarationName Name) override
 
bool LoadExternalSpecializations (const clang::Decl *D, bool OnlyPartial) override
 
bool LoadExternalSpecializations (const clang::Decl *D, llvm::ArrayRef< clang::TemplateArgument > TemplateArgs) override
 
void completeVisibleDeclsMap (const clang::DeclContext *DC) override
 
clang::Module * getModule (unsigned ID) override
 
std::optional< clang::ASTSourceDescriptor > getSourceDescriptor (unsigned ID) override
 
ExtKind hasExternalDefinitions (const clang::Decl *D) override
 
void FindExternalLexicalDecls (const clang::DeclContext *DC, llvm::function_ref< bool(clang::Decl::Kind)> IsKindWeWant, llvm::SmallVectorImpl< clang::Decl * > &Result) override
 
void FindFileRegionDecls (clang::FileID File, unsigned Offset, unsigned Length, llvm::SmallVectorImpl< clang::Decl * > &Decls) override
 
void CompleteRedeclChain (const clang::Decl *D) override
 
void CompleteType (clang::TagDecl *Tag) override
 
void CompleteType (clang::ObjCInterfaceDecl *Class) override
 
void ReadComments () override
 
void StartedDeserializing () override
 
void FinishedDeserializing () override
 
void StartTranslationUnit (clang::ASTConsumer *Consumer) override
 
void PrintStats () override
 
bool layoutRecordType (const clang::RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, llvm::DenseMap< const clang::FieldDecl *, uint64_t > &FieldOffsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &BaseOffsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &VirtualBaseOffsets) override
 
void ReadUndefinedButUsed (llvm::MapVector< clang::NamedDecl *, clang::SourceLocation > &Undefined) override
 This gets called when Sema is reconciling undefined but used decls.
 

Private Attributes

llvm::IntrusiveRefCntPtr< ExternalASTSource > m_Source
 

Detailed Description

Wraps an ExternalASTSource into an ExternalSemaSource.

Assumes shared ownership of the underlying source.

Definition at line 32 of file ASTUtils.h.

Constructor & Destructor Documentation

◆ ExternalASTSourceWrapper()

lldb_private::ExternalASTSourceWrapper::ExternalASTSourceWrapper ( ExternalASTSource *  Source)
inlineexplicit

Definition at line 36 of file ASTUtils.h.

References m_Source.

◆ ~ExternalASTSourceWrapper()

lldb_private::ExternalASTSourceWrapper::~ExternalASTSourceWrapper ( )
overridedefault

Member Function Documentation

◆ CompleteRedeclChain()

void lldb_private::ExternalASTSourceWrapper::CompleteRedeclChain ( const clang::Decl *  D)
inlineoverride

Definition at line 119 of file ASTUtils.h.

References m_Source.

◆ CompleteType() [1/2]

void lldb_private::ExternalASTSourceWrapper::CompleteType ( clang::ObjCInterfaceDecl *  Class)
inlineoverride

Definition at line 127 of file ASTUtils.h.

References m_Source.

◆ CompleteType() [2/2]

void lldb_private::ExternalASTSourceWrapper::CompleteType ( clang::TagDecl *  Tag)
inlineoverride

Definition at line 123 of file ASTUtils.h.

References m_Source.

◆ completeVisibleDeclsMap()

void lldb_private::ExternalASTSourceWrapper::completeVisibleDeclsMap ( const clang::DeclContext *  DC)
inlineoverride

Definition at line 89 of file ASTUtils.h.

References m_Source.

◆ FindExternalLexicalDecls()

void lldb_private::ExternalASTSourceWrapper::FindExternalLexicalDecls ( const clang::DeclContext *  DC,
llvm::function_ref< bool(clang::Decl::Kind)>  IsKindWeWant,
llvm::SmallVectorImpl< clang::Decl * > &  Result 
)
inlineoverride

Definition at line 106 of file ASTUtils.h.

References m_Source.

◆ FindExternalVisibleDeclsByName()

bool lldb_private::ExternalASTSourceWrapper::FindExternalVisibleDeclsByName ( const clang::DeclContext *  DC,
clang::DeclarationName  Name 
)
inlineoverride

Definition at line 73 of file ASTUtils.h.

References m_Source.

◆ FindFileRegionDecls()

void lldb_private::ExternalASTSourceWrapper::FindFileRegionDecls ( clang::FileID  File,
unsigned  Offset,
unsigned  Length,
llvm::SmallVectorImpl< clang::Decl * > &  Decls 
)
inlineoverride

Definition at line 114 of file ASTUtils.h.

References m_Source.

◆ FinishedDeserializing()

void lldb_private::ExternalASTSourceWrapper::FinishedDeserializing ( )
inlineoverride

Definition at line 135 of file ASTUtils.h.

References m_Source.

◆ GetExternalCXXBaseSpecifiers()

clang::CXXBaseSpecifier * lldb_private::ExternalASTSourceWrapper::GetExternalCXXBaseSpecifiers ( uint64_t  Offset)
inlineoverride

Definition at line 65 of file ASTUtils.h.

References m_Source.

◆ GetExternalCXXCtorInitializers()

clang::CXXCtorInitializer ** lldb_private::ExternalASTSourceWrapper::GetExternalCXXCtorInitializers ( uint64_t  Offset)
inlineoverride

Definition at line 60 of file ASTUtils.h.

References m_Source.

◆ GetExternalDecl()

clang::Decl * lldb_private::ExternalASTSourceWrapper::GetExternalDecl ( clang::GlobalDeclID  ID)
inlineoverride

Definition at line 43 of file ASTUtils.h.

References ID, and m_Source.

◆ GetExternalDeclStmt()

clang::Stmt * lldb_private::ExternalASTSourceWrapper::GetExternalDeclStmt ( uint64_t  Offset)
inlineoverride

Definition at line 55 of file ASTUtils.h.

References m_Source.

◆ GetExternalSelector()

clang::Selector lldb_private::ExternalASTSourceWrapper::GetExternalSelector ( uint32_t  ID)
inlineoverride

Definition at line 47 of file ASTUtils.h.

References ID, and m_Source.

◆ getModule()

clang::Module * lldb_private::ExternalASTSourceWrapper::getModule ( unsigned  ID)
inlineoverride

Definition at line 93 of file ASTUtils.h.

References ID, and m_Source.

◆ GetNumExternalSelectors()

uint32_t lldb_private::ExternalASTSourceWrapper::GetNumExternalSelectors ( )
inlineoverride

Definition at line 51 of file ASTUtils.h.

References m_Source.

◆ getSourceDescriptor()

std::optional< clang::ASTSourceDescriptor > lldb_private::ExternalASTSourceWrapper::getSourceDescriptor ( unsigned  ID)
inlineoverride

Definition at line 98 of file ASTUtils.h.

References ID, and m_Source.

◆ hasExternalDefinitions()

ExtKind lldb_private::ExternalASTSourceWrapper::hasExternalDefinitions ( const clang::Decl *  D)
inlineoverride

Definition at line 102 of file ASTUtils.h.

References m_Source.

◆ layoutRecordType()

bool lldb_private::ExternalASTSourceWrapper::layoutRecordType ( const clang::RecordDecl *  Record,
uint64_t &  Size,
uint64_t &  Alignment,
llvm::DenseMap< const clang::FieldDecl *, uint64_t > &  FieldOffsets,
llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &  BaseOffsets,
llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &  VirtualBaseOffsets 
)
inlineoverride

Definition at line 143 of file ASTUtils.h.

References m_Source.

◆ LoadExternalSpecializations() [1/2]

bool lldb_private::ExternalASTSourceWrapper::LoadExternalSpecializations ( const clang::Decl *  D,
bool  OnlyPartial 
)
inlineoverride

Definition at line 78 of file ASTUtils.h.

References m_Source.

◆ LoadExternalSpecializations() [2/2]

bool lldb_private::ExternalASTSourceWrapper::LoadExternalSpecializations ( const clang::Decl *  D,
llvm::ArrayRef< clang::TemplateArgument >  TemplateArgs 
)
inlineoverride

Definition at line 83 of file ASTUtils.h.

References m_Source.

◆ PrintStats()

void lldb_private::ExternalASTSourceWrapper::PrintStats ( )
override

Definition at line 13 of file ASTUtils.cpp.

References m_Source.

◆ ReadComments()

void lldb_private::ExternalASTSourceWrapper::ReadComments ( )
inlineoverride

Definition at line 131 of file ASTUtils.h.

References m_Source.

◆ ReadUndefinedButUsed()

void lldb_private::ExternalASTSourceWrapper::ReadUndefinedButUsed ( llvm::MapVector< clang::NamedDecl *, clang::SourceLocation > &  Undefined)
inlineoverride

This gets called when Sema is reconciling undefined but used decls.

For LLDB's use-case, we never provide Clang with function definitions, instead we rely on linkage names and symbol resolution to call the correct funcitons during JITting. So this implementation clears any "undefined" FunctionDecls that Clang found while parsing.

Parameters
[in,out]UndefinedA set of used decls for which Clang has not been provided a definition with.

Definition at line 163 of file ASTUtils.h.

◆ StartedDeserializing()

void lldb_private::ExternalASTSourceWrapper::StartedDeserializing ( )
inlineoverride

Definition at line 133 of file ASTUtils.h.

References m_Source.

◆ StartTranslationUnit()

void lldb_private::ExternalASTSourceWrapper::StartTranslationUnit ( clang::ASTConsumer *  Consumer)
inlineoverride

Definition at line 137 of file ASTUtils.h.

References m_Source.

◆ updateOutOfDateIdentifier()

void lldb_private::ExternalASTSourceWrapper::updateOutOfDateIdentifier ( const clang::IdentifierInfo &  II)
inlineoverride

Definition at line 69 of file ASTUtils.h.

References m_Source.

Member Data Documentation

◆ m_Source

llvm::IntrusiveRefCntPtr<ExternalASTSource> lldb_private::ExternalASTSourceWrapper::m_Source
private

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