20 #include "llvm/Support/ErrorHandling.h"
22 using namespace clang;
32 : Signature(M.Signature), ClangModule(&M) {
36 ASTFile = File->getName();
41 return ClangModule->Name;
67 const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment,
68 llvm::DenseMap<const FieldDecl *, uint64_t> &FieldOffsets,
69 llvm::DenseMap<const CXXRecordDecl *, CharUnits> &BaseOffsets,
70 llvm::DenseMap<const CXXRecordDecl *, CharUnits> &VirtualBaseOffsets) {
115 uint32_t OldGeneration = CurrentGeneration;
121 CurrentGeneration =
P->incrementGeneration(C);
125 if (!++CurrentGeneration)
126 llvm::report_fatal_error(
"generation counter overflowed",
false);
129 return OldGeneration;
virtual void FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Result)
Finds all declarations lexically contained within the given DeclContext, after applying an optional f...
Defines the clang::ASTContext interface.
Smart pointer class that efficiently represents Objective-C method names.
virtual Decl * GetExternalDecl(uint32_t ID)
Resolve a declaration ID into a declaration, potentially building a new declaration.
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs...
Defines the clang::Module class, which describes a module in the source code.
virtual uint32_t GetNumExternalSelectors()
Returns the number of selectors known to the external AST source.
virtual bool layoutRecordType(const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, llvm::DenseMap< const FieldDecl *, uint64_t > &FieldOffsets, llvm::DenseMap< const CXXRecordDecl *, CharUnits > &BaseOffsets, llvm::DenseMap< const CXXRecordDecl *, CharUnits > &VirtualBaseOffsets)
Perform layout on the given record.
virtual void PrintStats()
Print any statistics that have been gathered regarding the external AST source.
const FileEntry * getASTFile() const
The serialized AST file for this module, if one was created.
virtual void CompleteRedeclChain(const Decl *D)
Gives the external AST source an opportunity to complete the redeclaration chain for a declaration...
virtual Selector GetExternalSelector(uint32_t ID)
Resolve a selector ID into a selector.
virtual void StartedDeserializing()
Notify ExternalASTSource that we started deserialization of a decl or type so until FinishedDeseriali...
MemoryBufferSizes getMemoryBufferSizes() const
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memor...
RecordDecl - Represents a struct/union/class.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
uint32_t incrementGeneration(ASTContext &C)
Increment the current generation.
virtual CXXBaseSpecifier * GetExternalCXXBaseSpecifiers(uint64_t Offset)
Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers...
Describes a module or submodule.
virtual void FindFileRegionDecls(FileID File, unsigned Offset, unsigned Length, SmallVectorImpl< Decl * > &Decls)
Get the decls that are contained in a file in the Offset/Length range.
virtual bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name)
Find all declarations with the given name in the given context, and add them to the context by callin...
virtual void FinishedDeserializing()
Notify ExternalASTSource that we finished the deserialization of a decl or type.
Represents an ObjC class declaration.
virtual void completeVisibleDeclsMap(const DeclContext *DC)
Ensures that the table of all visible declarations inside this context is up to date.
The result type of a method or function.
const DirectoryEntry * Directory
The build directory of this module.
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
virtual Stmt * GetExternalDeclStmt(uint64_t Offset)
Resolve the offset of a statement in the decl stream into a statement.
TagDecl - Represents the declaration of a struct/union/class/enum.
const char * getName() const
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
virtual void StartTranslationUnit(ASTConsumer *Consumer)
Function that will be invoked when we begin parsing a new translation unit involving this external AS...
virtual void ReadComments()
Loads comment ranges.
std::string getModuleName() const
DeclarationName - The name of a declaration.
virtual CXXCtorInitializer ** GetExternalCXXCtorInitializers(uint64_t Offset)
Resolve the offset of a set of C++ constructor initializers in the decl stream into an array of initi...
virtual ~ExternalASTSource()
Represents a C++ base or member initializer.
virtual void CompleteType(TagDecl *Tag)
Gives the external AST source an opportunity to complete an incomplete type.
Represents a base class of a C++ class.
virtual llvm::Optional< ASTSourceDescriptor > getSourceDescriptor(unsigned ID)
Return a descriptor for the corresponding module, if one exists.