clang 20.0.0git
|
Reads an AST files chain containing the contents of a translation unit. More...
#include "clang/Serialization/ASTReader.h"
Classes | |
class | ListenerScope |
RAII object to temporarily add an AST callback listener. More... | |
class | ModuleDeclIterator |
Public Types | |
enum | ASTReadResult { Success , Failure , Missing , OutOfDate , VersionMismatch , ConfigurationMismatch , HadErrors } |
The result of reading the control block of an AST file, which can fail for various reasons. More... | |
using | RecordData = SmallVector< uint64_t, 64 > |
using | RecordDataImpl = SmallVectorImpl< uint64_t > |
using | ModuleFile = serialization::ModuleFile |
using | ModuleKind = serialization::ModuleKind |
using | ModuleManager = serialization::ModuleManager |
using | ModuleIterator = ModuleManager::ModuleIterator |
using | ModuleConstIterator = ModuleManager::ModuleConstIterator |
using | ModuleReverseIterator = ModuleManager::ModuleReverseIterator |
Public Types inherited from clang::ExternalASTSource | |
enum | ExtKind { EK_Always , EK_Never , EK_ReplyHazy } |
Friends | |
class | ASTDeclMerger |
Types of AST files. | |
class | ASTDeclReader |
class | ASTIdentifierIterator |
class | ASTRecordReader |
class | ASTUnit |
class | ASTWriter |
class | PCHValidator |
class | serialization::reader::ASTIdentifierLookupTrait |
class | serialization::ReadMethodPoolVisitor |
class | TypeLocReader |
class | LocalDeclID |
Sema-relevant special data | |
Fields containing data that is used for semantic analysis | |
enum | LoadFailureCapabilities { ARR_None = 0 , ARR_Missing = 0x1 , ARR_OutOfDate = 0x2 , ARR_VersionMismatch = 0x4 , ARR_ConfigurationMismatch = 0x8 , ARR_TreatModuleWithErrorsAsOutOfDate = 0x10 } |
Flags that indicate what kind of AST loading failures the client of the AST reader can directly handle. More... | |
using | RawLocEncoding = SourceLocationEncoding::RawLocEncoding |
SmallVector< GlobalDeclID, 16 > | PreloadedDeclIDs |
SmallVector< std::pair< llvm::BitstreamCursor, serialization::ModuleFile * >, 8 > | CommentsCursors |
Cursors for comments blocks. | |
void | ResolveImportedPath (ModuleFile &M, std::string &Filename) |
If we are loading a relocatable PCH or module file, and the filename is not an absolute path, add the system or module root to the beginning of the file name. | |
Decl * | getKeyDeclaration (Decl *D) |
Returns the first key declaration for the given declaration. | |
const Decl * | getKeyDeclaration (const Decl *D) |
template<typename Fn > | |
void | forEachImportedKeyDecl (const Decl *D, Fn Visit) |
Run a callback on each imported key declaration of D . | |
const serialization::reader::DeclContextLookupTable * | getLoadedLookupTables (DeclContext *Primary) const |
Get the loaded lookup tables for Primary , if any. | |
llvm::iterator_range< ModuleDeclIterator > | getModuleFileLevelDecls (ModuleFile &Mod) |
ASTReader (Preprocessor &PP, InMemoryModuleCache &ModuleCache, ASTContext *Context, const PCHContainerReader &PCHContainerRdr, ArrayRef< std::shared_ptr< ModuleFileExtension > > Extensions, StringRef isysroot="", DisableValidationForModuleKind DisableValidationKind=DisableValidationForModuleKind::None, bool AllowASTWithCompilerErrors=false, bool AllowConfigurationMismatch=false, bool ValidateSystemInputs=false, bool ValidateASTInputFilesContent=false, bool UseGlobalIndex=true, std::unique_ptr< llvm::Timer > ReadTimer={}) | |
Load the AST file and validate its contents against the given Preprocessor. | |
ASTReader (const ASTReader &)=delete | |
ASTReader & | operator= (const ASTReader &)=delete |
~ASTReader () override | |
SourceManager & | getSourceManager () const |
FileManager & | getFileManager () const |
DiagnosticsEngine & | getDiags () const |
ASTReadResult | ReadAST (StringRef FileName, ModuleKind Type, SourceLocation ImportLoc, unsigned ClientLoadCapabilities, ModuleFile **NewLoadedModuleFile=nullptr) |
Load the AST file designated by the given file name. | |
void | makeModuleVisible (Module *Mod, Module::NameVisibilityKind NameVisibility, SourceLocation ImportLoc) |
Make the entities in the given module and any of its (non-explicit) submodules visible to name lookup. | |
void | makeNamesVisible (const HiddenNames &Names, Module *Owner) |
Make the names within this set of hidden names visible. | |
void | mergeDefinitionVisibility (NamedDecl *Def, NamedDecl *MergedDef) |
Note that MergedDef is a redefinition of the canonical definition Def, so Def should be visible whenever MergedDef is. | |
std::unique_ptr< ASTReaderListener > | takeListener () |
Take the AST callbacks listener. | |
void | setListener (std::unique_ptr< ASTReaderListener > Listener) |
Set the AST callbacks listener. | |
void | addListener (std::unique_ptr< ASTReaderListener > L) |
Add an AST callback listener. | |
void | setDeserializationListener (ASTDeserializationListener *Listener, bool TakeOwnership=false) |
Set the AST deserialization listener. | |
ASTDeserializationListener * | getDeserializationListener () |
Get the AST deserialization listener. | |
bool | hasGlobalIndex () const |
Determine whether this AST reader has a global index. | |
GlobalModuleIndex * | getGlobalIndex () |
Return global module index. | |
void | resetForReload () |
Reset reader for a reload try. | |
bool | loadGlobalIndex () |
Attempts to load the global index. | |
bool | isGlobalIndexUnavailable () const |
Determine whether we tried to load the global index, but failed, e.g., because it is out-of-date or does not exist. | |
void | InitializeContext () |
Initializes the ASTContext. | |
void | UpdateSema () |
Update the state of Sema after loading some additional modules. | |
void | addInMemoryBuffer (StringRef &FileName, std::unique_ptr< llvm::MemoryBuffer > Buffer) |
Add in-memory (virtual file) buffer. | |
void | finalizeForWriting () |
Finalizes the AST reader's state before writing an AST file to disk. | |
ModuleManager & | getModuleManager () |
Retrieve the module manager. | |
const ModuleManager & | getModuleManager () const |
Preprocessor & | getPreprocessor () const |
Retrieve the preprocessor. | |
StringRef | getOriginalSourceFile () |
Retrieve the name of the original source file name for the primary module file. | |
const std::string & | getSuggestedPredefines () |
Returns the suggested contents of the predefines buffer, which contains a (typically-empty) subset of the predefines build prior to including the precompiled header. | |
PreprocessedEntity * | ReadPreprocessedEntity (unsigned Index) override |
Read a preallocated preprocessed entity from the external source. | |
std::pair< unsigned, unsigned > | findPreprocessedEntitiesInRange (SourceRange Range) override |
Returns a pair of [Begin, End) indices of preallocated preprocessed entities that Range encompasses. | |
std::optional< bool > | isPreprocessedEntityInFileID (unsigned Index, FileID FID) override |
Optionally returns true or false if the preallocated preprocessed entity with index Index came from file FID . | |
SourceRange | ReadSkippedRange (unsigned Index) override |
Read a preallocated skipped range from the external source. | |
HeaderFileInfo | GetHeaderFileInfo (FileEntryRef FE) override |
Read the header file information for the given file entry. | |
void | ReadPragmaDiagnosticMappings (DiagnosticsEngine &Diag) |
unsigned | getTotalNumSLocs () const |
Returns the number of source locations found in the chain. | |
unsigned | getTotalNumIdentifiers () const |
Returns the number of identifiers found in the chain. | |
unsigned | getTotalNumMacros () const |
Returns the number of macros found in the chain. | |
unsigned | getTotalNumTypes () const |
Returns the number of types found in the chain. | |
unsigned | getTotalNumDecls () const |
Returns the number of declarations found in the chain. | |
unsigned | getTotalNumSubmodules () const |
Returns the number of submodules known. | |
unsigned | getTotalNumSelectors () const |
Returns the number of selectors found in the chain. | |
unsigned | getTotalNumPreprocessedEntities () const |
Returns the number of preprocessed entities known to the AST reader. | |
QualType | GetType (serialization::TypeID ID) |
Resolve a type ID into a type, potentially building a new type. | |
QualType | getLocalType (ModuleFile &F, serialization::LocalTypeID LocalID) |
Resolve a local type ID within a given AST file into a type. | |
serialization::TypeID | getGlobalTypeID (ModuleFile &F, serialization::LocalTypeID LocalID) const |
Map a local type ID within a given AST file into a global type ID. | |
QualType | readType (ModuleFile &F, const RecordData &Record, unsigned &Idx) |
Read a type from the current position in the given record, which was read from the given AST file. | |
GlobalDeclID | getGlobalDeclID (ModuleFile &F, LocalDeclID LocalID) const |
Map from a local declaration ID within a given module to a global declaration ID. | |
bool | isDeclIDFromModule (GlobalDeclID ID, ModuleFile &M) const |
Returns true if global DeclID ID originated from module M . | |
ModuleFile * | getOwningModuleFile (const Decl *D) const |
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a module file. | |
ModuleFile * | getOwningModuleFile (GlobalDeclID ID) const |
SourceLocation | getSourceLocationForDeclID (GlobalDeclID ID) |
Returns the source location for the decl ID . | |
Decl * | GetDecl (GlobalDeclID ID) |
Resolve a declaration ID into a declaration, potentially building a new declaration. | |
Decl * | GetExternalDecl (GlobalDeclID ID) override |
Resolve a declaration ID into a declaration, potentially building a new declaration. | |
Decl * | GetExistingDecl (GlobalDeclID ID) |
Resolve a declaration ID into a declaration. | |
Decl * | GetLocalDecl (ModuleFile &F, LocalDeclID LocalID) |
Reads a declaration with the given local ID in the given module. | |
template<typename T > | |
T * | GetLocalDeclAs (ModuleFile &F, LocalDeclID LocalID) |
Reads a declaration with the given local ID in the given module. | |
LocalDeclID | mapGlobalIDToModuleFileGlobalID (ModuleFile &M, GlobalDeclID GlobalID) |
Map a global declaration ID into the declaration ID used to refer to this declaration within the given module fule. | |
GlobalDeclID | ReadDeclID (ModuleFile &F, const RecordDataImpl &Record, unsigned &Idx) |
Reads a declaration ID from the given position in a record in the given module. | |
Decl * | ReadDecl (ModuleFile &F, const RecordDataImpl &R, unsigned &I) |
Reads a declaration from the given position in a record in the given module. | |
template<typename T > | |
T * | ReadDeclAs (ModuleFile &F, const RecordDataImpl &R, unsigned &I) |
Reads a declaration from the given position in a record in the given module. | |
void | CompleteRedeclChain (const Decl *D) override |
If any redeclarations of D have been imported since it was last checked, this digs out those redeclarations and adds them to the redeclaration chain for D . | |
CXXBaseSpecifier * | GetExternalCXXBaseSpecifiers (uint64_t Offset) override |
Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers. | |
Stmt * | GetExternalDeclStmt (uint64_t Offset) override |
Resolve the offset of a statement into a statement. | |
bool | FindExternalVisibleDeclsByName (const DeclContext *DC, DeclarationName Name) override |
Finds all the visible declarations with a given name. | |
void | FindExternalLexicalDecls (const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Decls) override |
Read all of the declarations lexically stored in a declaration context. | |
void | FindFileRegionDecls (FileID File, unsigned Offset, unsigned Length, SmallVectorImpl< Decl * > &Decls) override |
Get the decls that are contained in a file in the Offset/Length range. | |
void | StartedDeserializing () override |
Notify ASTReader that we started deserialization of a decl or type so until FinishedDeserializing is called there may be decls that are initializing. | |
void | FinishedDeserializing () override |
Notify ASTReader that we finished the deserialization of a decl or type. | |
void | StartTranslationUnit (ASTConsumer *Consumer) override |
Function that will be invoked when we begin parsing a new translation unit involving this external AST source. | |
void | PrintStats () override |
Print some statistics about AST usage. | |
void | dump () |
Dump information about the AST reader to standard error. | |
void | getMemoryBufferSizes (MemoryBufferSizes &sizes) const override |
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memory. | |
void | InitializeSema (Sema &S) override |
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree. | |
void | ForgetSema () override |
Inform the semantic consumer that Sema is no longer available. | |
IdentifierInfo * | get (StringRef Name) override |
Retrieve the IdentifierInfo for the named identifier. | |
IdentifierIterator * | getIdentifiers () override |
Retrieve an iterator into the set of all identifiers in all loaded AST files. | |
void | ReadMethodPool (Selector Sel) override |
Load the contents of the global method pool for a given selector. | |
void | updateOutOfDateSelector (Selector Sel) override |
Load the contents of the global method pool for a given selector if necessary. | |
void | ReadKnownNamespaces (SmallVectorImpl< NamespaceDecl * > &Namespaces) override |
Load the set of namespaces that are known to the external source, which will be used during typo correction. | |
void | ReadUndefinedButUsed (llvm::MapVector< NamedDecl *, SourceLocation > &Undefined) override |
Load the set of used but not defined functions or variables with internal linkage, or used but not defined internal functions. | |
void | ReadMismatchingDeleteExpressions (llvm::MapVector< FieldDecl *, llvm::SmallVector< std::pair< SourceLocation, bool >, 4 > > &Exprs) override |
void | ReadTentativeDefinitions (SmallVectorImpl< VarDecl * > &TentativeDefs) override |
Read the set of tentative definitions known to the external Sema source. | |
void | ReadUnusedFileScopedDecls (SmallVectorImpl< const DeclaratorDecl * > &Decls) override |
Read the set of unused file-scope declarations known to the external Sema source. | |
void | ReadDelegatingConstructors (SmallVectorImpl< CXXConstructorDecl * > &Decls) override |
Read the set of delegating constructors known to the external Sema source. | |
void | ReadExtVectorDecls (SmallVectorImpl< TypedefNameDecl * > &Decls) override |
Read the set of ext_vector type declarations known to the external Sema source. | |
void | ReadUnusedLocalTypedefNameCandidates (llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) override |
Read the set of potentially unused typedefs known to the source. | |
void | ReadDeclsToCheckForDeferredDiags (llvm::SmallSetVector< Decl *, 4 > &Decls) override |
Read the set of decls to be checked for deferred diags. | |
void | ReadReferencedSelectors (SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) override |
Read the set of referenced selectors known to the external Sema source. | |
void | ReadWeakUndeclaredIdentifiers (SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WeakIDs) override |
Read the set of weak, undeclared identifiers known to the external Sema source. | |
void | ReadUsedVTables (SmallVectorImpl< ExternalVTableUse > &VTables) override |
Read the set of used vtables known to the external Sema source. | |
void | ReadPendingInstantiations (SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) override |
Read the set of pending instantiations known to the external Sema source. | |
void | ReadLateParsedTemplates (llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > &LPTMap) override |
Read the set of late parsed template functions for this source. | |
void | AssignedLambdaNumbering (const CXXRecordDecl *Lambda) override |
Notify the external source that a lambda was assigned a mangling number. | |
void | LoadSelector (Selector Sel) |
Load a selector from disk, registering its ID if it exists. | |
void | SetIdentifierInfo (serialization::IdentifierID ID, IdentifierInfo *II) |
void | SetGloballyVisibleDecls (IdentifierInfo *II, const SmallVectorImpl< GlobalDeclID > &DeclIDs, SmallVectorImpl< Decl * > *Decls=nullptr) |
Set the globally-visible declarations associated with the given identifier. | |
DiagnosticBuilder | Diag (unsigned DiagID) const |
Report a diagnostic. | |
DiagnosticBuilder | Diag (SourceLocation Loc, unsigned DiagID) const |
Report a diagnostic. | |
void | warnStackExhausted (SourceLocation Loc) |
IdentifierInfo * | DecodeIdentifierInfo (serialization::IdentifierID ID) |
IdentifierInfo * | readIdentifier (ModuleFile &M, const RecordData &Record, unsigned &Idx) |
IdentifierInfo * | GetIdentifier (serialization::IdentifierID ID) override |
Return the identifier associated with the given ID number. | |
IdentifierInfo * | getLocalIdentifier (ModuleFile &M, uint64_t LocalID) |
serialization::IdentifierID | getGlobalIdentifierID (ModuleFile &M, uint64_t LocalID) |
void | resolvePendingMacro (IdentifierInfo *II, const PendingMacroInfo &PMInfo) |
MacroInfo * | getMacro (serialization::MacroID ID) |
Retrieve the macro with the given ID. | |
serialization::MacroID | getGlobalMacroID (ModuleFile &M, unsigned LocalID) |
Retrieve the global macro ID corresponding to the given local ID within the given module file. | |
bool | ReadSLocEntry (int ID) override |
Read the source location entry with index ID. | |
int | getSLocEntryID (SourceLocation::UIntTy SLocOffset) override |
Get the index ID for the loaded SourceLocation offset. | |
llvm::Expected< SourceLocation::UIntTy > | readSLocOffset (ModuleFile *F, unsigned Index) |
Try to read the offset of the SLocEntry at the given index in the given module file. | |
std::pair< SourceLocation, StringRef > | getModuleImportLoc (int ID) override |
Retrieve the module import location and module name for the given source manager entry ID. | |
serialization::SubmoduleID | getGlobalSubmoduleID (ModuleFile &M, unsigned LocalID) const |
Retrieve the global submodule ID given a module and its local ID number. | |
Module * | getSubmodule (serialization::SubmoduleID GlobalID) |
Retrieve the submodule that corresponds to a global submodule ID. | |
Module * | getModule (unsigned ID) override |
Retrieve the module that corresponds to the given module ID. | |
ModuleFile * | getLocalModuleFile (ModuleFile &M, unsigned ID) const |
Retrieve the module file with a given local ID within the specified ModuleFile. | |
unsigned | getModuleFileID (ModuleFile *M) |
Get an ID for the given module file. | |
std::optional< ASTSourceDescriptor > | getSourceDescriptor (unsigned ID) override |
Return a descriptor for the corresponding module. | |
ExtKind | hasExternalDefinitions (const Decl *D) override |
Selector | getLocalSelector (ModuleFile &M, unsigned LocalID) |
Retrieve a selector from the given module with its local ID number. | |
Selector | DecodeSelector (serialization::SelectorID Idx) |
Selector | GetExternalSelector (serialization::SelectorID ID) override |
Resolve a selector ID into a selector. | |
uint32_t | GetNumExternalSelectors () override |
Returns the number of selectors known to the external AST source. | |
Selector | ReadSelector (ModuleFile &M, const RecordData &Record, unsigned &Idx) |
serialization::SelectorID | getGlobalSelectorID (ModuleFile &M, unsigned LocalID) const |
Retrieve the global selector ID that corresponds to this the local selector ID in a given module. | |
CXXCtorInitializer ** | GetExternalCXXCtorInitializers (uint64_t Offset) override |
Read the contents of a CXXCtorInitializer array. | |
Sema::AlignPackInfo | ReadAlignPackInfo (uint32_t Raw) const |
Read a AlignPackInfo from raw form. | |
std::pair< SourceLocation, unsigned > | ReadUntranslatedSourceLocation (RawLocEncoding Raw, LocSeq *Seq=nullptr) const |
Read a source location from raw form and return it in its originating module file's source location space. | |
SourceLocation | ReadSourceLocation (ModuleFile &MF, RawLocEncoding Raw, LocSeq *Seq=nullptr) const |
Read a source location from raw form. | |
SourceLocation | TranslateSourceLocation (ModuleFile &ModuleFile, SourceLocation Loc) const |
Translate a source location from another module file's source location space into ours. | |
SourceLocation | ReadSourceLocation (ModuleFile &ModuleFile, const RecordDataImpl &Record, unsigned &Idx, LocSeq *Seq=nullptr) |
Read a source location. | |
FileID | ReadFileID (ModuleFile &F, const RecordDataImpl &Record, unsigned &Idx) const |
Read a FileID. | |
FileID | TranslateFileID (ModuleFile &F, FileID FID) const |
Translate a FileID from another module file's FileID space into ours. | |
SourceRange | ReadSourceRange (ModuleFile &F, const RecordData &Record, unsigned &Idx, LocSeq *Seq=nullptr) |
Read a source range. | |
std::string | ReadPath (ModuleFile &F, const RecordData &Record, unsigned &Idx) |
std::string | ReadPath (StringRef BaseDirectory, const RecordData &Record, unsigned &Idx) |
CXXTemporary * | ReadCXXTemporary (ModuleFile &F, const RecordData &Record, unsigned &Idx) |
Stmt * | ReadStmt (ModuleFile &F) |
Reads a statement. | |
Expr * | ReadExpr (ModuleFile &F) |
Reads an expression. | |
Stmt * | ReadSubStmt () |
Reads a sub-statement operand during statement reading. | |
Expr * | ReadSubExpr () |
Reads a sub-expression operand during statement reading. | |
Token | ReadToken (ModuleFile &M, const RecordDataImpl &Record, unsigned &Idx) |
Reads a token out of a record. | |
MacroInfo * | ReadMacroRecord (ModuleFile &F, uint64_t Offset) |
Reads the macro record located at the given offset. | |
serialization::PreprocessedEntityID | getGlobalPreprocessedEntityID (ModuleFile &M, unsigned LocalID) const |
Determine the global preprocessed entity ID that corresponds to the given local ID within the given module. | |
void | addPendingMacro (IdentifierInfo *II, ModuleFile *M, uint32_t MacroDirectivesOffset) |
Add a macro to deserialize its macro directive history. | |
void | ReadDefinedMacros () override |
Read the set of macros defined by this external macro source. | |
void | updateOutOfDateIdentifier (const IdentifierInfo &II) override |
Update an out-of-date identifier. | |
void | markIdentifierUpToDate (const IdentifierInfo *II) |
Note that this identifier is up-to-date. | |
void | completeVisibleDeclsMap (const DeclContext *DC) override |
Load all external visible decls in the given DeclContext. | |
ASTContext & | getContext () |
Retrieve the AST context that this AST reader supplements. | |
Sema * | getSema () |
Retrieve the semantic analysis object used to analyze the translation unit in which the precompiled header is being imported. | |
IdentifierResolver & | getIdResolver () |
Get the identifier resolver used for name lookup / updates in the translation unit scope. | |
IdentifierTable & | getIdentifierTable () |
Retrieve the identifier table associated with the preprocessor. | |
void | RecordSwitchCaseID (SwitchCase *SC, unsigned ID) |
Record that the given ID maps to the given switch-case statement. | |
SwitchCase * | getSwitchCaseWithID (unsigned ID) |
Retrieve the switch-case statement with the given ID. | |
void | ClearSwitchCaseIDs () |
void | ReadComments () override |
Loads comments ranges. | |
void | visitInputFileInfos (serialization::ModuleFile &MF, bool IncludeSystem, llvm::function_ref< void(const serialization::InputFileInfo &IFI, bool IsSystem)> Visitor) |
Visit all the input file infos of the given module file. | |
void | visitInputFiles (serialization::ModuleFile &MF, bool IncludeSystem, bool Complain, llvm::function_ref< void(const serialization::InputFile &IF, bool isSystem)> Visitor) |
Visit all the input files of the given module file. | |
void | visitTopLevelModuleMaps (serialization::ModuleFile &MF, llvm::function_ref< void(FileEntryRef)> Visitor) |
Visit all the top-level module maps loaded when building the given module file. | |
bool | isProcessingUpdateRecords () |
static void | ResolveImportedPath (std::string &Filename, StringRef Prefix) |
static std::string | getOriginalSourceFile (const std::string &ASTFileName, FileManager &FileMgr, const PCHContainerReader &PCHContainerRdr, DiagnosticsEngine &Diags) |
Retrieve the name of the original source file name directly from the AST file, without actually loading the AST file. | |
static bool | readASTFileControlBlock (StringRef Filename, FileManager &FileMgr, const InMemoryModuleCache &ModuleCache, const PCHContainerReader &PCHContainerRdr, bool FindModuleFileExtensions, ASTReaderListener &Listener, bool ValidateDiagnosticOptions, unsigned ClientLoadCapabilities=ARR_ConfigurationMismatch|ARR_OutOfDate) |
Read the control block for the named AST file. | |
static bool | isAcceptableASTFile (StringRef Filename, FileManager &FileMgr, const InMemoryModuleCache &ModuleCache, const PCHContainerReader &PCHContainerRdr, const LangOptions &LangOpts, const TargetOptions &TargetOpts, const PreprocessorOptions &PPOpts, StringRef ExistingModuleCachePath, bool RequireStrictOptionMatches=false) |
Determine whether the given AST file is acceptable to load into a translation unit with the given language and target options. | |
static llvm::Error | ReadBlockAbbrevs (llvm::BitstreamCursor &Cursor, unsigned BlockID, uint64_t *StartOfBlockOffset=nullptr) |
ReadBlockAbbrevs - Enter a subblock of the specified BlockID with the specified cursor. | |
static llvm::BitVector | ReadBitVector (const RecordData &Record, const StringRef Blob) |
static std::string | ReadString (const RecordDataImpl &Record, unsigned &Idx) |
static void | SkipString (const RecordData &Record, unsigned &Idx) |
static void | SkipPath (const RecordData &Record, unsigned &Idx) |
static VersionTuple | ReadVersionTuple (const RecordData &Record, unsigned &Idx) |
Read a version tuple. | |
Additional Inherited Members | |
Public Member Functions inherited from clang::ExternalPreprocessorSource | |
virtual | ~ExternalPreprocessorSource () |
virtual void | ReadDefinedMacros ()=0 |
Read the set of macros defined by this external macro source. | |
virtual void | updateOutOfDateIdentifier (const IdentifierInfo &II)=0 |
Update an out-of-date identifier. | |
virtual IdentifierInfo * | GetIdentifier (uint64_t ID)=0 |
Return the identifier associated with the given ID number. | |
virtual Module * | getModule (unsigned ModuleID)=0 |
Map a module ID to a module. | |
Public Member Functions inherited from clang::ExternalPreprocessingRecordSource | |
virtual | ~ExternalPreprocessingRecordSource () |
virtual PreprocessedEntity * | ReadPreprocessedEntity (unsigned Index)=0 |
Read a preallocated preprocessed entity from the external source. | |
virtual std::pair< unsigned, unsigned > | findPreprocessedEntitiesInRange (SourceRange Range)=0 |
Returns a pair of [Begin, End) indices of preallocated preprocessed entities that Range encompasses. | |
virtual std::optional< bool > | isPreprocessedEntityInFileID (unsigned Index, FileID FID) |
Optionally returns true or false if the preallocated preprocessed entity with index Index came from file FID . | |
virtual SourceRange | ReadSkippedRange (unsigned Index)=0 |
Read a preallocated skipped range from the external source. | |
Public Member Functions inherited from clang::ExternalHeaderFileInfoSource | |
virtual | ~ExternalHeaderFileInfoSource () |
virtual HeaderFileInfo | GetHeaderFileInfo (FileEntryRef FE)=0 |
Retrieve the header file information for the given file entry. | |
Public Member Functions inherited from clang::ExternalSemaSource | |
ExternalSemaSource ()=default | |
~ExternalSemaSource () override | |
virtual void | InitializeSema (Sema &S) |
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree. | |
virtual void | ForgetSema () |
Inform the semantic consumer that Sema is no longer available. | |
virtual void | ReadMethodPool (Selector Sel) |
Load the contents of the global method pool for a given selector. | |
virtual void | updateOutOfDateSelector (Selector Sel) |
Load the contents of the global method pool for a given selector if necessary. | |
virtual void | ReadKnownNamespaces (SmallVectorImpl< NamespaceDecl * > &Namespaces) |
Load the set of namespaces that are known to the external source, which will be used during typo correction. | |
virtual void | ReadUndefinedButUsed (llvm::MapVector< NamedDecl *, SourceLocation > &Undefined) |
Load the set of used but not defined functions or variables with internal linkage, or used but not defined internal functions. | |
virtual void | ReadMismatchingDeleteExpressions (llvm::MapVector< FieldDecl *, llvm::SmallVector< std::pair< SourceLocation, bool >, 4 > > &) |
virtual bool | LookupUnqualified (LookupResult &R, Scope *S) |
Do last resort, unqualified lookup on a LookupResult that Sema cannot find. | |
virtual void | ReadTentativeDefinitions (SmallVectorImpl< VarDecl * > &TentativeDefs) |
Read the set of tentative definitions known to the external Sema source. | |
virtual void | ReadUnusedFileScopedDecls (SmallVectorImpl< const DeclaratorDecl * > &Decls) |
Read the set of unused file-scope declarations known to the external Sema source. | |
virtual void | ReadDelegatingConstructors (SmallVectorImpl< CXXConstructorDecl * > &Decls) |
Read the set of delegating constructors known to the external Sema source. | |
virtual void | ReadExtVectorDecls (SmallVectorImpl< TypedefNameDecl * > &Decls) |
Read the set of ext_vector type declarations known to the external Sema source. | |
virtual void | ReadUnusedLocalTypedefNameCandidates (llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) |
Read the set of potentially unused typedefs known to the source. | |
virtual void | ReadReferencedSelectors (SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) |
Read the set of referenced selectors known to the external Sema source. | |
virtual void | ReadWeakUndeclaredIdentifiers (SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WI) |
Read the set of weak, undeclared identifiers known to the external Sema source. | |
virtual void | ReadUsedVTables (SmallVectorImpl< ExternalVTableUse > &VTables) |
Read the set of used vtables known to the external Sema source. | |
virtual void | ReadPendingInstantiations (SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) |
Read the set of pending instantiations known to the external Sema source. | |
virtual void | ReadLateParsedTemplates (llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > &LPTMap) |
Read the set of late parsed template functions for this source. | |
virtual void | ReadDeclsToCheckForDeferredDiags (llvm::SmallSetVector< Decl *, 4 > &Decls) |
Read the set of decls to be checked for deferred diags. | |
virtual TypoCorrection | CorrectTypo (const DeclarationNameInfo &Typo, int LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, DeclContext *MemberContext, bool EnteringContext, const ObjCObjectPointerType *OPT) |
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to the name that was present in the source code. | |
virtual bool | MaybeDiagnoseMissingCompleteType (SourceLocation Loc, QualType T) |
Produces a diagnostic note if the external source contains a complete definition for T . | |
virtual void | AssignedLambdaNumbering (const CXXRecordDecl *Lambda) |
Notify the external source that a lambda was assigned a mangling number. | |
bool | isA (const void *ClassID) const override |
LLVM-style RTTI. | |
Public Member Functions inherited from clang::ExternalASTSource | |
ExternalASTSource ()=default | |
virtual | ~ExternalASTSource () |
uint32_t | getGeneration () const |
Get the current generation of this AST source. | |
virtual Decl * | GetExternalDecl (GlobalDeclID ID) |
Resolve a declaration ID into a declaration, potentially building a new declaration. | |
virtual Selector | GetExternalSelector (uint32_t ID) |
Resolve a selector ID into a selector. | |
virtual uint32_t | GetNumExternalSelectors () |
Returns the number of selectors known to the external AST source. | |
virtual Stmt * | GetExternalDeclStmt (uint64_t Offset) |
Resolve the offset of a statement in the decl stream into a statement. | |
virtual CXXCtorInitializer ** | GetExternalCXXCtorInitializers (uint64_t Offset) |
Resolve the offset of a set of C++ constructor initializers in the decl stream into an array of initializers. | |
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. | |
virtual void | updateOutOfDateIdentifier (const IdentifierInfo &II) |
Update an out-of-date identifier. | |
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 calling SetExternalVisibleDeclsForName or SetNoExternalVisibleDeclsForName. | |
virtual void | completeVisibleDeclsMap (const DeclContext *DC) |
Ensures that the table of all visible declarations inside this context is up to date. | |
virtual Module * | getModule (unsigned ID) |
Retrieve the module that corresponds to the given module ID. | |
virtual std::optional< ASTSourceDescriptor > | getSourceDescriptor (unsigned ID) |
Return a descriptor for the corresponding module, if one exists. | |
virtual ExtKind | hasExternalDefinitions (const Decl *D) |
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 filter predicate. | |
void | FindExternalLexicalDecls (const DeclContext *DC, SmallVectorImpl< Decl * > &Result) |
Finds all declarations lexically contained within the given DeclContext. | |
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 void | CompleteRedeclChain (const Decl *D) |
Gives the external AST source an opportunity to complete the redeclaration chain for a declaration. | |
virtual void | CompleteType (TagDecl *Tag) |
Gives the external AST source an opportunity to complete an incomplete type. | |
virtual void | CompleteType (ObjCInterfaceDecl *Class) |
Gives the external AST source an opportunity to complete an incomplete Objective-C class. | |
virtual void | ReadComments () |
Loads comment ranges. | |
virtual void | StartedDeserializing () |
Notify ExternalASTSource that we started deserialization of a decl or type so until FinishedDeserializing is called there may be decls that are initializing. | |
virtual void | FinishedDeserializing () |
Notify ExternalASTSource that we finished the deserialization of a decl or type. | |
virtual void | StartTranslationUnit (ASTConsumer *Consumer) |
Function that will be invoked when we begin parsing a new translation unit involving this external AST source. | |
virtual void | PrintStats () |
Print any statistics that have been gathered regarding 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. | |
MemoryBufferSizes | getMemoryBufferSizes () const |
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memory. | |
virtual void | getMemoryBufferSizes (MemoryBufferSizes &sizes) const |
Public Member Functions inherited from clang::IdentifierInfoLookup | |
virtual | ~IdentifierInfoLookup () |
virtual IdentifierInfo * | get (StringRef Name)=0 |
Return the IdentifierInfo for the specified named identifier. | |
virtual IdentifierIterator * | getIdentifiers () |
Retrieve an iterator into the set of all identifiers known to this identifier lookup source. | |
Public Member Functions inherited from clang::ExternalSLocEntrySource | |
virtual | ~ExternalSLocEntrySource () |
virtual bool | ReadSLocEntry (int ID)=0 |
Read the source location entry with index ID, which will always be less than -1. | |
virtual int | getSLocEntryID (SourceLocation::UIntTy SLocOffset)=0 |
Get the index ID for the loaded SourceLocation offset. | |
virtual std::pair< SourceLocation, StringRef > | getModuleImportLoc (int ID)=0 |
Retrieve the module import location and name for the given ID, if in fact it was loaded from a module (rather than, say, a precompiled header). | |
Static Public Member Functions inherited from clang::ExternalSemaSource | |
static bool | classof (const ExternalASTSource *S) |
Static Public Member Functions inherited from clang::ExternalASTSource | |
static bool | classof (const ExternalASTSource *S) |
Protected Member Functions inherited from clang::ExternalASTSource | |
uint32_t | incrementGeneration (ASTContext &C) |
Increment the current generation. | |
Static Protected Member Functions inherited from clang::ExternalASTSource | |
static DeclContextLookupResult | SetExternalVisibleDeclsForName (const DeclContext *DC, DeclarationName Name, ArrayRef< NamedDecl * > Decls) |
static DeclContextLookupResult | SetNoExternalVisibleDeclsForName (const DeclContext *DC, DeclarationName Name) |
Reads an AST files chain containing the contents of a translation unit.
The ASTReader class reads bitstreams (produced by the ASTWriter class) containing the serialized representation of a given abstract syntax tree and its supporting data structures. An instance of the ASTReader can be attached to an ASTContext object, which will provide access to the contents of the AST files.
The AST reader provides lazy de-serialization of declarations, as required when traversing the AST. Only those AST nodes that are actually required will be de-serialized.
Definition at line 371 of file ASTReader.h.
Definition at line 428 of file ASTReader.h.
Definition at line 424 of file ASTReader.h.
Definition at line 427 of file ASTReader.h.
Definition at line 425 of file ASTReader.h.
Definition at line 426 of file ASTReader.h.
Definition at line 429 of file ASTReader.h.
Definition at line 2257 of file ASTReader.h.
using clang::ASTReader::RecordData = SmallVector<uint64_t, 64> |
Definition at line 393 of file ASTReader.h.
using clang::ASTReader::RecordDataImpl = SmallVectorImpl<uint64_t> |
Definition at line 394 of file ASTReader.h.
The result of reading the control block of an AST file, which can fail for various reasons.
Definition at line 398 of file ASTReader.h.
Flags that indicate what kind of AST loading failures the client of the AST reader can directly handle.
When a client states that it can handle a particular kind of failure, the AST reader will not emit errors when producing that kind of failure.
Definition at line 1631 of file ASTReader.h.
ASTReader::ASTReader | ( | Preprocessor & | PP, |
InMemoryModuleCache & | ModuleCache, | ||
ASTContext * | Context, | ||
const PCHContainerReader & | PCHContainerRdr, | ||
ArrayRef< std::shared_ptr< ModuleFileExtension > > | Extensions, | ||
StringRef | isysroot = "" , |
||
DisableValidationForModuleKind | DisableValidationKind = DisableValidationForModuleKind::None , |
||
bool | AllowASTWithCompilerErrors = false , |
||
bool | AllowConfigurationMismatch = false , |
||
bool | ValidateSystemInputs = false , |
||
bool | ValidateASTInputFilesContent = false , |
||
bool | UseGlobalIndex = true , |
||
std::unique_ptr< llvm::Timer > | ReadTimer = {} |
||
) |
Load the AST file and validate its contents against the given Preprocessor.
PP | the preprocessor associated with the context in which this precompiled header will be loaded. |
Context | the AST context that this precompiled header will be loaded into, if any. |
PCHContainerRdr | the PCHContainerOperations to use for loading and creating modules. |
Extensions | the list of module file extensions that can be loaded from the AST files. |
isysroot | If non-NULL, the system include path specified by the user. This is only used with relocatable PCH files. If non-NULL, a relocatable PCH file will use the default path "/". |
DisableValidationKind | If set, the AST reader will suppress most of its regular consistency checking, allowing the use of precompiled headers and module files that cannot be determined to be compatible. |
AllowASTWithCompilerErrors | If true, the AST reader will accept an AST file the was created out of an AST with compiler errors, otherwise it will reject it. |
AllowConfigurationMismatch | If true, the AST reader will not check for configuration differences between the AST file and the invocation. |
ValidateSystemInputs | If true, the AST reader will validate system input files in addition to user input files. This is only meaningful if DisableValidation is false. |
UseGlobalIndex | If true, the AST reader will try to load and use the global module index. |
ReadTimer | If non-null, a timer used to track the time spent deserializing. |
Definition at line 10410 of file ASTReader.cpp.
References bool, clang::cast(), clang::DiagnosticsEngine::Report(), and clang::SourceManager::setExternalSLocEntrySource().
|
delete |
|
override |
Definition at line 10449 of file ASTReader.cpp.
|
inline |
Add in-memory (virtual file) buffer.
Definition at line 1782 of file ASTReader.h.
References clang::serialization::ModuleManager::addInMemoryBuffer(), and clang::FileName.
|
inline |
Add an AST callback listener.
Takes ownership of L
.
Definition at line 1716 of file ASTReader.h.
Referenced by clang::DependencyCollector::attachToASTReader(), and clang::ModuleDependencyCollector::attachToASTReader().
void ASTReader::addPendingMacro | ( | IdentifierInfo * | II, |
ModuleFile * | M, | ||
uint32_t | MacroDirectivesOffset | ||
) |
Add a macro to deserialize its macro directive history.
II | The name of the macro. |
M | The module file. |
MacroDirectivesOffset | Offset of the serialized macro directive history. |
Definition at line 2172 of file ASTReader.cpp.
|
overridevirtual |
Notify the external source that a lambda was assigned a mangling number.
This enables the external source to track the correspondence between lambdas and mangling numbers if necessary.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8966 of file ASTReader.cpp.
References getCanonicalDecl(), clang::CXXRecordDecl::getLambdaContextDecl(), and clang::CXXRecordDecl::getLambdaIndexInContext().
void ASTReader::ClearSwitchCaseIDs | ( | ) |
Definition at line 9633 of file ASTReader.cpp.
|
overridevirtual |
If any redeclarations of D
have been imported since it was last checked, this digs out those redeclarations and adds them to the redeclaration chain for D
.
Reimplemented from clang::ExternalASTSource.
Definition at line 7598 of file ASTReader.cpp.
References clang::CPlusPlus, D, clang::Decl::getDeclContext(), clang::Decl::getKind(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::getRedeclContext(), clang::DeclContext::lookup(), and clang::serialization::needsAnonymousDeclarationNumber().
|
overridevirtual |
Load all external visible decls in the given DeclContext.
Reimplemented from clang::ExternalASTSource.
Definition at line 8172 of file ASTReader.cpp.
References E, clang::NamedDecl::getDeclName(), and clang::DeclContext::hasExternalVisibleStorage().
IdentifierInfo * ASTReader::DecodeIdentifierInfo | ( | serialization::IdentifierID | ID | ) |
Definition at line 9055 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BaseIdentifierID, clang::Data, clang::IdentifierTable::get(), clang::Preprocessor::getCurrentModule(), clang::Preprocessor::getIdentifierTable(), getPreprocessor(), clang::serialization::ModuleFile::IdentifierOffsets, clang::ASTDeserializationListener::IdentifierRead(), clang::serialization::ModuleFile::IdentifierTableData, markIdentifierFromAST(), clang::serialization::reader::ASTIdentifierLookupTraitBase::ReadKey(), and clang::serialization::reader::ASTIdentifierLookupTraitBase::ReadKeyDataLength().
Referenced by GetIdentifier(), getLocalIdentifier(), readIdentifier(), and ReadWeakUndeclaredIdentifiers().
Selector ASTReader::DecodeSelector | ( | serialization::SelectorID | Idx | ) |
Definition at line 9243 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BaseSelectorID, clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::NUM_PREDEF_SELECTOR_IDS, clang::serialization::reader::ASTSelectorLookupTrait::ReadKey(), clang::serialization::ModuleFile::SelectorLookupTableData, clang::serialization::ModuleFile::SelectorOffsets, and clang::ASTDeserializationListener::SelectorRead().
Referenced by GetExternalSelector(), getLocalSelector(), and ReadReferencedSelectors().
DiagnosticBuilder ASTReader::Diag | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) | const |
Report a diagnostic.
Definition at line 9595 of file ASTReader.cpp.
References Loc, and clang::DiagnosticsEngine::Report().
DiagnosticBuilder ASTReader::Diag | ( | unsigned | DiagID | ) | const |
Report a diagnostic.
Definition at line 9591 of file ASTReader.cpp.
References Diag().
Referenced by checkMultipleDefinitionInNamedModules(), Diag(), clang::ASTDeclReader::VisitObjCIvarDecl(), and warnStackExhausted().
LLVM_DUMP_METHOD void ASTReader::dump | ( | ) |
Dump information about the AST reader to standard error.
Definition at line 8341 of file ASTReader.cpp.
References clang::serialization::ModuleFile::dump(), and dumpModuleIDMap().
void ASTReader::finalizeForWriting | ( | ) |
Finalizes the AST reader's state before writing an AST file to disk.
This operation may undo temporary state in the AST that should not be emitted.
Definition at line 5267 of file ASTReader.cpp.
|
overridevirtual |
Read all of the declarations lexically stored in a declaration context.
DC | The declaration context whose declarations will be read. |
IsKindWeWant | A predicate indicating which declaration kinds we are interested in. |
Decls | Vector that will contain the declarations loaded from the external source. The caller is responsible for merging these declarations with any declarations already stored in the declaration context. |
Reimplemented from clang::ExternalASTSource.
Definition at line 8022 of file ASTReader.cpp.
References D, clang::LocalDeclID::get(), clang::Decl::getKind(), clang::DeclContext::isDeclInLexicalTraversal(), and clang::NUM_PREDEF_DECL_IDS.
|
overridevirtual |
Finds all the visible declarations with a given name.
The current implementation of this method just loads the entire lookup table as unmaterialized references.
Reimplemented from clang::ExternalASTSource.
Definition at line 8144 of file ASTReader.cpp.
References clang::Found, clang::NamedDecl::getDeclName(), clang::DeclContext::getPrimaryContext(), and clang::DeclContext::hasExternalVisibleStorage().
|
overridevirtual |
Get the decls that are contained in a file in the Offset/Length range.
Length
can be 0 to indicate a point at Offset
instead of a range.
Reimplemented from clang::ExternalASTSource.
Definition at line 8100 of file ASTReader.cpp.
References clang::File, clang::LocalDeclID::get(), clang::SourceLocation::getLocWithOffset(), and SM.
|
overridevirtual |
Returns a pair of [Begin, End) indices of preallocated preprocessed entities that Range
encompasses.
Returns a pair of [Begin, End) indices of preallocated preprocessed entities that.
Implements clang::ExternalPreprocessingRecordSource.
Definition at line 6505 of file ASTReader.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::SourceRange::isInvalid(), and Range.
|
overridevirtual |
Notify ASTReader that we finished the deserialization of a decl or type.
Must be paired with StartedDeserializing.
Reimplemented from clang::ExternalASTSource.
Definition at line 10326 of file ASTReader.cpp.
References clang::ASTContext::adjustDeducedFunctionResultType(), clang::ASTContext::adjustExceptionSpec(), clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::ASTContext::getASTMutationListener(), getContext(), clang::FunctionProtoType::getExtProtoInfo(), and clang::Update.
|
inline |
Run a callback on each imported key declaration of D
.
Definition at line 1345 of file ASTReader.h.
References D, and GetExistingDecl().
|
inlineoverridevirtual |
Inform the semantic consumer that Sema is no longer available.
Reimplemented from clang::ExternalSemaSource.
Definition at line 2079 of file ASTReader.h.
|
overridevirtual |
Retrieve the IdentifierInfo for the named identifier.
This routine builds a new IdentifierInfo for the given identifier. If any declarations with this name are visible from translation unit scope, their declarations will be deserialized and introduced into the declaration chain of the identifier.
Implements clang::IdentifierInfoLookup.
Definition at line 8505 of file ASTReader.cpp.
|
inline |
Retrieve the AST context that this AST reader supplements.
Definition at line 2403 of file ASTReader.h.
Referenced by clang::ASTDeclReader::attachPreviousDecl(), checkMultipleDefinitionInNamedModules(), FinishedDeserializing(), clang::ASTRecordReader::getContext(), clang::index::indexModuleFile(), clang::ASTDeclMerger::MergeDefinitionData(), clang::ASTDeclMerger::mergeLambda(), clang::ASTDeclReader::mergeMergeable(), clang::ASTDeclReader::mergeRedeclarable(), ReadComments(), ReadCXXTemporary(), clang::ASTDeclReader::ReadFunctionDefinition(), clang::ASTDeclReader::ReadObjCTypeParamList(), clang::ASTDeclReader::ReadVarDeclInit(), clang::ASTDeclReader::UpdateDecl(), clang::ASTDeclReader::VisitBlockDecl(), clang::ASTDeclReader::VisitClassTemplateDecl(), clang::ASTDeclReader::VisitClassTemplateSpecializationDeclImpl(), clang::ASTDeclReader::VisitCXXMethodDecl(), clang::ASTDeclReader::VisitCXXRecordDeclImpl(), clang::ASTDeclReader::VisitDecl(), clang::ASTDeclReader::VisitDeclaratorDecl(), clang::ASTDeclReader::VisitEnumConstantDecl(), clang::ASTDeclReader::VisitEnumDecl(), clang::ASTDeclReader::VisitFieldDecl(), clang::ASTDeclReader::VisitFriendTemplateDecl(), clang::ASTDeclReader::VisitFunctionDecl(), clang::ASTDeclReader::VisitIndirectFieldDecl(), clang::ASTDeclReader::VisitMSGuidDecl(), clang::ASTDeclReader::VisitNonTypeTemplateParmDecl(), clang::ASTDeclReader::VisitObjCCategoryDecl(), clang::ASTDeclReader::VisitObjCMethodDecl(), clang::ASTDeclReader::VisitRedeclarableTemplateDecl(), clang::ASTDeclReader::VisitTagDecl(), clang::ASTDeclReader::VisitTemplateParamObjectDecl(), clang::ASTDeclReader::VisitTemplateTemplateParmDecl(), clang::ASTDeclReader::VisitTemplateTypeParmDecl(), clang::ASTDeclReader::VisitUnnamedGlobalConstantDecl(), clang::ASTDeclReader::VisitUsingDecl(), clang::ASTDeclReader::VisitUsingEnumDecl(), clang::ASTDeclReader::VisitUsingShadowDecl(), clang::ASTDeclReader::VisitVarDeclImpl(), and clang::ASTDeclReader::VisitVarTemplateSpecializationDeclImpl().
Decl * ASTReader::GetDecl | ( | GlobalDeclID | ID | ) |
Resolve a declaration ID into a declaration, potentially building a new declaration.
Definition at line 7941 of file ASTReader.cpp.
References clang::NUM_PREDEF_DECL_IDS.
Referenced by GetLocalDecl(), clang::ASTReader::ModuleDeclIterator::operator*(), ReadDecl(), ReadDeclAs(), ReadDeclsToCheckForDeferredDiags(), ReadDelegatingConstructors(), ReadExtVectorDecls(), ReadKnownNamespaces(), ReadMismatchingDeleteExpressions(), ReadPendingInstantiations(), ReadTentativeDefinitions(), ReadUndefinedButUsed(), ReadUnusedFileScopedDecls(), ReadUnusedLocalTypedefNameCandidates(), ReadUsedVTables(), SetGloballyVisibleDecls(), clang::ASTDeclReader::Visit(), clang::ASTDeclReader::VisitNamespaceDecl(), and clang::ASTDeclReader::VisitRedeclarable().
|
inline |
Get the AST deserialization listener.
Definition at line 1753 of file ASTReader.h.
|
inline |
Definition at line 1624 of file ASTReader.h.
Referenced by clang::TestModuleFileExtension::createExtensionReader().
Decl * ASTReader::GetExistingDecl | ( | GlobalDeclID | ID | ) |
Resolve a declaration ID into a declaration.
Return 0 if it's not been loaded yet.
Definition at line 7915 of file ASTReader.cpp.
References D, clang::Decl::getCanonicalDecl(), and clang::NUM_PREDEF_DECL_IDS.
Referenced by forEachImportedKeyDecl(), and getKeyDeclaration().
|
overridevirtual |
Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers.
The default implementation of this method is a no-op.
Reimplemented from clang::ExternalASTSource.
Definition at line 7687 of file ASTReader.cpp.
References clang::ASTContext::Allocate(), D, clang::serialization::DECL_CXX_BASE_SPECIFIERS, and Loc.
|
overridevirtual |
Read the contents of a CXXCtorInitializer array.
Reimplemented from clang::ExternalASTSource.
Definition at line 7655 of file ASTReader.cpp.
References D, clang::serialization::DECL_CXX_CTOR_INITIALIZERS, and Loc.
|
overridevirtual |
Resolve a declaration ID into a declaration, potentially building a new declaration.
This method only needs to be implemented if the AST source ever passes back decl sets as VisibleDeclaration objects.
The default implementation of this method is a no-op.
Reimplemented from clang::ExternalASTSource.
Definition at line 7596 of file ASTReader.cpp.
|
overridevirtual |
Resolve the offset of a statement into a statement.
This operation will read a new statement from the external source each time it is called, and is meant to be used via a LazyOffsetPtr (which is used by Decls for the body of functions, etc).
Reimplemented from clang::ExternalASTSource.
Definition at line 8006 of file ASTReader.cpp.
|
overridevirtual |
Resolve a selector ID into a selector.
This operation only needs to be implemented if the AST source returns non-zero for GetNumKnownSelectors().
The default implementation of this method is a no-op.
Reimplemented from clang::ExternalASTSource.
Definition at line 9268 of file ASTReader.cpp.
References DecodeSelector().
|
inline |
Definition at line 1623 of file ASTReader.h.
Referenced by clang::DependencyCollector::attachToASTReader(), clang::ModuleDependencyCollector::attachToASTReader(), and clang::PCHValidator::ReadHeaderSearchOptions().
GlobalDeclID ASTReader::getGlobalDeclID | ( | ModuleFile & | F, |
LocalDeclID | LocalID | ||
) | const |
Map from a local declaration ID within a given module to a global declaration ID.
Definition at line 7729 of file ASTReader.cpp.
References clang::DeclIDBase::getLocalDeclIndex(), clang::DeclIDBase::getModuleFileIndex(), clang::DeclIDBase::getRawValue(), clang::serialization::ModuleFile::Index, clang::serialization::ModuleFile::ModuleOffsetMap, clang::NUM_PREDEF_DECL_IDS, and clang::serialization::ModuleFile::TransitiveImports.
Referenced by GetLocalDecl(), and clang::ASTReader::ModuleDeclIterator::operator*().
IdentifierID ASTReader::getGlobalIdentifierID | ( | ModuleFile & | M, |
uint64_t | LocalID | ||
) |
Definition at line 9090 of file ASTReader.cpp.
References clang::serialization::ModuleFile::Index, clang::serialization::ModuleFile::ModuleOffsetMap, clang::serialization::NUM_PREDEF_IDENT_IDS, and clang::serialization::ModuleFile::TransitiveImports.
Referenced by getLocalIdentifier(), and readIdentifier().
|
inline |
Return global module index.
Definition at line 1761 of file ASTReader.h.
MacroID ASTReader::getGlobalMacroID | ( | ModuleFile & | M, |
unsigned | LocalID | ||
) |
Retrieve the global macro ID corresponding to the given local ID within the given module file.
Definition at line 9136 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::MacroRemap, clang::serialization::ModuleFile::ModuleOffsetMap, and clang::serialization::NUM_PREDEF_MACRO_IDS.
PreprocessedEntityID ASTReader::getGlobalPreprocessedEntityID | ( | ModuleFile & | M, |
unsigned | LocalID | ||
) | const |
Determine the global preprocessed entity ID that corresponds to the given local ID within the given module.
Definition at line 2034 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::ModuleOffsetMap, clang::serialization::NUM_PREDEF_PP_ENTITY_IDS, and clang::serialization::ModuleFile::PreprocessedEntityRemap.
serialization::SelectorID ASTReader::getGlobalSelectorID | ( | ModuleFile & | M, |
unsigned | LocalID | ||
) | const |
Retrieve the global selector ID that corresponds to this the local selector ID in a given module.
Definition at line 9278 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::ModuleOffsetMap, clang::serialization::NUM_PREDEF_SELECTOR_IDS, and clang::serialization::ModuleFile::SelectorRemap.
Referenced by getLocalSelector().
serialization::SubmoduleID ASTReader::getGlobalSubmoduleID | ( | ModuleFile & | M, |
unsigned | LocalID | ||
) | const |
Retrieve the global submodule ID given a module and its local ID number.
Definition at line 9151 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::ModuleOffsetMap, clang::serialization::NUM_PREDEF_SUBMODULE_IDS, and clang::serialization::ModuleFile::SubmoduleRemap.
Referenced by clang::ASTRecordReader::getGlobalSubmoduleID(), and getLocalModuleFile().
serialization::TypeID ASTReader::getGlobalTypeID | ( | ModuleFile & | F, |
serialization::LocalTypeID | LocalID | ||
) | const |
Map a local type ID within a given AST file into a global type ID.
Definition at line 7517 of file ASTReader.cpp.
References clang::Qualifiers::FastWidth, getModuleFileIndexForTypeID(), clang::serialization::ModuleFile::Index, isPredefinedType(), clang::serialization::ModuleFile::ModuleOffsetMap, clang::serialization::NUM_PREDEF_TYPE_IDS, and clang::serialization::ModuleFile::TransitiveImports.
Referenced by clang::ASTRecordReader::getGlobalTypeID().
|
overridevirtual |
Read the header file information for the given file entry.
Implements clang::ExternalHeaderFileInfoSource.
Definition at line 6568 of file ASTReader.cpp.
|
inlineoverridevirtual |
Return the identifier associated with the given ID number.
The ID 0 is associated with the NULL identifier.
Implements clang::ExternalPreprocessorSource.
Definition at line 2171 of file ASTReader.h.
References DecodeIdentifierInfo().
|
overridevirtual |
Retrieve an iterator into the set of all identifiers in all loaded AST files.
Reimplemented from clang::IdentifierInfoLookup.
Definition at line 8630 of file ASTReader.cpp.
References ASTIdentifierIterator, and loadGlobalIndex().
IdentifierTable & ASTReader::getIdentifierTable | ( | ) |
Retrieve the identifier table associated with the preprocessor.
Definition at line 9615 of file ASTReader.cpp.
References clang::Preprocessor::getIdentifierTable().
IdentifierResolver & ASTReader::getIdResolver | ( | ) |
Get the identifier resolver used for name lookup / updates in the translation unit scope.
We have one of these even if we don't have a Sema object.
Definition at line 10454 of file ASTReader.cpp.
References clang::Sema::IdResolver.
Definition at line 1339 of file ASTReader.h.
References D, and getKeyDeclaration().
Returns the first key declaration for the given declaration.
This is one that is formerly-canonical (or still canonical) and whose module did not import any other key declaration of the entity.
Definition at line 1329 of file ASTReader.h.
References D, and GetExistingDecl().
Referenced by getKeyDeclaration().
const serialization::reader::DeclContextLookupTable * ASTReader::getLoadedLookupTables | ( | DeclContext * | Primary | ) | const |
Get the loaded lookup tables for Primary
, if any.
Definition at line 8196 of file ASTReader.cpp.
|
inline |
Reads a declaration with the given local ID in the given module.
Definition at line 1954 of file ASTReader.h.
References GetDecl(), and getGlobalDeclID().
Referenced by clang::ASTRecordReader::GetLocalDeclAs(), and GetLocalDeclAs().
|
inline |
Reads a declaration with the given local ID in the given module.
Definition at line 1961 of file ASTReader.h.
References GetLocalDecl().
IdentifierInfo * ASTReader::getLocalIdentifier | ( | ModuleFile & | M, |
uint64_t | LocalID | ||
) |
Definition at line 9086 of file ASTReader.cpp.
References DecodeIdentifierInfo(), and getGlobalIdentifierID().
ModuleFile * ASTReader::getLocalModuleFile | ( | ModuleFile & | M, |
unsigned | ID | ||
) | const |
Retrieve the module file with a given local ID within the specified ModuleFile.
Definition at line 9184 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), getGlobalSubmoduleID(), getModuleManager(), and clang::serialization::ModuleManager::pch_modules().
Selector ASTReader::getLocalSelector | ( | ModuleFile & | M, |
unsigned | LocalID | ||
) |
Retrieve a selector from the given module with its local ID number.
Definition at line 9239 of file ASTReader.cpp.
References DecodeSelector(), and getGlobalSelectorID().
Referenced by ReadSelector().
QualType ASTReader::getLocalType | ( | ModuleFile & | F, |
serialization::LocalTypeID | LocalID | ||
) |
Resolve a local type ID within a given AST file into a type.
Definition at line 7513 of file ASTReader.cpp.
Referenced by readType().
MacroInfo * ASTReader::getMacro | ( | serialization::MacroID | ID | ) |
Retrieve the macro with the given ID.
Definition at line 9109 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BaseMacroID, clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::MacroOffsets, clang::serialization::ModuleFile::MacroOffsetsBase, clang::ASTDeserializationListener::MacroRead(), clang::serialization::NUM_PREDEF_MACRO_IDS, and ReadMacroRecord().
|
overridevirtual |
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memory.
Reimplemented from clang::ExternalASTSource.
Definition at line 8358 of file ASTReader.cpp.
References bytes(), clang::ExternalASTSource::MemoryBufferSizes::malloc_bytes, and clang::ExternalASTSource::MemoryBufferSizes::mmap_bytes.
Retrieve the module that corresponds to the given module ID.
Note: overrides method in ExternalASTSource
Implements clang::ExternalPreprocessorSource.
Definition at line 9180 of file ASTReader.cpp.
References getSubmodule().
Referenced by clang::DumpModuleInfoAction::ExecuteAction().
unsigned ASTReader::getModuleFileID | ( | ModuleFile * | M | ) |
Get an ID for the given module file.
Definition at line 9197 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BaseSubmoduleID, getModuleManager(), clang::serialization::ModuleFile::isModule(), clang::serialization::NUM_PREDEF_SUBMODULE_IDS, and clang::serialization::ModuleManager::pch_modules().
llvm::iterator_range< ASTReader::ModuleDeclIterator > ASTReader::getModuleFileLevelDecls | ( | ModuleFile & | Mod | ) |
Definition at line 6278 of file ASTReader.cpp.
References clang::serialization::ModuleFile::FileSortedDecls, and clang::serialization::ModuleFile::NumFileSortedDecls.
Referenced by clang::index::indexModuleFile().
|
overridevirtual |
Retrieve the module import location and module name for the given source manager entry ID.
Implements clang::ExternalSLocEntrySource.
Definition at line 1786 of file ASTReader.cpp.
References clang::serialization::ModuleFile::ImportLoc, clang::serialization::ModuleFile::isModule(), and clang::serialization::ModuleFile::ModuleName.
|
inline |
Retrieve the module manager.
Definition at line 1795 of file ASTReader.h.
Referenced by clang::FrontendAction::BeginSourceFile(), clang::DumpModuleInfoAction::ExecuteAction(), getLocalModuleFile(), getModuleFileID(), and clang::PCHValidator::ReadDiagnosticOptions().
|
inline |
Definition at line 1796 of file ASTReader.h.
|
overridevirtual |
Returns the number of selectors known to the external AST source.
The default implementation of this method is a no-op.
Reimplemented from clang::ExternalASTSource.
Definition at line 9272 of file ASTReader.cpp.
References getTotalNumSelectors().
|
inline |
Retrieve the name of the original source file name for the primary module file.
Definition at line 1803 of file ASTReader.h.
References clang::serialization::ModuleManager::getPrimaryModule(), and clang::serialization::ModuleFile::OriginalSourceFileName.
Referenced by AddImplicitIncludePCH(), and createInvocationForMigration().
|
static |
Retrieve the name of the original source file name directly from the AST file, without actually loading the AST file.
Definition at line 5320 of file ASTReader.cpp.
References clang::serialization::CONTROL_BLOCK_ID, doesntStartWithASTFileMagic(), clang::PCHContainerReader::ExtractPCH(), clang::FileManager::getBufferForFile(), clang::serialization::ORIGINAL_FILE, clang::DiagnosticsEngine::Report(), and SkipCursorToBlock().
ModuleFile * ASTReader::getOwningModuleFile | ( | const Decl * | D | ) | const |
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a module file.
Definition at line 7772 of file ASTReader.cpp.
References D, clang::Decl::getGlobalID(), and clang::Decl::isFromASTFile().
Referenced by clang::ASTDeclWriter::AddFirstDeclFromEachModule(), and ReadLateParsedTemplates().
ModuleFile * ASTReader::getOwningModuleFile | ( | GlobalDeclID | ID | ) | const |
Definition at line 7761 of file ASTReader.cpp.
References clang::NUM_PREDEF_DECL_IDS.
|
inline |
Retrieve the preprocessor.
Definition at line 1799 of file ASTReader.h.
Referenced by DecodeIdentifierInfo(), clang::DumpModuleInfoAction::ExecuteAction(), clang::index::indexModuleFile(), and isInterestingIdentifier().
|
inline |
Retrieve the semantic analysis object used to analyze the translation unit in which the precompiled header is being imported.
Definition at line 2415 of file ASTReader.h.
Referenced by ReadMethodPool().
|
overridevirtual |
Get the index ID for the loaded SourceLocation offset.
Implements clang::ExternalSLocEntrySource.
Definition at line 1566 of file ASTReader.cpp.
References clang::Invalid, and clang::serialization::ModuleFile::LocalNumSLocEntries.
|
overridevirtual |
Return a descriptor for the corresponding module.
Reimplemented from clang::ExternalASTSource.
Definition at line 9214 of file ASTReader.cpp.
References clang::FileName, clang::serialization::ModuleFile::FileName, clang::serialization::ModuleManager::getPrimaryModule(), getSubmodule(), clang::serialization::ModuleFile::OriginalSourceFileName, clang::serialization::ModuleManager::pch_modules(), and clang::serialization::ModuleFile::Signature.
SourceLocation ASTReader::getSourceLocationForDeclID | ( | GlobalDeclID | ID | ) |
Returns the source location for the decl ID
.
Definition at line 7779 of file ASTReader.cpp.
References D, clang::Decl::getLocation(), Loc, and clang::NUM_PREDEF_DECL_IDS.
|
inline |
Definition at line 1622 of file ASTReader.h.
Module * ASTReader::getSubmodule | ( | serialization::SubmoduleID | GlobalID | ) |
Retrieve the submodule that corresponds to a global submodule ID.
Definition at line 9166 of file ASTReader.cpp.
References clang::serialization::NUM_PREDEF_SUBMODULE_IDS.
Referenced by getModule(), getSourceDescriptor(), clang::ASTRecordReader::getSubmodule(), clang::ASTDeclReader::UpdateDecl(), and clang::ASTDeclReader::VisitDecl().
|
inline |
Returns the suggested contents of the predefines buffer, which contains a (typically-empty) subset of the predefines build prior to including the precompiled header.
Definition at line 1839 of file ASTReader.h.
SwitchCase * ASTReader::getSwitchCaseWithID | ( | unsigned | ID | ) |
Retrieve the switch-case statement with the given ID.
Definition at line 9628 of file ASTReader.cpp.
Referenced by clang::ASTRecordReader::getSwitchCaseWithID().
|
inline |
Returns the number of declarations found in the chain.
Definition at line 1886 of file ASTReader.h.
|
inline |
Returns the number of identifiers found in the chain.
Definition at line 1871 of file ASTReader.h.
|
inline |
Returns the number of macros found in the chain.
Definition at line 1876 of file ASTReader.h.
|
inline |
Returns the number of preprocessed entities known to the AST reader.
Definition at line 1902 of file ASTReader.h.
References clang::Result.
|
inline |
Returns the number of selectors found in the chain.
Definition at line 1896 of file ASTReader.h.
Referenced by GetNumExternalSelectors().
|
inline |
Returns the number of source locations found in the chain.
Definition at line 1866 of file ASTReader.h.
|
inline |
Returns the number of submodules known.
Definition at line 1891 of file ASTReader.h.
Referenced by clang::DumpModuleInfoAction::ExecuteAction().
|
inline |
Returns the number of types found in the chain.
Definition at line 1881 of file ASTReader.h.
QualType ASTReader::GetType | ( | serialization::TypeID | ID | ) |
Resolve a type ID into a type, potentially building a new type.
Definition at line 7210 of file ASTReader.cpp.
References clang::ASTContext::AccumTy, clang::ASTContext::ARCUnbridgedCastTy, clang::ASTContext::ArraySectionTy, clang::ASTContext::BFloat16Ty, clang::ASTContext::BoolTy, clang::ASTContext::BoundMemberTy, clang::ASTContext::BuiltinFnTy, clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::Char8Ty, clang::ASTContext::CharTy, clang::ASTContext::DependentTy, clang::ASTContext::DoubleTy, clang::Qualifiers::FastMask, clang::ASTContext::Float128Ty, clang::ASTContext::Float16Ty, clang::ASTContext::FloatTy, clang::ASTContext::FractTy, clang::serialization::TypeIdx::fromTypeID(), clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoRRefDeductType(), getIndexForTypeID(), clang::ASTContext::HalfTy, clang::ASTContext::Ibm128Ty, clang::ASTContext::IncompleteMatrixIdxTy, clang::ASTContext::Int128Ty, clang::ASTContext::IntTy, isPredefinedType(), clang::ASTContext::LongAccumTy, clang::ASTContext::LongDoubleTy, clang::ASTContext::LongFractTy, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::ASTContext::NullPtrTy, clang::ASTContext::ObjCBuiltinClassTy, clang::ASTContext::ObjCBuiltinIdTy, clang::ASTContext::ObjCBuiltinSelTy, clang::ASTContext::OCLClkEventTy, clang::ASTContext::OCLEventTy, clang::ASTContext::OCLQueueTy, clang::ASTContext::OCLReserveIDTy, clang::ASTContext::OCLSamplerTy, clang::ASTContext::OMPArrayShapingTy, clang::ASTContext::OMPIteratorTy, clang::ASTContext::OverloadTy, clang::serialization::PREDEF_TYPE_ACCUM_ID, clang::serialization::PREDEF_TYPE_ARC_UNBRIDGED_CAST, clang::serialization::PREDEF_TYPE_ARRAY_SECTION, clang::serialization::PREDEF_TYPE_AUTO_DEDUCT, clang::serialization::PREDEF_TYPE_AUTO_RREF_DEDUCT, clang::serialization::PREDEF_TYPE_BFLOAT16_ID, clang::serialization::PREDEF_TYPE_BOOL_ID, clang::serialization::PREDEF_TYPE_BOUND_MEMBER, clang::serialization::PREDEF_TYPE_BUILTIN_FN, clang::serialization::PREDEF_TYPE_CHAR16_ID, clang::serialization::PREDEF_TYPE_CHAR32_ID, clang::serialization::PREDEF_TYPE_CHAR8_ID, clang::serialization::PREDEF_TYPE_CHAR_S_ID, clang::serialization::PREDEF_TYPE_CHAR_U_ID, clang::serialization::PREDEF_TYPE_CLK_EVENT_ID, clang::serialization::PREDEF_TYPE_DEPENDENT_ID, clang::serialization::PREDEF_TYPE_DOUBLE_ID, clang::serialization::PREDEF_TYPE_EVENT_ID, clang::serialization::PREDEF_TYPE_FLOAT128_ID, clang::serialization::PREDEF_TYPE_FLOAT16_ID, clang::serialization::PREDEF_TYPE_FLOAT_ID, clang::serialization::PREDEF_TYPE_FRACT_ID, clang::serialization::PREDEF_TYPE_HALF_ID, clang::serialization::PREDEF_TYPE_IBM128_ID, clang::serialization::PREDEF_TYPE_INCOMPLETE_MATRIX_IDX, clang::serialization::PREDEF_TYPE_INT128_ID, clang::serialization::PREDEF_TYPE_INT_ID, clang::serialization::PREDEF_TYPE_LAST_ID, clang::serialization::PREDEF_TYPE_LONG_ACCUM_ID, clang::serialization::PREDEF_TYPE_LONG_FRACT_ID, clang::serialization::PREDEF_TYPE_LONG_ID, clang::serialization::PREDEF_TYPE_LONGDOUBLE_ID, clang::serialization::PREDEF_TYPE_LONGLONG_ID, clang::serialization::PREDEF_TYPE_NULL_ID, clang::serialization::PREDEF_TYPE_NULLPTR_ID, clang::serialization::PREDEF_TYPE_OBJC_CLASS, clang::serialization::PREDEF_TYPE_OBJC_ID, clang::serialization::PREDEF_TYPE_OBJC_SEL, clang::serialization::PREDEF_TYPE_OMP_ARRAY_SHAPING, clang::serialization::PREDEF_TYPE_OMP_ITERATOR, clang::serialization::PREDEF_TYPE_OVERLOAD_ID, clang::serialization::PREDEF_TYPE_PSEUDO_OBJECT, clang::serialization::PREDEF_TYPE_QUEUE_ID, clang::serialization::PREDEF_TYPE_RESERVE_ID_ID, clang::serialization::PREDEF_TYPE_SAMPLER_ID, clang::serialization::PREDEF_TYPE_SAT_ACCUM_ID, clang::serialization::PREDEF_TYPE_SAT_FRACT_ID, clang::serialization::PREDEF_TYPE_SAT_LONG_ACCUM_ID, clang::serialization::PREDEF_TYPE_SAT_LONG_FRACT_ID, clang::serialization::PREDEF_TYPE_SAT_SHORT_ACCUM_ID, clang::serialization::PREDEF_TYPE_SAT_SHORT_FRACT_ID, clang::serialization::PREDEF_TYPE_SAT_UACCUM_ID, clang::serialization::PREDEF_TYPE_SAT_UFRACT_ID, clang::serialization::PREDEF_TYPE_SAT_ULONG_ACCUM_ID, clang::serialization::PREDEF_TYPE_SAT_ULONG_FRACT_ID, clang::serialization::PREDEF_TYPE_SAT_USHORT_ACCUM_ID, clang::serialization::PREDEF_TYPE_SAT_USHORT_FRACT_ID, clang::serialization::PREDEF_TYPE_SCHAR_ID, clang::serialization::PREDEF_TYPE_SHORT_ACCUM_ID, clang::serialization::PREDEF_TYPE_SHORT_FRACT_ID, clang::serialization::PREDEF_TYPE_SHORT_ID, clang::serialization::PREDEF_TYPE_UACCUM_ID, clang::serialization::PREDEF_TYPE_UCHAR_ID, clang::serialization::PREDEF_TYPE_UFRACT_ID, clang::serialization::PREDEF_TYPE_UINT128_ID, clang::serialization::PREDEF_TYPE_UINT_ID, clang::serialization::PREDEF_TYPE_ULONG_ACCUM_ID, clang::serialization::PREDEF_TYPE_ULONG_FRACT_ID, clang::serialization::PREDEF_TYPE_ULONG_ID, clang::serialization::PREDEF_TYPE_ULONGLONG_ID, clang::serialization::PREDEF_TYPE_UNKNOWN_ANY, clang::serialization::PREDEF_TYPE_UNRESOLVED_TEMPLATE, clang::serialization::PREDEF_TYPE_USHORT_ACCUM_ID, clang::serialization::PREDEF_TYPE_USHORT_FRACT_ID, clang::serialization::PREDEF_TYPE_USHORT_ID, clang::serialization::PREDEF_TYPE_VOID_ID, clang::serialization::PREDEF_TYPE_WCHAR_ID, clang::ASTContext::PseudoObjectTy, clang::ASTContext::SatAccumTy, clang::ASTContext::SatFractTy, clang::ASTContext::SatLongAccumTy, clang::ASTContext::SatLongFractTy, clang::ASTContext::SatShortAccumTy, clang::ASTContext::SatShortFractTy, clang::ASTContext::SatUnsignedAccumTy, clang::ASTContext::SatUnsignedFractTy, clang::ASTContext::SatUnsignedLongAccumTy, clang::ASTContext::SatUnsignedLongFractTy, clang::ASTContext::SatUnsignedShortAccumTy, clang::ASTContext::SatUnsignedShortFractTy, clang::ASTContext::ShortAccumTy, clang::ASTContext::ShortFractTy, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::T, clang::ASTContext::UnknownAnyTy, clang::ASTContext::UnresolvedTemplateTy, clang::ASTContext::UnsignedAccumTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedFractTy, clang::ASTContext::UnsignedInt128Ty, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongAccumTy, clang::ASTContext::UnsignedLongFractTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortAccumTy, clang::ASTContext::UnsignedShortFractTy, clang::ASTContext::UnsignedShortTy, clang::ASTContext::VoidTy, and clang::ASTContext::WCharTy.
Referenced by clang::ASTDeclReader::Visit(), clang::ASTDeclReader::VisitFunctionDecl(), and clang::ASTDeclReader::VisitVarDeclImpl().
|
overridevirtual |
Reimplemented from clang::ExternalASTSource.
Definition at line 9232 of file ASTReader.cpp.
References clang::ExternalASTSource::EK_Always, clang::ExternalASTSource::EK_Never, and clang::ExternalASTSource::EK_ReplyHazy.
|
inline |
Determine whether this AST reader has a global index.
Definition at line 1758 of file ASTReader.h.
void ASTReader::InitializeContext | ( | ) |
Initializes the ASTContext.
Definition at line 5124 of file ASTReader.cpp.
References clang::Module::AllVisible, clang::File, clang::Type::getAs(), clang::ASTContext::getDiagnostics(), clang::ASTContext::getTranslationUnitDecl(), clang::QualType::isNull(), clang::serialization::NumSpecialTypeIDs, clang::PREDEF_DECL_TRANSLATION_UNIT_ID, clang::ASTContext::setCFConstantStringType(), clang::ASTContext::setcudaConfigureCallDecl(), clang::ASTContext::setFILEDecl(), clang::ASTContext::setjmp_bufDecl(), clang::ASTContext::setsigjmp_bufDecl(), clang::ASTContext::setucontext_tDecl(), clang::serialization::SPECIAL_TYPE_CF_CONSTANT_STRING, clang::serialization::SPECIAL_TYPE_FILE, clang::serialization::SPECIAL_TYPE_JMP_BUF, clang::serialization::SPECIAL_TYPE_OBJC_CLASS_REDEFINITION, clang::serialization::SPECIAL_TYPE_OBJC_ID_REDEFINITION, clang::serialization::SPECIAL_TYPE_OBJC_SEL_REDEFINITION, clang::serialization::SPECIAL_TYPE_SIGJMP_BUF, and clang::serialization::SPECIAL_TYPE_UCONTEXT_T.
|
overridevirtual |
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8374 of file ASTReader.cpp.
References clang::Sema::addExternalSource(), clang::FPOptionsOverride::applyOverrides(), D, and clang::FPOptionsOverride::getFromOpaqueInt().
|
static |
Determine whether the given AST file is acceptable to load into a translation unit with the given language and target options.
Definition at line 5734 of file ASTReader.cpp.
References Filename.
Referenced by clang::FrontendAction::BeginSourceFile().
bool ASTReader::isDeclIDFromModule | ( | GlobalDeclID | ID, |
ModuleFile & | M | ||
) | const |
Returns true if global DeclID ID
originated from module M
.
Definition at line 7752 of file ASTReader.cpp.
References clang::serialization::ModuleFile::Index, and clang::NUM_PREDEF_DECL_IDS.
bool ASTReader::isGlobalIndexUnavailable | ( | ) | const |
Determine whether we tried to load the global index, but failed, e.g., because it is out-of-date or does not exist.
Definition at line 4402 of file ASTReader.cpp.
|
overridevirtual |
Optionally returns true or false if the preallocated preprocessed entity with index Index
came from file FID
.
Optionally returns true or false if the preallocated preprocessed entity with index.
Reimplemented from clang::ExternalPreprocessingRecordSource.
Definition at line 6518 of file ASTReader.cpp.
References clang::serialization::PPEntityOffset::getBegin(), clang::FileID::isInvalid(), clang::SourceLocation::isInvalid(), Loc, and clang::serialization::ModuleFile::PreprocessedEntityOffsets.
|
inline |
Definition at line 2460 of file ASTReader.h.
bool ASTReader::loadGlobalIndex | ( | ) |
Attempts to load the global index.
Definition at line 4377 of file ASTReader.cpp.
References clang::GlobalModuleIndex::readIndex(), and clang::Result.
Referenced by getIdentifiers().
void ASTReader::LoadSelector | ( | Selector | Sel | ) |
Load a selector from disk, registering its ID if it exists.
Definition at line 8977 of file ASTReader.cpp.
References ReadMethodPool().
Referenced by clang::ASTWriter::getSelectorRef().
void ASTReader::makeModuleVisible | ( | Module * | Mod, |
Module::NameVisibilityKind | NameVisibility, | ||
SourceLocation | ImportLoc | ||
) |
Make the entities in the given module and any of its (non-explicit) submodules visible to name lookup.
Mod | The module whose names should be made visible. |
NameVisibility | The level of visibility to give the names in the module. Visibility can only be increased over time. |
ImportLoc | The location at which the import occurs. |
Definition at line 4313 of file ASTReader.cpp.
References E, clang::Module::getExportedModules(), clang::Module::isUnimportable(), clang::Module::NameVisibility, and Visited.
void ASTReader::makeNamesVisible | ( | const HiddenNames & | Names, |
Module * | Owner | ||
) |
Make the names within this set of hidden names visible.
Definition at line 4299 of file ASTReader.cpp.
References D, clang::Module::Hidden, clang::Decl::isUnconditionallyVisible(), moveMethodToBackOfGlobalList(), clang::Module::NameVisibility, and clang::Decl::setVisibleDespiteOwningModule().
LocalDeclID ASTReader::mapGlobalIDToModuleFileGlobalID | ( | ModuleFile & | M, |
GlobalDeclID | GlobalID | ||
) |
Map a global declaration ID into the declaration ID used to refer to this declaration within the given module fule.
Definition at line 7962 of file ASTReader.cpp.
References clang::LocalDeclID::get(), clang::DeclIDBase::getLocalDeclIndex(), clang::DeclIDBase::getRawValue(), clang::serialization::ModuleFile::ModuleOffsetMap, clang::NUM_PREDEF_DECL_IDS, and clang::serialization::ModuleFile::TransitiveImports.
void ASTReader::markIdentifierUpToDate | ( | const IdentifierInfo * | II | ) |
Note that this identifier is up-to-date.
Definition at line 2321 of file ASTReader.cpp.
Note that MergedDef is a redefinition of the canonical definition Def, so Def should be visible whenever MergedDef is.
We've merged the definition MergedDef
into the existing definition Def
.
Ensure that Def
is made visible whenever MergedDef
is made visible.
Definition at line 4362 of file ASTReader.cpp.
References clang::Decl::getImportedOwningModule(), clang::Decl::isUnconditionallyVisible(), and clang::Decl::setVisibleDespiteOwningModule().
Referenced by clang::ASTDeclReader::attachPreviousDeclImpl(), clang::ASTDeclMerger::MergeDefinitionData(), clang::ASTDeclReader::VisitEnumDecl(), and clang::ASTDeclReader::VisitRecordDecl().
|
overridevirtual |
Print some statistics about AST usage.
Reimplemented from clang::ExternalASTSource.
Definition at line 8236 of file ASTReader.cpp.
References dump().
|
inline |
Read a AlignPackInfo from raw form.
Definition at line 2253 of file ASTReader.h.
References clang::Sema::AlignPackInfo::getFromRawEncoding().
ASTReader::ASTReadResult ASTReader::ReadAST | ( | StringRef | FileName, |
ModuleKind | Type, | ||
SourceLocation | ImportLoc, | ||
unsigned | ClientLoadCapabilities, | ||
ModuleFile ** | NewLoadedModuleFile = nullptr |
||
) |
Load the AST file designated by the given file name.
FileName | The name of the AST file to load. |
Type | The kind of AST being loaded, e.g., PCH, module, main file, or preamble. |
ImportLoc | the location where the module file will be considered as imported from. For non-module AST types it should be invalid. |
ClientLoadCapabilities | The set of client load-failure capabilities, represented as a bitset of the enumerators of LoadFailureCapabilities. |
LoadedModuleFile | The optional out-parameter refers to the new loaded modules. In case the module specified by FileName is already loaded, the module file pointer referred by NewLoadedModuleFile wouldn't change. Otherwise if the AST file get loaded successfully, NewLoadedModuleFile would refer to the address of the new loaded top level module. The state of NewLoadedModuleFile is unspecified if the AST file isn't loaded successfully. |
Definition at line 4468 of file ASTReader.cpp.
References clang::HeaderSearchOptions::BuildSessionTimestamp, clang::Data, clang::serialization::ModuleFile::DidReadTopLevelSubmodule, clang::serialization::ModuleFile::DirectImportLoc, clang::serialization::EXTENSION_BLOCK_ID, clang::FileName, clang::serialization::ModuleFile::FileName, clang::serialization::ModuleFile::GlobalBitOffset, Id, clang::serialization::ModuleFile::IdentifierTableData, clang::serialization::ModuleFile::ImportLoc, clang::serialization::ModuleFile::isModule(), clang::FileID::isValid(), markIdentifierFromAST(), clang::Module::Conflict::Message, clang::serialization::MK_ImplicitModule, clang::serialization::MK_MainFile, clang::serialization::MK_PCH, clang::serialization::MK_Preamble, clang::serialization::ModuleFile::ModuleName, clang::HeaderSearchOptions::ModulesValidateOncePerBuildSession, clang::serialization::ModuleFile::OriginalSourceFileID, clang::Module::Conflict::Other, clang::serialization::ModuleFile::PreloadIdentifierOffsets, clang::serialization::reader::ASTIdentifierLookupTrait::ReadIdentifierID(), clang::serialization::reader::ASTIdentifierLookupTraitBase::ReadKey(), clang::serialization::reader::ASTIdentifierLookupTraitBase::ReadKeyDataLength(), clang::IdentifierInfo::setOutOfDate(), clang::serialization::ModuleFile::SizeInBits, SkipCursorToBlock(), clang::serialization::ModuleFile::Stream, clang::Success, clang::Unresolved, and updateModuleTimestamp().
|
static |
Read the control block for the named AST file.
Definition at line 5440 of file ASTReader.cpp.
References clang::serialization::CONTROL_BLOCK_ID, doesntStartWithASTFileMagic(), clang::serialization::EXTENSION_BLOCK_ID, clang::serialization::EXTENSION_METADATA, clang::PCHContainerReader::ExtractPCH(), Filename, clang::FileManager::getBufferForFile(), clang::serialization::IMPORTS, clang::serialization::INPUT_FILE, clang::serialization::INPUT_FILE_HASH, clang::serialization::INPUT_FILE_OFFSETS, clang::serialization::INPUT_FILES_BLOCK_ID, clang::InMemoryModuleCache::lookupPCM(), clang::serialization::METADATA, clang::serialization::MODULE_DIRECTORY, clang::serialization::MODULE_MAP_FILE, clang::serialization::MODULE_NAME, clang::ASTReaderListener::needsImportVisitation(), clang::ASTReaderListener::needsInputFileVisitation(), clang::ASTReaderListener::needsSystemInputFileVisitation(), clang::serialization::OPTIONS_BLOCK_ID, parseModuleFileExtensionMetadata(), Path, clang::ASTReaderListener::ReadFullVersionInformation(), clang::ASTReaderListener::readModuleFileExtension(), clang::ASTReaderListener::ReadModuleMapFile(), clang::ASTReaderListener::ReadModuleName(), clang::ASTFileSignature::size, SkipCursorToBlock(), clang::Success, clang::serialization::VERSION_MAJOR, clang::ASTReaderListener::visitImport(), and clang::ASTReaderListener::visitInputFile().
Referenced by collectIncludePCH(), and clang::DumpModuleInfoAction::ExecuteAction().
|
static |
Definition at line 9532 of file ASTReader.cpp.
|
static |
ReadBlockAbbrevs - Enter a subblock of the specified BlockID with the specified cursor.
Enter a subblock of the specified BlockID with the specified cursor.
Read the abbreviations that are at the top of the block and then leave the cursor pointing into the block.
Definition at line 1823 of file ASTReader.cpp.
|
overridevirtual |
Loads comments ranges.
Reimplemented from clang::ExternalASTSource.
Definition at line 9637 of file ASTReader.cpp.
References clang::C, clang::ASTContext::Comments, clang::serialization::COMMENTS_RAW_COMMENT, CommentsCursors, E, getContext(), clang::SourceManager::getDecomposedLoc(), clang::SourceLocation::isValid(), Loc, and ReadSourceRange().
CXXTemporary * ASTReader::ReadCXXTemporary | ( | ModuleFile & | F, |
const RecordData & | Record, | ||
unsigned & | Idx | ||
) |
Definition at line 9584 of file ASTReader.cpp.
References clang::CXXTemporary::Create(), and getContext().
Referenced by clang::ASTRecordReader::readCXXTemporary().
|
inline |
Reads a declaration from the given position in a record in the given module.
Definition at line 1982 of file ASTReader.h.
References GetDecl(), and ReadDeclID().
Referenced by clang::ASTRecordReader::readDecl(), and ReadLateParsedTemplates().
|
inline |
Reads a declaration from the given position in a record in the given module.
Definition at line 1992 of file ASTReader.h.
References GetDecl(), and ReadDeclID().
Referenced by clang::ASTRecordReader::readDeclAs().
GlobalDeclID ASTReader::ReadDeclID | ( | ModuleFile & | F, |
const RecordDataImpl & | Record, | ||
unsigned & | Idx | ||
) |
Reads a declaration ID from the given position in a record in the given module.
Definition at line 7991 of file ASTReader.cpp.
References clang::LocalDeclID::get().
Referenced by ReadDecl(), ReadDeclAs(), and clang::ASTRecordReader::readDeclID().
|
overridevirtual |
Read the set of decls to be checked for deferred diags.
The external source should append its own potentially emitted function and variable decls which may cause deferred diags. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8866 of file ASTReader.cpp.
|
overridevirtual |
Read the set of macros defined by this external macro source.
Implements clang::ExternalPreprocessorSource.
Definition at line 2178 of file ASTReader.cpp.
References E, clang::IdentifierInfo::isOutOfDate(), clang::serialization::PP_MACRO_FUNCTION_LIKE, clang::serialization::PP_MACRO_OBJECT_LIKE, and clang::serialization::PP_TOKEN.
|
overridevirtual |
Read the set of delegating constructors known to the external Sema source.
The external source should append its own delegating constructors to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8833 of file ASTReader.cpp.
Expr * ASTReader::ReadExpr | ( | ModuleFile & | F | ) |
Reads an expression.
Definition at line 2859 of file ASTReaderStmt.cpp.
References ReadStmt().
Referenced by clang::ASTRecordReader::readExpr().
|
overridevirtual |
Read the set of ext_vector type declarations known to the external Sema source.
The external source should append its own ext_vector type declarations to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8844 of file ASTReader.cpp.
|
inline |
|
inline |
Definition at line 2166 of file ASTReader.h.
References DecodeIdentifierInfo(), and getGlobalIdentifierID().
Referenced by clang::ASTRecordReader::readIdentifier().
|
overridevirtual |
Load the set of namespaces that are known to the external source, which will be used during typo correction.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8774 of file ASTReader.cpp.
References GetDecl().
|
overridevirtual |
Read the set of late parsed template functions for this source.
The external source should insert its own late parsed template functions into the map. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same map entries repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8937 of file ASTReader.cpp.
References clang::FPOptions::getFromOpaqueInt(), getOwningModuleFile(), LT, ReadDecl(), ReadToken(), and clang::T.
MacroInfo * ASTReader::ReadMacroRecord | ( | ModuleFile & | F, |
uint64_t | Offset | ||
) |
Reads the macro record located at the given offset.
Definition at line 1903 of file ASTReader.cpp.
References clang::MacroInfo::allocateTokens(), Loc, clang::serialization::ModuleFile::MacroCursor, clang::serialization::PP_MACRO_DIRECTIVE_HISTORY, clang::serialization::PP_MACRO_FUNCTION_LIKE, clang::serialization::PP_MACRO_OBJECT_LIKE, clang::serialization::PP_MODULE_MACRO, clang::serialization::PP_TOKEN, clang::MacroInfo::setDefinitionEndLoc(), clang::MacroInfo::setHasCommaPasting(), clang::MacroInfo::setIsC99Varargs(), clang::MacroInfo::setIsFunctionLike(), clang::MacroInfo::setIsGNUVarargs(), clang::MacroInfo::setIsUsed(), clang::MacroInfo::setParameterList(), and clang::MacroInfo::setUsedForHeaderGuard().
Referenced by getMacro().
|
overridevirtual |
Load the contents of the global method pool for a given selector.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8729 of file ASTReader.cpp.
References addMethodsToPool(), clang::serialization::ReadMethodPoolVisitor::factoryHasMoreThanOneDecl(), clang::serialization::ReadMethodPoolVisitor::getFactoryBits(), clang::serialization::ReadMethodPoolVisitor::getFactoryMethods(), clang::ExternalASTSource::getGeneration(), clang::serialization::ReadMethodPoolVisitor::getInstanceBits(), clang::serialization::ReadMethodPoolVisitor::getInstanceMethods(), getSema(), clang::SemaObjC::GlobalMethodPool::insert(), clang::serialization::ReadMethodPoolVisitor::instanceHasMoreThanOneDecl(), clang::SemaObjC::MethodPool, clang::Sema::ObjC(), and clang::serialization::ModuleManager::visit().
Referenced by LoadSelector(), and updateOutOfDateSelector().
|
overridevirtual |
Reimplemented from clang::ExternalSemaSource.
Definition at line 8796 of file ASTReader.cpp.
References clang::C, GetDecl(), and clang::SourceLocation::getFromRawEncoding().
std::string ASTReader::ReadPath | ( | ModuleFile & | F, |
const RecordData & | Record, | ||
unsigned & | Idx | ||
) |
Definition at line 9557 of file ASTReader.cpp.
References Filename, ReadString(), and ResolveImportedPath().
Referenced by clang::ASTRecordReader::readPath().
std::string ASTReader::ReadPath | ( | StringRef | BaseDirectory, |
const RecordData & | Record, | ||
unsigned & | Idx | ||
) |
Definition at line 9564 of file ASTReader.cpp.
References Filename, ReadString(), and ResolveImportedPath().
|
overridevirtual |
Read the set of pending instantiations known to the external Sema source.
The external source should append its own pending instantiations to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same instantiations repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8925 of file ASTReader.cpp.
References D, GetDecl(), clang::SourceLocation::getFromRawEncoding(), and Loc.
void ASTReader::ReadPragmaDiagnosticMappings | ( | DiagnosticsEngine & | Diag | ) |
Definition at line 6577 of file ASTReader.cpp.
References clang::DiagnosticMapping::deserialize(), Diag(), clang::DiagnosticMapping::isErrorOrFatal(), clang::serialization::ModuleFile::isModule(), clang::DiagnosticMapping::isPragma(), clang::FileID::isValid(), clang::serialization::ModuleFile::Kind, clang::serialization::MK_ImplicitModule, clang::serialization::ModuleFile::OriginalSourceFileID, clang::serialization::ModuleFile::PragmaDiagMappings, clang::DiagnosticMapping::setSeverity(), clang::DiagnosticMapping::setUpgradedFromWarning(), clang::T, clang::diag::Warning, and clang::DiagnosticMapping::wasUpgradedFromWarning().
|
overridevirtual |
Read a preallocated preprocessed entity from the external source.
Implements clang::ExternalPreprocessingRecordSource.
Definition at line 6299 of file ASTReader.cpp.
References clang::File, clang::serialization::PPEntityOffset::getBegin(), clang::serialization::PPEntityOffset::getEnd(), clang::serialization::PPEntityOffset::getOffset(), clang::serialization::ModuleFile::MacroOffsetsBase, clang::serialization::PPD_INCLUSION_DIRECTIVE, clang::serialization::PPD_MACRO_DEFINITION, clang::serialization::PPD_MACRO_EXPANSION, clang::serialization::ModuleFile::PreprocessedEntityOffsets, clang::serialization::ModuleFile::PreprocessorDetailCursor, and Range.
|
overridevirtual |
Read the set of referenced selectors known to the external Sema source.
The external source should append its own referenced selectors to the given vector of selectors. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same selectors repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8876 of file ASTReader.cpp.
References DecodeSelector(), and clang::SourceLocation::getFromRawEncoding().
|
inline |
Definition at line 2240 of file ASTReader.h.
References getLocalSelector().
Referenced by clang::ASTRecordReader::readSelector().
|
overridevirtual |
Read a preallocated skipped range from the external source.
Implements clang::ExternalPreprocessingRecordSource.
Definition at line 6285 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BasePreprocessedSkippedRangeID, clang::serialization::PPSkippedRange::getBegin(), clang::serialization::PPSkippedRange::getEnd(), clang::SourceRange::isValid(), clang::serialization::ModuleFile::PreprocessedSkippedRangeOffsets, and Range.
Read the source location entry with index ID.
Implements clang::ExternalSLocEntrySource.
Definition at line 1603 of file ASTReader.cpp.
References clang::SrcMgr::ContentCache::BufferOverridden, clang::SrcMgr::ContentCache::ContentsEntry, E, clang::File, clang::serialization::ModuleFile::FileSortedDecls, clang::SrcMgr::ContentCache::getBufferIfLoaded(), clang::serialization::InputFile::getFile(), clang::SourceLocation::isInvalid(), clang::serialization::ModuleFile::isModule(), clang::serialization::InputFile::isOverridden(), clang::serialization::ModuleFile::Kind, clang::serialization::MK_MainFile, clang::SrcMgr::ContentCache::OrigEntry, clang::Seq, clang::SrcMgr::FileInfo::setHasLineDirectives(), clang::serialization::ModuleFile::SLocEntryBaseID, clang::serialization::ModuleFile::SLocEntryBaseOffset, clang::serialization::ModuleFile::SLocEntryCursor, clang::serialization::ModuleFile::SLocEntryOffsets, clang::serialization::ModuleFile::SLocEntryOffsetsBase, clang::serialization::SM_SLOC_BUFFER_BLOB, clang::serialization::SM_SLOC_BUFFER_BLOB_COMPRESSED, clang::serialization::SM_SLOC_BUFFER_ENTRY, clang::serialization::SM_SLOC_EXPANSION_ENTRY, and clang::serialization::SM_SLOC_FILE_ENTRY.
llvm::Expected< SourceLocation::UIntTy > ASTReader::readSLocOffset | ( | ModuleFile * | F, |
unsigned | Index | ||
) |
Try to read the offset of the SLocEntry at the given index in the given module file.
Definition at line 1531 of file ASTReader.cpp.
References clang::serialization::ModuleFile::SLocEntryBaseOffset, clang::serialization::ModuleFile::SLocEntryCursor, clang::serialization::ModuleFile::SLocEntryOffsets, clang::serialization::ModuleFile::SLocEntryOffsetsBase, clang::serialization::SM_SLOC_BUFFER_ENTRY, clang::serialization::SM_SLOC_EXPANSION_ENTRY, and clang::serialization::SM_SLOC_FILE_ENTRY.
|
inline |
Read a source location from raw form.
Definition at line 2268 of file ASTReader.h.
References clang::SourceManager::isLoadedSourceLocation(), Loc, clang::serialization::ModuleFile::ModuleOffsetMap, ReadUntranslatedSourceLocation(), clang::Seq, clang::serialization::ModuleFile::TransitiveImports, and TranslateSourceLocation().
Referenced by clang::ASTRecordReader::readSourceLocation(), ReadSourceLocation(), and ReadSourceRange().
|
inline |
Read a source location.
Definition at line 2300 of file ASTReader.h.
References ReadSourceLocation(), and clang::Seq.
SourceRange ASTReader::ReadSourceRange | ( | ModuleFile & | F, |
const RecordData & | Record, | ||
unsigned & | Idx, | ||
LocSeq * | Seq = nullptr |
||
) |
Read a source range.
Definition at line 9525 of file ASTReader.cpp.
References ReadSourceLocation(), and clang::Seq.
Referenced by ReadComments(), and clang::ASTRecordReader::readSourceRange().
Stmt * ASTReader::ReadStmt | ( | ModuleFile & | F | ) |
Reads a statement.
Definition at line 2845 of file ASTReaderStmt.cpp.
References ReadSubStmt().
Referenced by ReadExpr(), and clang::ASTRecordReader::readStmt().
|
static |
Definition at line 9550 of file ASTReader.cpp.
References clang::Result.
Referenced by ReadPath(), and clang::ASTRecordReader::readString().
Expr * ASTReader::ReadSubExpr | ( | ) |
Reads a sub-expression operand during statement reading.
Definition at line 2863 of file ASTReaderStmt.cpp.
References ReadSubStmt().
Referenced by clang::ASTRecordReader::readSubExpr().
|
inline |
Reads a sub-statement operand during statement reading.
Definition at line 2358 of file ASTReader.h.
Referenced by ReadStmt(), ReadSubExpr(), and clang::ASTRecordReader::readSubStmt().
|
overridevirtual |
Read the set of tentative definitions known to the external Sema source.
The external source should append its own tentative definitions to the given vector of tentative definitions. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8812 of file ASTReader.cpp.
References GetDecl().
Token ASTReader::ReadToken | ( | ModuleFile & | M, |
const RecordDataImpl & | Record, | ||
unsigned & | Idx | ||
) |
Reads a token out of a record.
Definition at line 1850 of file ASTReader.cpp.
References clang::Sema::PragmaPackInfo::Action, clang::Token::getKind(), clang::Token::isAnnotation(), clang::PragmaLoopHintInfo::PragmaName, clang::Token::setAnnotationEndLoc(), clang::Token::setAnnotationValue(), clang::Token::setFlag(), clang::Token::setIdentifierInfo(), clang::Token::setKind(), clang::Token::setLength(), clang::Token::setLocation(), and clang::Token::startToken().
Referenced by ReadLateParsedTemplates(), and clang::ASTRecordReader::readToken().
|
inline |
Read a type from the current position in the given record, which was read from the given AST file.
Definition at line 1922 of file ASTReader.h.
References getLocalType().
Referenced by clang::ASTRecordReader::readType().
|
overridevirtual |
Load the set of used but not defined functions or variables with internal linkage, or used but not defined internal functions.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8785 of file ASTReader.cpp.
References D, GetDecl(), clang::SourceLocation::getFromRawEncoding(), and Loc.
|
inline |
Read a source location from raw form and return it in its originating module file's source location space.
Definition at line 2262 of file ASTReader.h.
References clang::SourceLocationEncoding::decode(), and clang::Seq.
Referenced by ReadSourceLocation().
|
overridevirtual |
Read the set of unused file-scope declarations known to the external Sema source.
The external source should append its own unused, filed-scope to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8822 of file ASTReader.cpp.
|
overridevirtual |
Read the set of potentially unused typedefs known to the source.
The external source should append its own potentially unused local typedefs to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8854 of file ASTReader.cpp.
|
overridevirtual |
Read the set of used vtables known to the external Sema source.
The external source should append its own used vtables to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same vtables repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8912 of file ASTReader.cpp.
References clang::ExternalVTableUse::DefinitionRequired, GetDecl(), clang::SourceLocation::getFromRawEncoding(), clang::ExternalVTableUse::Location, and clang::ExternalVTableUse::Record.
|
static |
Read a version tuple.
Definition at line 9572 of file ASTReader.cpp.
Referenced by clang::ASTRecordReader::readVersionTuple().
|
overridevirtual |
Read the set of weak, undeclared identifiers known to the external Sema source.
The external source should append its own weak, undeclared identifiers to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same identifiers repeatedly.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8894 of file ASTReader.cpp.
References DecodeIdentifierInfo(), clang::SourceLocation::getFromRawEncoding(), and Loc.
void ASTReader::RecordSwitchCaseID | ( | SwitchCase * | SC, |
unsigned | ID | ||
) |
Record that the given ID maps to the given switch-case statement.
Definition at line 9621 of file ASTReader.cpp.
Referenced by clang::ASTRecordReader::recordSwitchCaseID().
|
inline |
Reset reader for a reload try.
Definition at line 1764 of file ASTReader.h.
void ASTReader::ResolveImportedPath | ( | ModuleFile & | M, |
std::string & | Filename | ||
) |
If we are loading a relocatable PCH or module file, and the filename is not an absolute path, add the system or module root to the beginning of the file name.
Definition at line 2758 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BaseDirectory, and Filename.
Referenced by ReadPath().
|
static |
Definition at line 2764 of file ASTReader.cpp.
References Filename.
void ASTReader::resolvePendingMacro | ( | IdentifierInfo * | II, |
const PendingMacroInfo & | PMInfo | ||
) |
Definition at line 2332 of file ASTReader.cpp.
References clang::serialization::ModuleFile::isModule(), Loc, clang::serialization::ModuleFile::MacroCursor, clang::serialization::ModuleFile::MacroOffsetsBase, clang::MacroDirective::MD_Define, clang::MacroDirective::MD_Undefine, clang::MacroDirective::MD_Visibility, clang::serialization::PP_MACRO_DIRECTIVE_HISTORY, clang::serialization::PP_MODULE_MACRO, and clang::MacroDirective::setPrevious().
void ASTReader::setDeserializationListener | ( | ASTDeserializationListener * | Listener, |
bool | TakeOwnership = false |
||
) |
Set the AST deserialization listener.
Definition at line 927 of file ASTReader.cpp.
void ASTReader::SetGloballyVisibleDecls | ( | IdentifierInfo * | II, |
const SmallVectorImpl< GlobalDeclID > & | DeclIDs, | ||
SmallVectorImpl< Decl * > * | Decls = nullptr |
||
) |
Set the globally-visible declarations associated with the given identifier.
If the AST reader is currently in a state where the given declaration IDs cannot safely be resolved, they are queued until it is safe to resolve them.
II | an IdentifierInfo that refers to one or more globally-visible declarations. |
DeclIDs | the set of declaration IDs with the name II that are visible at global scope. |
Decls | if non-null, this vector will be populated with the set of deserialized declarations. These declarations will not be pushed into scope. |
Definition at line 9007 of file ASTReader.cpp.
References D, GetDecl(), and PreloadedDeclIDs.
void ASTReader::SetIdentifierInfo | ( | serialization::IdentifierID | ID, |
IdentifierInfo * | II | ||
) |
Definition at line 8982 of file ASTReader.cpp.
References clang::ASTDeserializationListener::IdentifierRead().
|
inline |
Set the AST callbacks listener.
Definition at line 1709 of file ASTReader.h.
Referenced by clang::ASTReader::ListenerScope::ListenerScope(), and clang::ASTReader::ListenerScope::~ListenerScope().
|
inlinestatic |
Definition at line 2341 of file ASTReader.h.
References SkipString().
|
inlinestatic |
Definition at line 2329 of file ASTReader.h.
Referenced by SkipPath().
|
overridevirtual |
Notify ASTReader that we started deserialization of a decl or type so until FinishedDeserializing is called there may be decls that are initializing.
Must be paired with FinishedDeserializing.
Reimplemented from clang::ExternalASTSource.
Definition at line 10321 of file ASTReader.cpp.
|
overridevirtual |
Function that will be invoked when we begin parsing a new translation unit involving this external AST source.
This function will provide all of the external definitions to the ASTConsumer.
Reimplemented from clang::ExternalASTSource.
Definition at line 8226 of file ASTReader.cpp.
|
inline |
Take the AST callbacks listener.
Definition at line 1704 of file ASTReader.h.
Referenced by clang::ASTReader::ListenerScope::ListenerScope(), and clang::ASTReader::ListenerScope::~ListenerScope().
|
inline |
Translate a FileID from another module file's FileID space into ours.
Definition at line 2313 of file ASTReader.h.
References clang::serialization::ModuleFile::SLocEntryBaseID.
Referenced by ReadFileID().
|
inline |
Translate a source location from another module file's source location space into ours.
Definition at line 2285 of file ASTReader.h.
References Loc, and clang::serialization::ModuleFile::SLocEntryBaseOffset.
Referenced by ReadSourceLocation().
|
overridevirtual |
Update an out-of-date identifier.
Implements clang::ExternalPreprocessorSource.
Definition at line 2296 of file ASTReader.cpp.
References clang::IdentifierInfo::getName().
|
overridevirtual |
Load the contents of the global method pool for a given selector if necessary.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8769 of file ASTReader.cpp.
References ReadMethodPool().
void ASTReader::UpdateSema | ( | ) |
Update the state of Sema after loading some additional modules.
Definition at line 8400 of file ASTReader.cpp.
void ASTReader::visitInputFileInfos | ( | serialization::ModuleFile & | MF, |
bool | IncludeSystem, | ||
llvm::function_ref< void(const serialization::InputFileInfo &IFI, bool IsSystem)> | Visitor | ||
) |
Visit all the input file infos of the given module file.
Definition at line 9709 of file ASTReader.cpp.
References clang::serialization::ModuleFile::InputFilesLoaded, and clang::serialization::ModuleFile::NumUserInputFiles.
void ASTReader::visitInputFiles | ( | serialization::ModuleFile & | MF, |
bool | IncludeSystem, | ||
bool | Complain, | ||
llvm::function_ref< void(const serialization::InputFile &IF, bool isSystem)> | Visitor | ||
) |
Visit all the input files of the given module file.
Definition at line 9725 of file ASTReader.cpp.
References clang::serialization::ModuleFile::InputFilesLoaded, and clang::serialization::ModuleFile::NumUserInputFiles.
void ASTReader::visitTopLevelModuleMaps | ( | serialization::ModuleFile & | MF, |
llvm::function_ref< void(FileEntryRef)> | Visitor | ||
) |
Visit all the top-level module maps loaded when building the given module file.
Definition at line 9740 of file ASTReader.cpp.
References clang::serialization::ModuleFile::InputFilesLoaded, clang::serialization::InputFileInfo::ModuleMap, and clang::serialization::InputFileInfo::TopLevel.
Referenced by clang::FrontendAction::BeginSourceFile().
void ASTReader::warnStackExhausted | ( | SourceLocation | Loc | ) |
Definition at line 9599 of file ASTReader.cpp.
References Diag(), Loc, and clang::Sema::warnStackExhausted().
|
friend |
Types of AST files.
Definition at line 381 of file ASTReader.h.
|
friend |
Definition at line 382 of file ASTReader.h.
|
friend |
Definition at line 383 of file ASTReader.h.
Referenced by getIdentifiers().
|
friend |
Definition at line 384 of file ASTReader.h.
|
friend |
Definition at line 385 of file ASTReader.h.
|
friend |
Definition at line 386 of file ASTReader.h.
|
friend |
Definition at line 391 of file ASTReader.h.
|
friend |
Definition at line 387 of file ASTReader.h.
|
friend |
Definition at line 388 of file ASTReader.h.
|
friend |
Definition at line 389 of file ASTReader.h.
|
friend |
Definition at line 390 of file ASTReader.h.
SmallVector<std::pair<llvm::BitstreamCursor, serialization::ModuleFile *>, 8> clang::ASTReader::CommentsCursors |
Cursors for comments blocks.
Definition at line 2437 of file ASTReader.h.
Referenced by ReadComments().
SmallVector<GlobalDeclID, 16> clang::ASTReader::PreloadedDeclIDs |
Definition at line 2410 of file ASTReader.h.
Referenced by SetGloballyVisibleDecls().