clang
17.0.0git
|
Reads an AST files chain containing the contents of a translation unit. More...
#include "clang/Serialization/ASTReader.h"
Classes | |
struct | ImportedSubmodule |
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 |
![]() | |
enum | ExtKind { EK_Always, EK_Never, EK_ReplyHazy } |
Friends | |
class | ASTDeclReader |
Types of AST files. More... | |
class | ASTIdentifierIterator |
class | ASTRecordReader |
class | ASTUnit |
class | ASTWriter |
class | PCHValidator |
class | serialization::reader::ASTIdentifierLookupTrait |
class | serialization::ReadMethodPoolVisitor |
class | TypeLocReader |
Sema-relevant special data | |
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... | |
SmallVector< uint64_t, 16 > | PreloadedDeclIDs |
SmallVector< std::pair< llvm::BitstreamCursor, serialization::ModuleFile * >, 8 > | CommentsCursors |
Cursors for comments blocks. More... | |
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. More... | |
Decl * | getKeyDeclaration (Decl *D) |
Returns the first key declaration for the given declaration. More... | |
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 . More... | |
const serialization::reader::DeclContextLookupTable * | getLoadedLookupTables (DeclContext *Primary) const |
Get the loaded lookup tables for Primary , if any. More... | |
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. More... | |
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, SmallVectorImpl< ImportedSubmodule > *Imported=nullptr) |
Load the AST file designated by the given file name. More... | |
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. More... | |
void | makeNamesVisible (const HiddenNames &Names, Module *Owner) |
Make the names within this set of hidden names visible. More... | |
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. More... | |
std::unique_ptr< ASTReaderListener > | takeListener () |
Take the AST callbacks listener. More... | |
void | setListener (std::unique_ptr< ASTReaderListener > Listener) |
Set the AST callbacks listener. More... | |
void | addListener (std::unique_ptr< ASTReaderListener > L) |
Add an AST callback listener. More... | |
void | setDeserializationListener (ASTDeserializationListener *Listener, bool TakeOwnership=false) |
Set the AST deserialization listener. More... | |
ASTDeserializationListener * | getDeserializationListener () |
Get the AST deserialization listener. More... | |
bool | hasGlobalIndex () const |
Determine whether this AST reader has a global index. More... | |
GlobalModuleIndex * | getGlobalIndex () |
Return global module index. More... | |
void | resetForReload () |
Reset reader for a reload try. More... | |
bool | loadGlobalIndex () |
Attempts to load the global index. More... | |
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. More... | |
void | InitializeContext () |
Initializes the ASTContext. More... | |
void | UpdateSema () |
Update the state of Sema after loading some additional modules. More... | |
void | addInMemoryBuffer (StringRef &FileName, std::unique_ptr< llvm::MemoryBuffer > Buffer) |
Add in-memory (virtual file) buffer. More... | |
void | finalizeForWriting () |
Finalizes the AST reader's state before writing an AST file to disk. More... | |
ModuleManager & | getModuleManager () |
Retrieve the module manager. More... | |
Preprocessor & | getPreprocessor () const |
Retrieve the preprocessor. More... | |
StringRef | getOriginalSourceFile () |
Retrieve the name of the original source file name for the primary module file. More... | |
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. More... | |
PreprocessedEntity * | ReadPreprocessedEntity (unsigned Index) override |
Read a preallocated preprocessed entity from the external source. More... | |
std::pair< unsigned, unsigned > | findPreprocessedEntitiesInRange (SourceRange Range) override |
Returns a pair of [Begin, End) indices of preallocated preprocessed entities that Range encompasses. More... | |
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 . More... | |
SourceRange | ReadSkippedRange (unsigned Index) override |
Read a preallocated skipped range from the external source. More... | |
HeaderFileInfo | GetHeaderFileInfo (const FileEntry *FE) override |
Read the header file information for the given file entry. More... | |
void | ReadPragmaDiagnosticMappings (DiagnosticsEngine &Diag) |
unsigned | getTotalNumSLocs () const |
Returns the number of source locations found in the chain. More... | |
unsigned | getTotalNumIdentifiers () const |
Returns the number of identifiers found in the chain. More... | |
unsigned | getTotalNumMacros () const |
Returns the number of macros found in the chain. More... | |
unsigned | getTotalNumTypes () const |
Returns the number of types found in the chain. More... | |
unsigned | getTotalNumDecls () const |
Returns the number of declarations found in the chain. More... | |
unsigned | getTotalNumSubmodules () const |
Returns the number of submodules known. More... | |
unsigned | getTotalNumSelectors () const |
Returns the number of selectors found in the chain. More... | |
unsigned | getTotalNumPreprocessedEntities () const |
Returns the number of preprocessed entities known to the AST reader. More... | |
QualType | GetType (serialization::TypeID ID) |
Resolve a type ID into a type, potentially building a new type. More... | |
QualType | getLocalType (ModuleFile &F, unsigned LocalID) |
Resolve a local type ID within a given AST file into a type. More... | |
serialization::TypeID | getGlobalTypeID (ModuleFile &F, unsigned LocalID) const |
Map a local type ID within a given AST file into a global type ID. More... | |
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. More... | |
serialization::DeclID | getGlobalDeclID (ModuleFile &F, serialization::LocalDeclID LocalID) const |
Map from a local declaration ID within a given module to a global declaration ID. More... | |
bool | isDeclIDFromModule (serialization::GlobalDeclID ID, ModuleFile &M) const |
Returns true if global DeclID ID originated from module M . More... | |
ModuleFile * | getOwningModuleFile (const Decl *D) |
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a module file. More... | |
SourceLocation | getSourceLocationForDeclID (serialization::GlobalDeclID ID) |
Returns the source location for the decl ID . More... | |
Decl * | GetDecl (serialization::DeclID ID) |
Resolve a declaration ID into a declaration, potentially building a new declaration. More... | |
Decl * | GetExternalDecl (uint32_t ID) override |
Resolve a declaration ID into a declaration, potentially building a new declaration. More... | |
Decl * | GetExistingDecl (serialization::DeclID ID) |
Resolve a declaration ID into a declaration. More... | |
Decl * | GetLocalDecl (ModuleFile &F, uint32_t LocalID) |
Reads a declaration with the given local ID in the given module. More... | |
template<typename T > | |
T * | GetLocalDeclAs (ModuleFile &F, uint32_t LocalID) |
Reads a declaration with the given local ID in the given module. More... | |
serialization::DeclID | mapGlobalIDToModuleFileGlobalID (ModuleFile &M, serialization::DeclID GlobalID) |
Map a global declaration ID into the declaration ID used to refer to this declaration within the given module fule. More... | |
serialization::DeclID | ReadDeclID (ModuleFile &F, const RecordData &Record, unsigned &Idx) |
Reads a declaration ID from the given position in a record in the given module. More... | |
Decl * | ReadDecl (ModuleFile &F, const RecordData &R, unsigned &I) |
Reads a declaration from the given position in a record in the given module. More... | |
template<typename T > | |
T * | ReadDeclAs (ModuleFile &F, const RecordData &R, unsigned &I) |
Reads a declaration from the given position in a record in the given module. More... | |
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 . More... | |
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. More... | |
Stmt * | GetExternalDeclStmt (uint64_t Offset) override |
Resolve the offset of a statement into a statement. More... | |
bool | FindExternalVisibleDeclsByName (const DeclContext *DC, DeclarationName Name) override |
Finds all the visible declarations with a given name. More... | |
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. More... | |
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. More... | |
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. More... | |
void | FinishedDeserializing () override |
Notify ASTReader that we finished the deserialization of a decl or type. More... | |
void | StartTranslationUnit (ASTConsumer *Consumer) override |
Function that will be invoked when we begin parsing a new translation unit involving this external AST source. More... | |
void | PrintStats () override |
Print some statistics about AST usage. More... | |
void | dump () |
Dump information about the AST reader to standard error. More... | |
void | getMemoryBufferSizes (MemoryBufferSizes &sizes) const override |
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memory. More... | |
void | InitializeSema (Sema &S) override |
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree. More... | |
void | ForgetSema () override |
Inform the semantic consumer that Sema is no longer available. More... | |
IdentifierInfo * | get (StringRef Name) override |
Retrieve the IdentifierInfo for the named identifier. More... | |
IdentifierIterator * | getIdentifiers () override |
Retrieve an iterator into the set of all identifiers in all loaded AST files. More... | |
void | ReadMethodPool (Selector Sel) override |
Load the contents of the global method pool for a given selector. More... | |
void | updateOutOfDateSelector (Selector Sel) override |
Load the contents of the global method pool for a given selector if necessary. More... | |
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. More... | |
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. More... | |
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. More... | |
void | ReadUnusedFileScopedDecls (SmallVectorImpl< const DeclaratorDecl * > &Decls) override |
Read the set of unused file-scope declarations known to the external Sema source. More... | |
void | ReadDelegatingConstructors (SmallVectorImpl< CXXConstructorDecl * > &Decls) override |
Read the set of delegating constructors known to the external Sema source. More... | |
void | ReadExtVectorDecls (SmallVectorImpl< TypedefNameDecl * > &Decls) override |
Read the set of ext_vector type declarations known to the external Sema source. More... | |
void | ReadUnusedLocalTypedefNameCandidates (llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) override |
Read the set of potentially unused typedefs known to the source. More... | |
void | ReadDeclsToCheckForDeferredDiags (llvm::SmallSetVector< Decl *, 4 > &Decls) override |
Read the set of decls to be checked for deferred diags. More... | |
void | ReadReferencedSelectors (SmallVectorImpl< std::pair< Selector, SourceLocation >> &Sels) override |
void | ReadWeakUndeclaredIdentifiers (SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo >> &WI) override |
void | ReadUsedVTables (SmallVectorImpl< ExternalVTableUse > &VTables) override |
Read the set of used vtables known to the external Sema source. More... | |
void | ReadPendingInstantiations (SmallVectorImpl< std::pair< ValueDecl *, SourceLocation >> &Pending) override |
void | ReadLateParsedTemplates (llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate >> &LPTMap) override |
Read the set of late parsed template functions for this source. More... | |
void | LoadSelector (Selector Sel) |
Load a selector from disk, registering its ID if it exists. More... | |
void | SetIdentifierInfo (unsigned ID, IdentifierInfo *II) |
void | SetGloballyVisibleDecls (IdentifierInfo *II, const SmallVectorImpl< uint32_t > &DeclIDs, SmallVectorImpl< Decl * > *Decls=nullptr) |
Set the globally-visible declarations associated with the given identifier. More... | |
DiagnosticBuilder | Diag (unsigned DiagID) const |
Report a diagnostic. More... | |
DiagnosticBuilder | Diag (SourceLocation Loc, unsigned DiagID) const |
Report a diagnostic. More... | |
IdentifierInfo * | DecodeIdentifierInfo (serialization::IdentifierID ID) |
IdentifierInfo * | readIdentifier (ModuleFile &M, const RecordData &Record, unsigned &Idx) |
IdentifierInfo * | GetIdentifier (serialization::IdentifierID ID) override |
IdentifierInfo * | getLocalIdentifier (ModuleFile &M, unsigned LocalID) |
serialization::IdentifierID | getGlobalIdentifierID (ModuleFile &M, unsigned LocalID) |
void | resolvePendingMacro (IdentifierInfo *II, const PendingMacroInfo &PMInfo) |
MacroInfo * | getMacro (serialization::MacroID ID) |
Retrieve the macro with the given ID. More... | |
serialization::MacroID | getGlobalMacroID (ModuleFile &M, unsigned LocalID) |
Retrieve the global macro ID corresponding to the given local ID within the given module file. More... | |
bool | ReadSLocEntry (int ID) override |
Read the source location entry with index ID. More... | |
std::pair< SourceLocation, StringRef > | getModuleImportLoc (int ID) override |
Retrieve the module import location and module name for the given source manager entry ID. More... | |
serialization::SubmoduleID | getGlobalSubmoduleID (ModuleFile &M, unsigned LocalID) |
Retrieve the global submodule ID given a module and its local ID number. More... | |
Module * | getSubmodule (serialization::SubmoduleID GlobalID) |
Retrieve the submodule that corresponds to a global submodule ID. More... | |
Module * | getModule (unsigned ID) override |
Retrieve the module that corresponds to the given module ID. More... | |
ModuleFile * | getLocalModuleFile (ModuleFile &M, unsigned ID) |
Retrieve the module file with a given local ID within the specified ModuleFile. More... | |
unsigned | getModuleFileID (ModuleFile *M) |
Get an ID for the given module file. More... | |
std::optional< ASTSourceDescriptor > | getSourceDescriptor (unsigned ID) override |
Return a descriptor for the corresponding module. More... | |
ExtKind | hasExternalDefinitions (const Decl *D) override |
Selector | getLocalSelector (ModuleFile &M, unsigned LocalID) |
Retrieve a selector from the given module with its local ID number. More... | |
Selector | DecodeSelector (serialization::SelectorID Idx) |
Selector | GetExternalSelector (serialization::SelectorID ID) override |
Resolve a selector ID into a selector. More... | |
uint32_t | GetNumExternalSelectors () override |
Returns the number of selectors known to the external AST source. More... | |
Selector | ReadSelector (ModuleFile &M, const RecordData &Record, unsigned &Idx) |
serialization::SelectorID | getGlobalSelectorID (ModuleFile &F, unsigned LocalID) const |
Retrieve the global selector ID that corresponds to this the local selector ID in a given module. More... | |
CXXCtorInitializer ** | GetExternalCXXCtorInitializers (uint64_t Offset) override |
Read the contents of a CXXCtorInitializer array. More... | |
Sema::AlignPackInfo | ReadAlignPackInfo (uint32_t Raw) const |
Read a AlignPackInfo from raw form. More... | |
SourceLocation | ReadUntranslatedSourceLocation (SourceLocation::UIntTy Raw, LocSeq *Seq=nullptr) const |
Read a source location from raw form and return it in its originating module file's source location space. More... | |
SourceLocation | ReadSourceLocation (ModuleFile &ModuleFile, SourceLocation::UIntTy Raw, LocSeq *Seq=nullptr) const |
Read a source location from raw form. More... | |
SourceLocation | TranslateSourceLocation (ModuleFile &ModuleFile, SourceLocation Loc) const |
Translate a source location from another module file's source location space into ours. More... | |
SourceLocation | ReadSourceLocation (ModuleFile &ModuleFile, const RecordDataImpl &Record, unsigned &Idx, LocSeq *Seq=nullptr) |
Read a source location. More... | |
FileID | ReadFileID (ModuleFile &F, const RecordDataImpl &Record, unsigned &Idx) const |
Read a FileID. More... | |
FileID | TranslateFileID (ModuleFile &F, FileID FID) const |
Translate a FileID from another module file's FileID space into ours. More... | |
SourceRange | ReadSourceRange (ModuleFile &F, const RecordData &Record, unsigned &Idx, LocSeq *Seq=nullptr) |
Read a source range. More... | |
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. More... | |
Expr * | ReadExpr (ModuleFile &F) |
Reads an expression. More... | |
Stmt * | ReadSubStmt () |
Reads a sub-statement operand during statement reading. More... | |
Expr * | ReadSubExpr () |
Reads a sub-expression operand during statement reading. More... | |
Token | ReadToken (ModuleFile &M, const RecordDataImpl &Record, unsigned &Idx) |
Reads a token out of a record. More... | |
MacroInfo * | ReadMacroRecord (ModuleFile &F, uint64_t Offset) |
Reads the macro record located at the given offset. More... | |
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. More... | |
void | addPendingMacro (IdentifierInfo *II, ModuleFile *M, uint32_t MacroDirectivesOffset) |
Add a macro to deserialize its macro directive history. More... | |
void | ReadDefinedMacros () override |
Read the set of macros defined by this external macro source. More... | |
void | updateOutOfDateIdentifier (IdentifierInfo &II) override |
Update an out-of-date identifier. More... | |
void | markIdentifierUpToDate (IdentifierInfo *II) |
Note that this identifier is up-to-date. More... | |
void | completeVisibleDeclsMap (const DeclContext *DC) override |
Load all external visible decls in the given DeclContext. More... | |
ASTContext & | getContext () |
Retrieve the AST context that this AST reader supplements. More... | |
Sema * | getSema () |
Retrieve the semantic analysis object used to analyze the translation unit in which the precompiled header is being imported. More... | |
IdentifierResolver & | getIdResolver () |
Get the identifier resolver used for name lookup / updates in the translation unit scope. More... | |
IdentifierTable & | getIdentifierTable () |
Retrieve the identifier table associated with the preprocessor. More... | |
void | RecordSwitchCaseID (SwitchCase *SC, unsigned ID) |
Record that the given ID maps to the given switch-case statement. More... | |
SwitchCase * | getSwitchCaseWithID (unsigned ID) |
Retrieve the switch-case statement with the given ID. More... | |
void | ClearSwitchCaseIDs () |
void | ReadComments () override |
Loads comments ranges. More... | |
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. More... | |
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. More... | |
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. More... | |
static bool | readASTFileControlBlock (StringRef Filename, FileManager &FileMgr, const InMemoryModuleCache &ModuleCache, const PCHContainerReader &PCHContainerRdr, bool FindModuleFileExtensions, ASTReaderListener &Listener, bool ValidateDiagnosticOptions) |
Read the control block for the named AST file. More... | |
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. More... | |
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. More... | |
static std::string | ReadString (const RecordData &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. More... | |
Additional Inherited Members | |
![]() | |
virtual | ~ExternalPreprocessorSource () |
virtual IdentifierInfo * | GetIdentifier (unsigned ID)=0 |
Return the identifier associated with the given ID number. More... | |
![]() | |
virtual | ~ExternalPreprocessingRecordSource () |
![]() | |
virtual | ~ExternalHeaderFileInfoSource () |
![]() | |
ExternalSemaSource ()=default | |
~ExternalSemaSource () override | |
virtual bool | LookupUnqualified (LookupResult &R, Scope *S) |
Do last resort, unqualified lookup on a LookupResult that Sema cannot find. More... | |
virtual void | ReadReferencedSelectors (SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) |
Read the set of referenced selectors known to the external Sema source. More... | |
virtual void | ReadWeakUndeclaredIdentifiers (SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WI) |
Read the set of weak, undeclared identifiers known to the external Sema source. More... | |
virtual void | ReadPendingInstantiations (SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) |
Read the set of pending instantiations known to the external Sema source. More... | |
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. More... | |
virtual bool | MaybeDiagnoseMissingCompleteType (SourceLocation Loc, QualType T) |
Produces a diagnostic note if the external source contains a complete definition for T . More... | |
bool | isA (const void *ClassID) const override |
LLVM-style RTTI. More... | |
![]() | |
ExternalASTSource ()=default | |
virtual | ~ExternalASTSource () |
uint32_t | getGeneration () const |
Get the current generation of this AST source. More... | |
void | FindExternalLexicalDecls (const DeclContext *DC, SmallVectorImpl< Decl * > &Result) |
Finds all declarations lexically contained within the given DeclContext. More... | |
virtual void | CompleteType (TagDecl *Tag) |
Gives the external AST source an opportunity to complete an incomplete type. More... | |
virtual void | CompleteType (ObjCInterfaceDecl *Class) |
Gives the external AST source an opportunity to complete an incomplete Objective-C class. More... | |
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. More... | |
MemoryBufferSizes | getMemoryBufferSizes () const |
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memory. More... | |
![]() | |
virtual | ~IdentifierInfoLookup () |
![]() | |
virtual | ~ExternalSLocEntrySource () |
![]() | |
static bool | classof (const ExternalASTSource *S) |
![]() | |
static bool | classof (const ExternalASTSource *S) |
![]() | |
uint32_t | incrementGeneration (ASTContext &C) |
Increment the current generation. More... | |
![]() | |
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 359 of file ASTReader.h.
Definition at line 414 of file ASTReader.h.
Definition at line 410 of file ASTReader.h.
Definition at line 413 of file ASTReader.h.
Definition at line 411 of file ASTReader.h.
Definition at line 412 of file ASTReader.h.
Definition at line 415 of file ASTReader.h.
using clang::ASTReader::RecordData = SmallVector<uint64_t, 64> |
Definition at line 379 of file ASTReader.h.
using clang::ASTReader::RecordDataImpl = SmallVectorImpl<uint64_t> |
Definition at line 380 of file ASTReader.h.
The result of reading the control block of an AST file, which can fail for various reasons.
Definition at line 384 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 1576 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 9887 of file ASTReader.cpp.
References clang::PCH, clang::DiagnosticsEngine::Report(), and clang::SourceManager::setExternalSLocEntrySource().
|
delete |
|
override |
Definition at line 9926 of file ASTReader.cpp.
|
inline |
Add in-memory (virtual file) buffer.
Definition at line 1722 of file ASTReader.h.
References clang::serialization::ModuleManager::addInMemoryBuffer().
|
inline |
Add an AST callback listener.
Takes ownership of L
.
Definition at line 1656 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 1961 of file ASTReader.cpp.
void ASTReader::ClearSwitchCaseIDs | ( | ) |
Definition at line 9156 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 7283 of file ASTReader.cpp.
References clang::Decl::getDeclContext(), and clang::DeclContext::getRedeclContext().
|
overridevirtual |
Load all external visible decls in the given DeclContext.
Reimplemented from clang::ExternalASTSource.
Definition at line 7763 of file ASTReader.cpp.
References clang::NamedDecl::getDeclName(), and clang::DeclContext::hasExternalVisibleStorage().
IdentifierInfo * ASTReader::DecodeIdentifierInfo | ( | serialization::IdentifierID | ID | ) |
Definition at line 8612 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), and clang::ContinuousRangeMap< Int, V, InitialCapacity >::find().
Referenced by GetIdentifier(), getLocalIdentifier(), readIdentifier(), and ReadWeakUndeclaredIdentifiers().
Selector ASTReader::DecodeSelector | ( | serialization::SelectorID | Idx | ) |
Definition at line 8796 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 9132 of file ASTReader.cpp.
References clang::DiagnosticsEngine::Report().
DiagnosticBuilder ASTReader::Diag | ( | unsigned | DiagID | ) | const |
Report a diagnostic.
Definition at line 9128 of file ASTReader.cpp.
LLVM_DUMP_METHOD void ASTReader::dump | ( | ) |
Dump information about the AST reader to standard error.
Definition at line 7928 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 5055 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 7618 of file ASTReader.cpp.
References clang::DeclContext::isDeclInLexicalTraversal(), and clang::serialization::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 7736 of file ASTReader.cpp.
|
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 7694 of file ASTReader.cpp.
References clang::File, clang::SourceLocation::getLocWithOffset(), Offset, 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 6255 of file ASTReader.cpp.
|
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 9809 of file ASTReader.cpp.
References clang::ASTContext::adjustDeducedFunctionResultType(), clang::ASTContext::adjustExceptionSpec(), clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::ASTContext::getASTMutationListener(), getContext(), clang::FunctionProtoType::getExtProtoInfo(), and clang::diff::Update.
|
inline |
Run a callback on each imported key declaration of D
.
Definition at line 1311 of file ASTReader.h.
References clang::Decl::getCanonicalDecl(), GetExistingDecl(), and clang::Decl::isFromASTFile().
|
inlineoverridevirtual |
Inform the semantic consumer that Sema is no longer available.
Reimplemented from clang::ExternalSemaSource.
Definition at line 2018 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 8094 of file ASTReader.cpp.
|
inline |
Retrieve the AST context that this AST reader supplements.
Definition at line 2316 of file ASTReader.h.
Referenced by clang::ASTDeclReader::attachPreviousDecl(), FinishedDeserializing(), clang::ASTRecordReader::getContext(), clang::index::indexModuleFile(), clang::ASTDeclReader::mergeInheritableAttributes(), ReadComments(), ReadCXXTemporary(), and clang::ASTDeclReader::UpdateDecl().
Decl * ASTReader::GetDecl | ( | serialization::DeclID | ID | ) |
Resolve a declaration ID into a declaration, potentially building a new declaration.
Definition at line 7548 of file ASTReader.cpp.
References clang::serialization::NUM_PREDEF_DECL_IDS.
Referenced by GetLocalDecl(), clang::ASTReader::ModuleDeclIterator::operator*(), ReadDecl(), ReadDeclAs(), ReadDeclsToCheckForDeferredDiags(), ReadDelegatingConstructors(), ReadExtVectorDecls(), ReadKnownNamespaces(), ReadMismatchingDeleteExpressions(), ReadPendingInstantiations(), ReadTentativeDefinitions(), ReadUndefinedButUsed(), ReadUnusedFileScopedDecls(), ReadUnusedLocalTypedefNameCandidates(), ReadUsedVTables(), and SetGloballyVisibleDecls().
|
inline |
Get the AST deserialization listener.
Definition at line 1693 of file ASTReader.h.
|
inline |
Definition at line 1569 of file ASTReader.h.
Referenced by clang::TestModuleFileExtension::createExtensionReader().
Decl * ASTReader::GetExistingDecl | ( | serialization::DeclID | ID | ) |
Resolve a declaration ID into a declaration.
Return 0 if it's not been loaded yet.
Definition at line 7523 of file ASTReader.cpp.
References clang::Decl::getCanonicalDecl(), getPredefinedDecl(), and clang::serialization::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 7371 of file ASTReader.cpp.
References clang::ASTContext::Allocate(), clang::serialization::DECL_CXX_BASE_SPECIFIERS, Offset, clang::ASTRecordReader::readCXXBaseSpecifier(), clang::ASTRecordReader::readInt(), and clang::ASTRecordReader::readRecord().
|
overridevirtual |
Read the contents of a CXXCtorInitializer array.
Reimplemented from clang::ExternalASTSource.
Definition at line 7340 of file ASTReader.cpp.
References clang::serialization::DECL_CXX_CTOR_INITIALIZERS, Offset, clang::ASTRecordReader::readCXXCtorInitializers(), and clang::ASTRecordReader::readRecord().
|
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 7279 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 7602 of file ASTReader.cpp.
References Offset.
|
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 8821 of file ASTReader.cpp.
References DecodeSelector().
|
inline |
Definition at line 1568 of file ASTReader.h.
Referenced by clang::DependencyCollector::attachToASTReader(), and clang::ModuleDependencyCollector::attachToASTReader().
serialization::DeclID ASTReader::getGlobalDeclID | ( | ModuleFile & | F, |
serialization::LocalDeclID | LocalID | ||
) | const |
Map from a local declaration ID within a given module to a global declaration ID.
Definition at line 7413 of file ASTReader.cpp.
References clang::serialization::ModuleFile::DeclRemap, clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::ModuleOffsetMap, and clang::serialization::NUM_PREDEF_DECL_IDS.
Referenced by GetLocalDecl(), and clang::ASTReader::ModuleDeclIterator::operator*().
IdentifierID ASTReader::getGlobalIdentifierID | ( | ModuleFile & | M, |
unsigned | LocalID | ||
) |
Definition at line 8647 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::IdentifierRemap, clang::serialization::ModuleFile::ModuleOffsetMap, and clang::serialization::NUM_PREDEF_IDENT_IDS.
Referenced by getLocalIdentifier(), and readIdentifier().
|
inline |
Return global module index.
Definition at line 1701 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 8689 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 1837 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 & | F, |
unsigned | LocalID | ||
) | const |
Retrieve the global selector ID that corresponds to this the local selector ID in a given module.
Definition at line 8831 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 | ||
) |
Retrieve the global submodule ID given a module and its local ID number.
Definition at line 8704 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, |
unsigned | LocalID | ||
) | const |
Map a local type ID within a given AST file into a global type ID.
Definition at line 7208 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::Qualifiers::FastMask, clang::Qualifiers::FastWidth, clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::ModuleOffsetMap, clang::serialization::NUM_PREDEF_TYPE_IDS, and clang::serialization::ModuleFile::TypeRemap.
Referenced by clang::ASTRecordReader::getGlobalTypeID().
|
overridevirtual |
Read the header file information for the given file entry.
Implements clang::ExternalHeaderFileInfoSource.
Definition at line 6318 of file ASTReader.cpp.
|
inlineoverride |
Definition at line 2106 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 8219 of file ASTReader.cpp.
References ASTIdentifierIterator, and loadGlobalIndex().
IdentifierTable & ASTReader::getIdentifierTable | ( | ) |
Retrieve the identifier table associated with the preprocessor.
Definition at line 9138 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 9931 of file ASTReader.cpp.
References clang::Sema::IdResolver.
Definition at line 1305 of file ASTReader.h.
References 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 1295 of file ASTReader.h.
References clang::Decl::getCanonicalDecl(), GetExistingDecl(), and clang::Decl::isFromASTFile().
Referenced by getKeyDeclaration().
const serialization::reader::DeclContextLookupTable * ASTReader::getLoadedLookupTables | ( | DeclContext * | Primary | ) | const |
Get the loaded lookup tables for Primary
, if any.
Definition at line 7787 of file ASTReader.cpp.
|
inline |
Reads a declaration with the given local ID in the given module.
Definition at line 1891 of file ASTReader.h.
References GetDecl(), and getGlobalDeclID().
Referenced by clang::ASTRecordReader::GetLocalDeclAs(), GetLocalDeclAs(), and ReadLateParsedTemplates().
|
inline |
Reads a declaration with the given local ID in the given module.
Definition at line 1899 of file ASTReader.h.
References GetLocalDecl().
IdentifierInfo * ASTReader::getLocalIdentifier | ( | ModuleFile & | M, |
unsigned | LocalID | ||
) |
Definition at line 8643 of file ASTReader.cpp.
References DecodeIdentifierInfo(), and getGlobalIdentifierID().
ModuleFile * ASTReader::getLocalModuleFile | ( | ModuleFile & | M, |
unsigned | ID | ||
) |
Retrieve the module file with a given local ID within the specified ModuleFile.
Definition at line 8737 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 8792 of file ASTReader.cpp.
References DecodeSelector(), and getGlobalSelectorID().
Referenced by ReadSelector().
QualType ASTReader::getLocalType | ( | ModuleFile & | F, |
unsigned | LocalID | ||
) |
Resolve a local type ID within a given AST file into a type.
Definition at line 7203 of file ASTReader.cpp.
Referenced by readType().
MacroInfo * ASTReader::getMacro | ( | serialization::MacroID | ID | ) |
Retrieve the macro with the given ID.
Definition at line 8662 of file ASTReader.cpp.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), and clang::serialization::NUM_PREDEF_MACRO_IDS.
|
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 7948 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 8733 of file ASTReader.cpp.
References getSubmodule().
unsigned ASTReader::getModuleFileID | ( | ModuleFile * | M | ) |
Get an ID for the given module file.
Definition at line 8750 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 6028 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 1602 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 1735 of file ASTReader.h.
Referenced by clang::FrontendAction::BeginSourceFile(), getLocalModuleFile(), and getModuleFileID().
|
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 8825 of file ASTReader.cpp.
References getTotalNumSelectors().
|
inline |
Retrieve the name of the original source file name for the primary module file.
Definition at line 1742 of file ASTReader.h.
References clang::serialization::ModuleManager::getPrimaryModule(), and clang::serialization::ModuleFile::OriginalSourceFileName.
Referenced by 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 5105 of file ASTReader.cpp.
References clang::serialization::CONTROL_BLOCK_ID, doesntStartWithASTFileMagic(), clang::PCHContainerReader::ExtractPCH(), clang::FileManager::getBufferForFile(), clang::serialization::ORIGINAL_FILE, clang::DiagnosticsEngine::Report(), SkipCursorToBlock(), and string().
ModuleFile * ASTReader::getOwningModuleFile | ( | const Decl * | D | ) |
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a module file.
Definition at line 7437 of file ASTReader.cpp.
References clang::Decl::getGlobalID(), and clang::Decl::isFromASTFile().
Referenced by clang::ASTDeclWriter::AddFirstDeclFromEachModule(), and ReadLateParsedTemplates().
|
inline |
Retrieve the preprocessor.
Definition at line 1738 of file ASTReader.h.
Referenced by clang::index::indexModuleFile(), isInterestingIdentifier(), and markIdentifierFromAST().
|
inline |
Retrieve the semantic analysis object used to analyze the translation unit in which the precompiled header is being imported.
Definition at line 2328 of file ASTReader.h.
Referenced by ReadMethodPool().
|
overridevirtual |
Return a descriptor for the corresponding module.
Reimplemented from clang::ExternalASTSource.
Definition at line 8767 of file ASTReader.cpp.
References distance(), 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 | ( | serialization::GlobalDeclID | ID | ) |
Returns the source location for the decl ID
.
Definition at line 7445 of file ASTReader.cpp.
References clang::serialization::NUM_PREDEF_DECL_IDS.
|
inline |
Definition at line 1567 of file ASTReader.h.
Module * ASTReader::getSubmodule | ( | serialization::SubmoduleID | GlobalID | ) |
Retrieve the submodule that corresponds to a global submodule ID.
Definition at line 8719 of file ASTReader.cpp.
References clang::serialization::NUM_PREDEF_SUBMODULE_IDS.
Referenced by getModule(), getSourceDescriptor(), and clang::ASTRecordReader::getSubmodule().
|
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 1777 of file ASTReader.h.
SwitchCase * ASTReader::getSwitchCaseWithID | ( | unsigned | ID | ) |
Retrieve the switch-case statement with the given ID.
Definition at line 9151 of file ASTReader.cpp.
Referenced by clang::ASTRecordReader::getSwitchCaseWithID().
|
inline |
Returns the number of declarations found in the chain.
Definition at line 1824 of file ASTReader.h.
|
inline |
Returns the number of identifiers found in the chain.
Definition at line 1809 of file ASTReader.h.
|
inline |
Returns the number of macros found in the chain.
Definition at line 1814 of file ASTReader.h.
|
inline |
Returns the number of preprocessed entities known to the AST reader.
Definition at line 1840 of file ASTReader.h.
|
inline |
Returns the number of selectors found in the chain.
Definition at line 1834 of file ASTReader.h.
Referenced by GetNumExternalSelectors().
|
inline |
Returns the number of source locations found in the chain.
Definition at line 1804 of file ASTReader.h.
|
inline |
Returns the number of submodules known.
Definition at line 1829 of file ASTReader.h.
|
inline |
Returns the number of types found in the chain.
Definition at line 1819 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 6923 of file ASTReader.cpp.
References clang::Qualifiers::FastMask.
|
overridevirtual |
Reimplemented from clang::ExternalASTSource.
Definition at line 8785 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 1698 of file ASTReader.h.
void ASTReader::InitializeContext | ( | ) |
Initializes the ASTContext.
Definition at line 4916 of file ASTReader.cpp.
References clang::Module::AllVisible, clang::File, clang::Type::getAs(), clang::TagType::getDecl(), clang::ASTContext::getDiagnostics(), clang::ASTContext::getTranslationUnitDecl(), clang::QualType::isNull(), clang::Preprocessor::makeModuleVisible(), clang::serialization::NumSpecialTypeIDs, clang::serialization::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 7964 of file ASTReader.cpp.
|
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 5495 of file ASTReader.cpp.
bool ASTReader::isDeclIDFromModule | ( | serialization::GlobalDeclID | ID, |
ModuleFile & | M | ||
) | const |
Returns true if global DeclID ID
originated from module M
.
Definition at line 7427 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BaseDeclID, clang::serialization::ModuleFile::LocalNumDecls, and clang::serialization::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 4186 of file ASTReader.cpp.
References clang::Preprocessor::getLangOpts().
|
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 6268 of file ASTReader.cpp.
|
inline |
Definition at line 2366 of file ASTReader.h.
bool ASTReader::loadGlobalIndex | ( | ) |
Attempts to load the global index.
Definition at line 4161 of file ASTReader.cpp.
References clang::Preprocessor::getLangOpts(), and clang::GlobalModuleIndex::readIndex().
Referenced by getIdentifiers().
void ASTReader::LoadSelector | ( | Selector | Sel | ) |
Load a selector from disk, registering its ID if it exists.
Definition at line 8550 of file ASTReader.cpp.
References ReadMethodPool().
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 4097 of file ASTReader.cpp.
void ASTReader::makeNamesVisible | ( | const HiddenNames & | Names, |
Module * | Owner | ||
) |
Make the names within this set of hidden names visible.
Definition at line 4083 of file ASTReader.cpp.
References clang::Module::Hidden, moveMethodToBackOfGlobalList(), and clang::Module::NameVisibility.
DeclID ASTReader::mapGlobalIDToModuleFileGlobalID | ( | ModuleFile & | M, |
serialization::DeclID | GlobalID | ||
) |
Map a global declaration ID into the declaration ID used to refer to this declaration within the given module fule.
Definition at line 7569 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BaseDeclID, clang::serialization::ModuleFile::GlobalToLocalDeclIDs, and clang::serialization::NUM_PREDEF_DECL_IDS.
void ASTReader::markIdentifierUpToDate | ( | IdentifierInfo * | II | ) |
Note that this identifier is up-to-date.
Definition at line 2110 of file ASTReader.cpp.
References clang::IdentifierInfo::setOutOfDate().
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 4146 of file ASTReader.cpp.
References clang::Decl::getImportedOwningModule(), clang::Decl::isUnconditionallyVisible(), and clang::Decl::setVisibleDespiteOwningModule().
Referenced by clang::ASTDeclReader::attachPreviousDeclImpl().
|
overridevirtual |
Print some statistics about AST usage.
Reimplemented from clang::ExternalASTSource.
Definition at line 7823 of file ASTReader.cpp.
References dump().
|
inline |
Read a AlignPackInfo from raw form.
Definition at line 2182 of file ASTReader.h.
References clang::Sema::AlignPackInfo::getFromRawEncoding().
ASTReader::ASTReadResult ASTReader::ReadAST | ( | StringRef | FileName, |
ModuleKind | Type, | ||
SourceLocation | ImportLoc, | ||
unsigned | ClientLoadCapabilities, | ||
SmallVectorImpl< ImportedSubmodule > * | Imported = 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. |
Imported | optional out-parameter to append the list of modules that were imported by precompiled headers or any other non-module AST file |
Definition at line 4252 of file ASTReader.cpp.
References clang::serialization::ModuleFile::DidReadTopLevelSubmodule, clang::serialization::EXTENSION_BLOCK_ID, clang::serialization::ModuleFile::FileName, clang::serialization::ModuleFile::GlobalBitOffset, clang::serialization::ModuleFile::isModule(), clang::serialization::ModuleFile::ModuleName, clang::serialization::ModuleFile::PreloadSLocEntries, clang::serialization::ModuleFile::SizeInBits, SkipCursorToBlock(), and clang::serialization::ModuleFile::Stream.
|
static |
Read the control block for the named AST file.
Definition at line 5220 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(), clang::ASTReaderListener::ReadFullVersionInformation(), clang::ASTReaderListener::readModuleFileExtension(), clang::ASTReaderListener::ReadModuleMapFile(), clang::ASTReaderListener::ReadModuleName(), clang::ASTFileSignature::size, SkipCursorToBlock(), string(), clang::serialization::VERSION_MAJOR, clang::ASTReaderListener::visitImport(), and clang::ASTReaderListener::visitInputFile().
|
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 1639 of file ASTReader.cpp.
References Offset.
|
overridevirtual |
Loads comments ranges.
Reimplemented from clang::ExternalASTSource.
Definition at line 9160 of file ASTReader.cpp.
References clang::ASTContext::Comments, clang::serialization::COMMENTS_RAW_COMMENT, CommentsCursors, getContext(), clang::SourceManager::getDecomposedLoc(), clang::SourceLocation::isValid(), and ReadSourceRange().
CXXTemporary * ASTReader::ReadCXXTemporary | ( | ModuleFile & | F, |
const RecordData & | Record, | ||
unsigned & | Idx | ||
) |
Definition at line 9121 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 1921 of file ASTReader.h.
References GetDecl(), and ReadDeclID().
Referenced by clang::ASTRecordReader::readDecl().
|
inline |
Reads a declaration from the given position in a record in the given module.
Definition at line 1931 of file ASTReader.h.
References GetDecl(), and ReadDeclID().
Referenced by clang::ASTRecordReader::readDeclAs().
serialization::DeclID ASTReader::ReadDeclID | ( | ModuleFile & | F, |
const RecordData & | Record, | ||
unsigned & | Idx | ||
) |
Reads a declaration ID from the given position in a record in the given module.
Definition at line 7586 of file ASTReader.cpp.
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 8451 of file ASTReader.cpp.
References GetDecl().
|
overridevirtual |
Read the set of macros defined by this external macro source.
Implements clang::ExternalPreprocessorSource.
Definition at line 1967 of file ASTReader.cpp.
References 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 8418 of file ASTReader.cpp.
References GetDecl().
Expr * ASTReader::ReadExpr | ( | ModuleFile & | F | ) |
Reads an expression.
Definition at line 2740 of file ASTReaderStmt.cpp.
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 8429 of file ASTReader.cpp.
References GetDecl().
|
inline |
|
inline |
Definition at line 2101 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 8361 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 8521 of file ASTReader.cpp.
References GetLocalDecl(), getOwningModuleFile(), LT, and ReadToken().
MacroInfo * ASTReader::ReadMacroRecord | ( | ModuleFile & | F, |
uint64_t | Offset | ||
) |
Reads the macro record located at the given offset.
Definition at line 1706 of file ASTReader.cpp.
References clang::serialization::ModuleFile::MacroCursor, Offset, clang::serialization::PP_MACRO_DIRECTIVE_HISTORY, clang::serialization::PP_MACRO_FUNCTION_LIKE, clang::serialization::PP_MACRO_OBJECT_LIKE, and clang::serialization::PP_MODULE_MACRO.
|
overridevirtual |
Load the contents of the global method pool for a given selector.
Reimplemented from clang::ExternalSemaSource.
Definition at line 8318 of file ASTReader.cpp.
References clang::serialization::ReadMethodPoolVisitor::getFactoryMethods(), clang::ExternalASTSource::getGeneration(), clang::serialization::ReadMethodPoolVisitor::getInstanceMethods(), getSema(), and clang::serialization::ModuleManager::visit().
Referenced by LoadSelector(), and updateOutOfDateSelector().
|
overridevirtual |
Reimplemented from clang::ExternalSemaSource.
Definition at line 8382 of file ASTReader.cpp.
References GetDecl(), and clang::SourceLocation::getFromRawEncoding().
std::string ASTReader::ReadPath | ( | ModuleFile & | F, |
const RecordData & | Record, | ||
unsigned & | Idx | ||
) |
Definition at line 9094 of file ASTReader.cpp.
References Filename, ReadString(), ResolveImportedPath(), and string().
Referenced by clang::ASTRecordReader::readPath().
std::string ASTReader::ReadPath | ( | StringRef | BaseDirectory, |
const RecordData & | Record, | ||
unsigned & | Idx | ||
) |
Definition at line 9101 of file ASTReader.cpp.
References Filename, ReadString(), ResolveImportedPath(), and string().
|
override |
Definition at line 8509 of file ASTReader.cpp.
References GetDecl(), and clang::SourceLocation::getFromRawEncoding().
void ASTReader::ReadPragmaDiagnosticMappings | ( | DiagnosticsEngine & | Diag | ) |
Definition at line 6327 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, Offset, clang::serialization::ModuleFile::OriginalSourceFileID, clang::serialization::ModuleFile::PragmaDiagMappings, clang::DiagnosticMapping::setSeverity(), clang::DiagnosticMapping::setUpgradedFromWarning(), State, clang::diag::Warning, and clang::DiagnosticMapping::wasUpgradedFromWarning().
|
overridevirtual |
Read a preallocated preprocessed entity from the external source.
Implements clang::ExternalPreprocessingRecordSource.
Definition at line 6049 of file ASTReader.cpp.
|
override |
Definition at line 8461 of file ASTReader.cpp.
References DecodeSelector(), and clang::SourceLocation::getFromRawEncoding().
|
inline |
Definition at line 2169 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 6035 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BasePreprocessedSkippedRangeID, clang::serialization::PPSkippedRange::getBegin(), clang::serialization::PPSkippedRange::getEnd(), and clang::serialization::ModuleFile::PreprocessedSkippedRangeOffsets.
Read the source location entry with index ID.
Implements clang::ExternalSLocEntrySource.
Definition at line 1422 of file ASTReader.cpp.
|
inline |
Read a source location.
Definition at line 2216 of file ASTReader.h.
References ReadSourceLocation().
|
inline |
Read a source location from raw form.
Definition at line 2194 of file ASTReader.h.
References ReadUntranslatedSourceLocation(), and TranslateSourceLocation().
Referenced by clang::ASTRecordReader::readSourceLocation(), ReadSourceLocation(), and ReadSourceRange().
SourceRange ASTReader::ReadSourceRange | ( | ModuleFile & | F, |
const RecordData & | Record, | ||
unsigned & | Idx, | ||
LocSeq * | Seq = nullptr |
||
) |
Read a source range.
Definition at line 9074 of file ASTReader.cpp.
References ReadSourceLocation().
Referenced by ReadComments(), and clang::ASTRecordReader::readSourceRange().
Stmt * ASTReader::ReadStmt | ( | ModuleFile & | F | ) |
Reads a statement.
Definition at line 2726 of file ASTReaderStmt.cpp.
Referenced by clang::ASTRecordReader::readStmt().
|
static |
Definition at line 9087 of file ASTReader.cpp.
References string().
Referenced by ReadPath(), and clang::ASTRecordReader::readString().
Expr * ASTReader::ReadSubExpr | ( | ) |
Reads a sub-expression operand during statement reading.
Definition at line 2744 of file ASTReaderStmt.cpp.
Referenced by clang::ASTRecordReader::readSubExpr().
|
inline |
Reads a sub-statement operand during statement reading.
Definition at line 2271 of file ASTReader.h.
Referenced by 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 8397 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 1666 of file ASTReader.cpp.
References 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 1859 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 8372 of file ASTReader.cpp.
References GetDecl(), and clang::SourceLocation::getFromRawEncoding().
|
inline |
Read a source location from raw form and return it in its originating module file's source location space.
Definition at line 2188 of file ASTReader.h.
References clang::SourceLocationEncoding::decode().
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 8407 of file ASTReader.cpp.
References GetDecl().
|
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 8439 of file ASTReader.cpp.
References GetDecl().
|
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 8497 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 9109 of file ASTReader.cpp.
Referenced by clang::ASTRecordReader::readVersionTuple().
|
override |
Definition at line 8479 of file ASTReader.cpp.
References DecodeIdentifierInfo(), and clang::SourceLocation::getFromRawEncoding().
void ASTReader::RecordSwitchCaseID | ( | SwitchCase * | SC, |
unsigned | ID | ||
) |
Record that the given ID maps to the given switch-case statement.
Definition at line 9144 of file ASTReader.cpp.
Referenced by clang::ASTRecordReader::recordSwitchCaseID().
|
inline |
Reset reader for a reload try.
Definition at line 1704 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 2496 of file ASTReader.cpp.
References clang::serialization::ModuleFile::BaseDirectory, and Filename.
Referenced by ReadPath().
|
static |
Definition at line 2502 of file ASTReader.cpp.
References Filename.
void ASTReader::resolvePendingMacro | ( | IdentifierInfo * | II, |
const PendingMacroInfo & | PMInfo | ||
) |
Definition at line 2121 of file ASTReader.cpp.
References clang::serialization::ModuleFile::isModule(), 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 870 of file ASTReader.cpp.
void ASTReader::SetGloballyVisibleDecls | ( | IdentifierInfo * | II, |
const SmallVectorImpl< uint32_t > & | 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 8580 of file ASTReader.cpp.
References GetDecl(), and PreloadedDeclIDs.
void ASTReader::SetIdentifierInfo | ( | unsigned | ID, |
IdentifierInfo * | II | ||
) |
Definition at line 8555 of file ASTReader.cpp.
References clang::ASTDeserializationListener::IdentifierRead().
|
inline |
Set the AST callbacks listener.
Definition at line 1649 of file ASTReader.h.
Referenced by clang::ASTReader::ListenerScope::ListenerScope(), and clang::ASTReader::ListenerScope::~ListenerScope().
|
inlinestatic |
Definition at line 2254 of file ASTReader.h.
References SkipString().
|
inlinestatic |
Definition at line 2242 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 9804 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 7813 of file ASTReader.cpp.
|
inline |
Take the AST callbacks listener.
Definition at line 1644 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 2229 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 2203 of file ASTReader.h.
References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::SourceLocation::getLocWithOffset(), clang::serialization::ModuleFile::ModuleOffsetMap, and clang::serialization::ModuleFile::SLocRemap.
Referenced by ReadSourceLocation().
|
overridevirtual |
Update an out-of-date identifier.
Implements clang::ExternalPreprocessorSource.
Definition at line 2085 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 8356 of file ASTReader.cpp.
References ReadMethodPool().
void ASTReader::UpdateSema | ( | ) |
Update the state of Sema after loading some additional modules.
Definition at line 7990 of file ASTReader.cpp.
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 9232 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 9247 of file ASTReader.cpp.
References clang::serialization::ModuleFile::InputFilesLoaded, and clang::serialization::InputFileInfo::TopLevelModuleMap.
Referenced by clang::FrontendAction::BeginSourceFile().
|
friend |
Types of AST files.
Definition at line 369 of file ASTReader.h.
|
friend |
Definition at line 370 of file ASTReader.h.
Referenced by getIdentifiers().
|
friend |
Definition at line 371 of file ASTReader.h.
|
friend |
Definition at line 372 of file ASTReader.h.
|
friend |
Definition at line 373 of file ASTReader.h.
|
friend |
Definition at line 374 of file ASTReader.h.
|
friend |
Definition at line 375 of file ASTReader.h.
|
friend |
Definition at line 376 of file ASTReader.h.
|
friend |
Definition at line 377 of file ASTReader.h.
SmallVector<std::pair<llvm::BitstreamCursor, serialization::ModuleFile *>, 8> clang::ASTReader::CommentsCursors |
Cursors for comments blocks.
Definition at line 2350 of file ASTReader.h.
Referenced by ReadComments().
SmallVector<uint64_t, 16> clang::ASTReader::PreloadedDeclIDs |
Definition at line 2323 of file ASTReader.h.
Referenced by SetGloballyVisibleDecls().