class ASTReader

Declaration

class ASTReader : public ExternalPreprocessorSource,
                  public ExternalPreprocessingRecordSource,
                  public ExternalHeaderFileInfoSource,
                  public ExternalSemaSource,
                  public IdentifierInfoLookup,
                  public ExternalSLocEntrySource { /* full declaration omitted */ };

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:341

Inherits from: ExternalPreprocessorSource, ExternalPreprocessingRecordSource, ExternalHeaderFileInfoSource, ExternalSemaSource, IdentifierInfoLookup, ExternalSLocEntrySource

Member Variables

private std::unique_ptr<ASTReaderListener> Listener
The receiver of some callbacks invoked by ASTReader.
private clang::ASTDeserializationListener* DeserializationListener = nullptr
The receiver of deserialization events.
private bool OwnsDeserializationListener = false
private clang::SourceManager& SourceMgr
private clang::FileManager& FileMgr
private const clang::PCHContainerReader& PCHContainerRdr
private clang::DiagnosticsEngine& Diags
private clang::Sema* SemaObj = nullptr
The semantic analysis object that will be processing the AST files and the translation unit that uses it.
private clang::Preprocessor& PP
The preprocessor that will be loading the source file.
private clang::ASTContext* ContextObj = nullptr
The AST context into which we'll read the AST files.
private clang::ASTConsumer* Consumer = nullptr
The AST consumer.
private clang::ASTReader::ModuleManager ModuleMgr
The module manager which manages modules and their dependencies
private clang::IdentifierResolver DummyIdResolver
A dummy identifier resolver used to merge TU-scope declarations in C, for the cases where we don't have a Sema object to provide a real identifier resolver.
private llvm::StringMap< std::shared_ptr<ModuleFileExtension>> ModuleFileExtensions
A mapping from extension block names to module file extensions.
private std::unique_ptr<llvm::Timer> ReadTimer
A timer used to track the time spent deserializing.
private clang::SourceLocation CurrentImportLoc
The location where the module file will be considered as imported from. For non-module AST types it should be invalid.
private Optional<clang::ASTReader::ModuleKind> CurrentDeserializingModuleKind
The module kind that is currently deserializing.
private std::unique_ptr<GlobalModuleIndex> GlobalIndex
The global module index, if loaded.
private ContinuousRangeMap<uint64_t, clang::ASTReader::ModuleFile*, 4> GlobalBitOffsetsMap
A map of global bit offsets to the module that stores entities at those bit offsets.
private ContinuousRangeMap<unsigned int, clang::ASTReader::ModuleFile*, 64> GlobalSLocEntryMap
A map of negated SLocEntryIDs to the modules containing them.
private clang::ASTReader::GlobalSLocOffsetMapType GlobalSLocOffsetMap
A map of reversed (SourceManager::MaxLoadedOffset - SLocOffset) SourceLocation offsets to the modules containing them.
private std::vector<QualType> TypesLoaded
When the pointer at index I is non-NULL, the type with ID = (I + 1) < < FastQual::Width has already been loaded
private clang::ASTReader::GlobalTypeMapType GlobalTypeMap
Mapping from global type IDs to the module in which the type resides along with the offset that should be added to the global type ID to produce a local ID.
private std::vector<Decl*> DeclsLoaded
When the pointer at index I is non-NULL, the declaration with ID = I + 1 has already been loaded.
private clang::ASTReader::GlobalDeclMapType GlobalDeclMap
Mapping from global declaration IDs to the module in which the declaration resides.
private clang::ASTReader::DeclUpdateOffsetsMap DeclUpdateOffsets
Declarations that have modifications residing in a later file in the chain.
private llvm::SmallVector<PendingUpdateRecord, 16> PendingUpdateRecords
Declaration updates for already-loaded declarations that we need to apply once we finish processing an import.
private llvm::DenseMap<void*, PendingFakeDefinitionKind> PendingFakeDefinitionData
The DefinitionData pointers that we faked up for class definitions that we needed but hadn't loaded yet.
private llvm::SmallMapVector<Decl*, FunctionDecl*, 4> PendingExceptionSpecUpdates
Exception specification updates that have been loaded but not yet propagated across the relevant redeclaration chain. The map key is the canonical declaration (used only for deduplication) and the value is a declaration that has an exception specification.
private llvm::SmallMapVector<FunctionDecl*, QualType, 4> PendingDeducedTypeUpdates
Deduced return type updates that have been loaded but not yet propagated across the relevant redeclaration chain. The map key is the canonical declaration and the value is the deduced return type.
private llvm::DenseMap< std::pair<DeclContext*, IdentifierInfo*>, NamedDecl*> ImportedTypedefNamesForLinkage
Declarations that have been imported and have typedef names for linkage purposes.
private llvm::DenseMap<Decl*, llvm::SmallVector<NamedDecl*, 2>> AnonymousDeclarationsForMerging
Mergeable declaration contexts that have anonymous declarations within them, and those anonymous declarations.
private llvm::DenseMap<LETemporaryKey, LifetimeExtendedTemporaryDecl*> LETemporaryForMerging
Map of already deserialiazed temporaries.
private llvm::DenseMap<FileID, FileDeclsInfo> FileDeclIDs
Map from a FileID to the file-level declarations that it contains.
private llvm::DenseMap< const DeclContext*, std::pair<ModuleFile*, LexicalContents>> LexicalDecls
Map from a DeclContext to its lexical contents.
private std::vector< std::pair<ModuleFile*, LexicalContents>> TULexicalDecls
Map from the TU to its lexical contents from each module file.
private llvm::DenseMap< const DeclContext*, serialization::reader::DeclContextLookupTable> Lookups
Map from a DeclContext to its lookup tables.
private llvm::DenseMap<serialization::DeclID, DeclContextVisibleUpdates> PendingVisibleUpdates
Updates to the visible declarations of declaration contexts that haven't been loaded yet.
private llvm::SmallPtrSet<Decl*, 4> PendingDefinitions
The set of C++ or Objective-C classes that have forward declarations that have not yet been linked to their definitions.
private clang::ASTReader::PendingBodiesMap PendingBodies
Functions or methods that have bodies that will be attached.
private llvm::SetVector<NamedDecl*> PendingMergedDefinitionsToDeduplicate
Definitions for which we have added merged definitions but not yet performed deduplication.
private std::vector<IdentifierInfo*> IdentifiersLoaded
If the pointer at index I is non-NULL, then it refers to the IdentifierInfo for the identifier with ID=I+1 that has already been loaded.
private clang::ASTReader::GlobalIdentifierMapType GlobalIdentifierMap
Mapping from global identifier IDs to the module in which the identifier resides along with the offset that should be added to the global identifier ID to produce a local ID.
private std::vector<MacroInfo*> MacrosLoaded
If the pointer at index I is non-NULL, then it refers to the MacroInfo for the identifier with ID=I+1 that has already been loaded.
private llvm::DenseSet<LoadedMacroInfo> LoadedUndefs
A set of #undef directives that we have loaded; used to deduplicate the same #undef information coming from multiple module files.
private clang::ASTReader::GlobalMacroMapType GlobalMacroMap
Mapping from global macro IDs to the module in which the macro resides along with the offset that should be added to the global macro ID to produce a local ID.
private SmallVector<clang::Module*, 2> SubmodulesLoaded
This vector is indexed by the Submodule ID (-1). NULL submodule entries indicate that the particular submodule ID has not yet been loaded.
private clang::ASTReader::GlobalSubmoduleMapType GlobalSubmoduleMap
Mapping from global submodule IDs to the module file in which the submodule resides along with the offset that should be added to the global submodule ID to produce a local ID.
private clang::ASTReader::HiddenNamesMapType HiddenNamesMap
A mapping from each of the hidden submodules to the deserialized declarations in that submodule that could be made visible.
private SmallVector<clang::ASTReader::UnresolvedModuleRef, 2> UnresolvedModuleRefs
The set of module imports and exports that still need to be resolved.
private SmallVector<clang::Selector, 16> SelectorsLoaded
This vector is indexed by the Selector ID (-1). NULL selector entries indicate that the particular selector ID has not yet been loaded.
private clang::ASTReader::GlobalSelectorMapType GlobalSelectorMap
Mapping from global selector IDs to the module in which the global selector ID to produce a local ID.
private llvm::DenseMap<Selector, unsigned int> SelectorGeneration
The generation number of the last time we loaded data from the global method pool for this selector.
private llvm::DenseMap<Selector, bool> SelectorOutOfDate
Whether a selector is out of date. We mark a selector as out of date if we load another module after the method pool entry was pulled in.
private clang::ASTReader::PendingMacroIDsMap PendingMacroIDs
Mapping from identifiers that have a macro history to the global IDs have not yet been deserialized to the global IDs of those macros.
private clang::ASTReader::GlobalPreprocessedEntityMapType GlobalPreprocessedEntityMap
Mapping from global preprocessing entity IDs to the module in which the preprocessed entity resides along with the offset that should be added to the global preprocessing entity ID to produce a local ID.
private clang::ASTReader::GlobalSkippedRangeMapType GlobalSkippedRangeMap
Mapping from global skipped range base IDs to the module in which the skipped ranges reside.
private SmallVector<serialization::DeclID, 16> EagerlyDeserializedDecls
This contains the data loaded from all EAGERLY_DESERIALIZED_DECLS blocks in the chain. The referenced declarations are deserialized and passed to the consumer eagerly.
private SmallVector<serialization::DeclID, 16> TentativeDefinitions
Sema keeps track of all tentative definitions in a TU because it has to complete them and pass them on to CodeGen. Thus, tentative definitions in the PCH chain must be eagerly deserialized.
private SmallVector<serialization::DeclID, 64> VTableUses
CodeGen has to emit VTables for these records, so they have to be eagerly deserialized.
private SmallVector<serialization::DeclID, 64> PendingInstantiations
This record tracks the instantiations that Sema has to perform at the end of the TU. It consists of a pair of values for every pending instantiation where the first value is the ID of the decl and the second is the instantiation location.
private SmallVector<serialization::DeclID, 16> UnusedFileScopedDecls
A snapshot of Sema's unused file-scoped variable tracking, for generating warnings.
private SmallVector<serialization::DeclID, 4> DelegatingCtorDecls
A list of all the delegating constructors we've seen, to diagnose cycles.
private SmallVector<serialization::SelectorID, 64> ReferencedSelectorsData
Method selectors used in a @selectorexpression. Used for implementation of -Wselector.
private SmallVector<serialization::IdentifierID, 64> WeakUndeclaredIdentifiers
A snapshot of Sema's weak undeclared identifier tracking, for generating warnings.
private SmallVector<serialization::DeclID, 4> ExtVectorDecls
Used by Sema for finding sugared names for ext_vectors in diagnostics.
private SmallVector<serialization::DeclID, 16> UnusedLocalTypedefNameCandidates
Sema tracks these to emit warnings.
private unsigned int ForceCUDAHostDeviceDepth = 0
Our current depth in #pragma cuda force_host_device begin/end macros.
private SmallVector<serialization::DeclID, 4> SemaDeclRefs
Sema tracks a few important decls, such as namespace std, directly.
private SmallVector<serialization::TypeID, 16> SpecialTypes
The AST context tracks a few important types, such as va_list, directly.
private SmallVector<serialization::DeclID, 2> CUDASpecialDeclRefs
The AST context tracks a few important decls, currently cudaConfigureCall, directly.
private SmallVector<uint64_t, 1> FPPragmaOptions
The floating point pragma option settings.
private clang::SourceLocation OptimizeOffPragmaLocation
The pragma clang optimize location (if the pragma state is "off").
private int PragmaMSStructState = -1
The PragmaMSStructKind pragma ms_struct state if set, or -1.
private int PragmaMSPointersToMembersState = -1
The PragmaMSPointersToMembersKind pragma pointers_to_members state.
private clang::SourceLocation PointersToMembersPragmaLocation
private Optional<clang::FPOptionsOverride> FpPragmaCurrentValue
The pragma float_control state.
private clang::SourceLocation FpPragmaCurrentLocation
private llvm::SmallVector<FpPragmaStackEntry, 2> FpPragmaStack
private llvm::SmallVector<std::string, 2> FpPragmaStrings
private Optional<Sema::AlignPackInfo> PragmaAlignPackCurrentValue
The pragma align/pack state.
private clang::SourceLocation PragmaAlignPackCurrentLocation
private llvm::SmallVector<PragmaAlignPackStackEntry, 2> PragmaAlignPackStack
private llvm::SmallVector<std::string, 2> PragmaAlignPackStrings
private clang::OpenCLOptions OpenCLExtensions
The OpenCL extension settings.
private llvm::DenseMap<const Type*, std::set<std::string>> OpenCLTypeExtMap
Extensions required by an OpenCL type.
private llvm::DenseMap<const Decl*, std::set<std::string>> OpenCLDeclExtMap
Extensions required by an OpenCL declaration.
private SmallVector<serialization::DeclID, 4> KnownNamespaces
A list of the namespaces we've seen.
private SmallVector<serialization::DeclID, 8> UndefinedButUsed
A list of undefined decls with internal linkage followed by the SourceLocation of a matching ODR-use.
private SmallVector<uint64_t, 8> DelayedDeleteExprs
Delete expressions to analyze at the end of translation unit.
private SmallVector<std::pair<ModuleFile*, SmallVector<uint64_t, 1>>, 4> LateParsedTemplates
private llvm::SmallSetVector<serialization::DeclID, 4> DeclsToCheckForDeferredDiags
Sema tracks these to emit deferred diags.
private SmallVector<clang::ASTReader::ImportedSubmodule, 2> ImportedModules
A list of modules that were imported by precompiled headers or any other non-module AST file.
private std::string isysroot
The system include root to be used when loading the precompiled header.
private clang::DisableValidationForModuleKind DisableValidationKind
Whether to disable the normal validation performed on precompiled headers and module files when they are loaded.
private bool AllowASTWithCompilerErrors
Whether to accept an AST file with compiler errors.
private bool AllowConfigurationMismatch
Whether to accept an AST file that has a different configuration from the current compiler instance.
private bool ValidateSystemInputs
Whether validate system input files.
private bool ValidateASTInputFilesContent
Whether validate headers and module maps using hash based on contents.
private bool UseGlobalIndex
Whether we are allowed to use the global module index.
private bool TriedLoadingGlobalIndex = false
Whether we have tried loading the global module index yet.
private bool ProcessingUpdateRecords = false
Whether we are currently processing update records.
private clang::ASTReader::SwitchCaseMapTy SwitchCaseStmts
Statements usually don't have IDs, but switch cases need them, so that the switch statement can refer to them.
private clang::ASTReader::SwitchCaseMapTy* CurrSwitchCaseStmts
private unsigned int NumSLocEntriesRead = 0
The number of source location entries de-serialized from the PCH file.
private unsigned int TotalNumSLocEntries = 0
The number of source location entries in the chain.
private unsigned int NumStatementsRead = 0
The number of statements (and expressions) de-serialized from the chain.
private unsigned int TotalNumStatements = 0
The total number of statements (and expressions) stored in the chain.
private unsigned int NumMacrosRead = 0
The number of macros de-serialized from the chain.
private unsigned int TotalNumMacros = 0
The total number of macros stored in the chain.
private unsigned int NumIdentifierLookups = 0
The number of lookups into identifier tables.
private unsigned int NumIdentifierLookupHits = 0
The number of lookups into identifier tables that succeed.
private unsigned int NumSelectorsRead = 0
The number of selectors that have been read.
private unsigned int NumMethodPoolEntriesRead = 0
The number of method pool entries that have been read.
private unsigned int NumMethodPoolLookups = 0
The number of times we have looked up a selector in the method pool.
private unsigned int NumMethodPoolHits = 0
The number of times we have looked up a selector in the method pool and found something.
private unsigned int NumMethodPoolTableLookups = 0
The number of times we have looked up a selector in the method pool within a specific module.
private unsigned int NumMethodPoolTableHits = 0
The number of times we have looked up a selector in the method pool within a specific module and found something.
private unsigned int TotalNumMethodPoolEntries = 0
The total number of method pool entries in the selector table.
private unsigned int NumLexicalDeclContextsRead = 0
Number of lexical decl contexts read/total.
private unsigned int TotalLexicalDeclContexts = 0
Number of lexical decl contexts read/total.
private unsigned int NumVisibleDeclContextsRead = 0
Number of visible decl contexts read/total.
private unsigned int TotalVisibleDeclContexts = 0
Number of visible decl contexts read/total.
private uint64_t TotalModulesSizeInBits = 0
Total size of modules, in bits, currently loaded
private unsigned int NumCurrentElementsDeserializing = 0
Number of Decl/types that are currently deserializing.
private bool PassingDeclsToConsumer = false
Set true while we are in the process of passing deserialized "interesting" decls to consumer inside FinishedDeserializing(). This is used as a guard to avoid recursively repeating the process of passing decls to consumer.
private llvm::MapVector<IdentifierInfo*, SmallVector<uint32_t, 4>> PendingIdentifierInfos
The declarations on the identifier chain for these identifiers will be loaded once the recursive loading has completed.
private llvm::SmallMapVector<IdentifierInfo*, SmallVector<NamedDecl*, 2>, 16> PendingFakeLookupResults
The set of lookup results that we have faked in order to support merging of partially deserialized decls but that we have not yet removed.
private llvm::DenseMap<IdentifierInfo*, unsigned int> IdentifierGeneration
The generation number of each identifier, which keeps track of the last time we loaded information about this identifier.
private std::deque<InterestingDecl> PotentiallyInterestingDecls
"Interesting" declarations are those that have data that may need to be emitted, such as inline function definitions or Objective-C protocols.
private SmallVector<std::pair<FunctionDecl*, serialization::TypeID>, 16> PendingFunctionTypes
The list of deduced function types that we have not yet read, because they might contain a deduced return type that refers to a local type declared within the function.
private SmallVector<std::pair<Decl*, uint64_t>, 16> PendingDeclChains
The list of redeclaration chains that still need to be reconstructed, and the local offset to the corresponding list of redeclarations.
private SmallVector<clang::Decl*, 16> PendingIncompleteDeclChains
The list of canonical declarations whose redeclaration chains need to be marked as incomplete once we're done deserializing things.
private std::deque<PendingDeclContextInfo> PendingDeclContextInfos
The DeclContexts for these Decls will be set once recursive loading has been completed.
private llvm::SmallMapVector< DuplicateObjCDecls<ObjCCategoryDecl>, llvm::SmallVector< DuplicateObjCDecls<ObjCIvarDecl>, 4>, 2> PendingObjCExtensionIvarRedeclarations
When resolving duplicate ivars from Objective-C extensions we don't error out immediately but check if can merge identical extensions. Not checking extensions for equality immediately because ivar deserialization isn't over yet at that point.
private llvm::SmallVector<NamedDecl*, 16> PendingOdrMergeChecks
We will check whether the corresponding declaration is in fact missing once recursing loading has been completed.
private llvm::SmallDenseMap< CXXRecordDecl*, llvm::SmallVector<DataPointers, 2>, 2> PendingOdrMergeFailures
Record definitions in which we found an ODR violation.
private llvm::SmallDenseMap< FunctionDecl*, llvm::SmallVector<FunctionDecl*, 2>, 2> PendingFunctionOdrMergeFailures
Function definitions in which we found an ODR violation.
private llvm::SmallDenseMap< EnumDecl*, llvm::SmallVector<EnumDecl*, 2>, 2> PendingEnumOdrMergeFailures
Enum definitions in which we found an ODR violation.
private llvm::SmallPtrSet<DeclContext*, 2> DiagnosedOdrMergeFailures
DeclContexts in which we have diagnosed an ODR violation.
private llvm::SmallPtrSet<ObjCCategoryDecl*, 16> CategoriesDeserialized
The set of Objective-C categories that have been deserialized since the last time the declaration chains were linked.
private SmallVector<clang::ObjCInterfaceDecl*, 16> ObjCClassesLoaded
The set of Objective-C class definitions that have already been loaded, for which we will need to check for categories whenever a new module is loaded.
private clang::ASTReader::KeyDeclsMap KeyDecls
A mapping from canonical declarations to the set of global declaration IDs for key declaration that have been merged with that canonical declaration. A key declaration is a formerly-canonical declaration whose module did not import any other key declaration for that entity. These are the IDs that we use as keys when finding redecl chains.
private llvm::DenseMap<DeclContext*, DeclContext*> MergedDeclContexts
A mapping from DeclContexts to the semantic DeclContext that we are treating as the definition of the entity. This is used, for instance, when merging implicit instantiations of class templates across modules.
private llvm::DenseMap<EnumDecl*, EnumDecl*> EnumDefinitions
A mapping from canonical declarations of enums to their canonical definitions. Only populated when using modules in C++.
private llvm::DenseMap<RecordDecl*, RecordDecl*> RecordDefinitions
A mapping from canonical declarations of records to their canonical definitions. Doesn't cover CXXRecordDecl.
private SmallVector<clang::Stmt*, 16> StmtStack
When reading a Stmt tree, Stmt operands are placed in this stack.
private clang::ASTReader::ReadingKind ReadingKind = Read_None
What kind of records we are reading.
private std::string SuggestedPredefines
In most cases, this string will be empty, because the predefines buffer computed to build the PCH file will be identical to the predefines buffer computed from the command line. However, when there are differences that the PCH reader can work around, this predefines buffer may contain additional definitions.
private llvm::DenseMap<const Decl*, bool> DefinitionSource
public SmallVector<uint64_t, 16> PreloadedDeclIDs
public SmallVector<std::pair<llvm::BitstreamCursor, serialization::ModuleFile*>, 8> CommentsCursors
Cursors for comments blocks.

Method Overview

  • public ASTReader(const clang::ASTReader &)
  • public ASTReader(clang::Preprocessor & PP, clang::InMemoryModuleCache & ModuleCache, clang::ASTContext * Context, const clang::PCHContainerReader & PCHContainerRdr, ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions, llvm::StringRef isysroot = "", clang::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 = {})
  • public void ClearSwitchCaseIDs()
  • public void CompleteRedeclChain(const clang::Decl * D)
  • private clang::ASTReader::RecordLocation DeclCursorForID(serialization::DeclID ID, clang::SourceLocation & Location)
  • public clang::IdentifierInfo * DecodeIdentifierInfo(serialization::IdentifierID ID)
  • public clang::Selector DecodeSelector(serialization::SelectorID Idx)
  • public clang::DiagnosticBuilder Diag(clang::SourceLocation Loc, unsigned int DiagID) const
  • public clang::DiagnosticBuilder Diag(unsigned int DiagID) const
  • private void Error(llvm::StringRef Msg) const
  • private void Error(unsigned int DiagID, llvm::StringRef Arg1 = llvm::StringRef(), llvm::StringRef Arg2 = llvm::StringRef(), llvm::StringRef Arg3 = llvm::StringRef()) const
  • private void Error(llvm::Error && Err) const
  • public void FindExternalLexicalDecls(const clang::DeclContext * DC, llvm::function_ref<bool (Decl::Kind)> IsKindWeWant, SmallVectorImpl<clang::Decl *> & Decls)
  • public bool FindExternalVisibleDeclsByName(const clang::DeclContext * DC, clang::DeclarationName Name)
  • public void FindFileRegionDecls(clang::FileID File, unsigned int Offset, unsigned int Length, SmallVectorImpl<clang::Decl *> & Decls)
  • public void FinishedDeserializing()
  • public void ForgetSema()
  • public clang::Decl * GetDecl(serialization::DeclID ID)
  • public clang::Decl * GetExistingDecl(serialization::DeclID ID)
  • public clang::CXXBaseSpecifier * GetExternalCXXBaseSpecifiers(uint64_t Offset)
  • public clang::CXXCtorInitializer ** GetExternalCXXCtorInitializers(uint64_t Offset)
  • public clang::Decl * GetExternalDecl(uint32_t ID)
  • public clang::Stmt * GetExternalDeclStmt(uint64_t Offset)
  • public clang::Selector GetExternalSelector(serialization::SelectorID ID)
  • public clang::HeaderFileInfo GetHeaderFileInfo(const clang::FileEntry * FE)
  • public clang::IdentifierInfo * GetIdentifier(serialization::IdentifierID ID)
  • public clang::Decl * GetLocalDecl(clang::ASTReader::ModuleFile & F, uint32_t LocalID)
  • public template <typename T>T * GetLocalDeclAs(clang::ASTReader::ModuleFile & F, uint32_t LocalID)
  • public uint32_t GetNumExternalSelectors()
  • public clang::QualType GetType(serialization::TypeID ID)
  • public void InitializeContext()
  • public void InitializeSema(clang::Sema & S)
  • public void LoadSelector(clang::Selector Sel)
  • private void LoadedDecl(unsigned int Index, clang::Decl * D)
  • private static bool ParseDiagnosticOptions(const clang::ASTReader::RecordData & Record, bool Complain, clang::ASTReaderListener & Listener)
  • private static bool ParseFileSystemOptions(const clang::ASTReader::RecordData & Record, bool Complain, clang::ASTReaderListener & Listener)
  • private static bool ParseHeaderSearchOptions(const clang::ASTReader::RecordData & Record, bool Complain, clang::ASTReaderListener & Listener)
  • private static bool ParseLanguageOptions(const clang::ASTReader::RecordData & Record, bool Complain, clang::ASTReaderListener & Listener, bool AllowCompatibleDifferences)
  • private void ParseLineTable(clang::ASTReader::ModuleFile & F, const clang::ASTReader::RecordData & Record)
  • private static bool ParsePreprocessorOptions(const clang::ASTReader::RecordData & Record, bool Complain, clang::ASTReaderListener & Listener, std::string & SuggestedPredefines)
  • private static bool ParseTargetOptions(const clang::ASTReader::RecordData & Record, bool Complain, clang::ASTReaderListener & Listener, bool AllowCompatibleDifferences)
  • private void PassInterestingDeclToConsumer(clang::Decl * D)
  • private void PassInterestingDeclsToConsumer()
  • public void PrintStats()
  • public clang::ASTReader::ASTReadResult ReadAST(llvm::StringRef FileName, clang::ASTReader::ModuleKind Type, clang::SourceLocation ImportLoc, unsigned int ClientLoadCapabilities, SmallVectorImpl<clang::ASTReader::ImportedSubmodule> * Imported = nullptr)
  • private llvm::Error ReadASTBlock(clang::ASTReader::ModuleFile & F, unsigned int ClientLoadCapabilities)
  • private clang::ASTReader::ASTReadResult ReadASTCore(llvm::StringRef FileName, clang::ASTReader::ModuleKind Type, clang::SourceLocation ImportLoc, clang::ASTReader::ModuleFile * ImportedBy, SmallVectorImpl<clang::ASTReader::ImportedModule> & Loaded, off_t ExpectedSize, time_t ExpectedModTime, clang::ASTFileSignature ExpectedSignature, unsigned int ClientLoadCapabilities)
  • public Sema::AlignPackInfo ReadAlignPackInfo(uint32_t Raw) const
  • public static llvm::Error ReadBlockAbbrevs(llvm::BitstreamCursor & Cursor, unsigned int BlockID, uint64_t * StartOfBlockOffset = nullptr)
  • public clang::CXXTemporary * ReadCXXTemporary(clang::ASTReader::ModuleFile & F, const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • public void ReadComments()
  • private clang::ASTReader::ASTReadResult ReadControlBlock(clang::ASTReader::ModuleFile & F, SmallVectorImpl<clang::ASTReader::ImportedModule> & Loaded, const clang::ASTReader::ModuleFile * ImportedBy, unsigned int ClientLoadCapabilities)
  • public clang::Decl * ReadDecl(clang::ASTReader::ModuleFile & F, const clang::ASTReader::RecordData & R, unsigned int & I)
  • public template <typename T>T * ReadDeclAs(clang::ASTReader::ModuleFile & F, const clang::ASTReader::RecordData & R, unsigned int & I)
  • public serialization::DeclID ReadDeclID(clang::ASTReader::ModuleFile & F, const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • private clang::Decl * ReadDeclRecord(serialization::DeclID ID)
  • public void ReadDeclsToCheckForDeferredDiags(llvm::SmallSetVector<Decl *, 4> & Decls)
  • public void ReadDefinedMacros()
  • public void ReadDelegatingConstructors(SmallVectorImpl<clang::CXXConstructorDecl *> & Decls)
  • public clang::Expr * ReadExpr(clang::ASTReader::ModuleFile & F)
  • public void ReadExtVectorDecls(SmallVectorImpl<clang::TypedefNameDecl *> & Decls)
  • private llvm::Error ReadExtensionBlock(clang::ASTReader::ModuleFile & F)
  • public void ReadKnownNamespaces(SmallVectorImpl<clang::NamespaceDecl *> & Namespaces)
  • public void ReadLateParsedTemplates(llvm::MapVector<const FunctionDecl *, std::unique_ptr<LateParsedTemplate>> & LPTMap)
  • private bool ReadLexicalDeclContextStorage(clang::ASTReader::ModuleFile & M, llvm::BitstreamCursor & Cursor, uint64_t Offset, clang::DeclContext * DC)
  • public clang::MacroInfo * ReadMacroRecord(clang::ASTReader::ModuleFile & F, uint64_t Offset)
  • public void ReadMethodPool(clang::Selector Sel)
  • public void ReadMismatchingDeleteExpressions(llvm::MapVector<FieldDecl *, llvm::SmallVector<std::pair<SourceLocation, bool>, 4>> & Exprs)
  • private clang::ASTReader::ASTReadResult ReadModuleMapFileBlock(clang::ASTReader::RecordData & Record, clang::ASTReader::ModuleFile & F, const clang::ASTReader::ModuleFile * ImportedBy, unsigned int ClientLoadCapabilities)
  • private void ReadModuleOffsetMap(clang::ASTReader::ModuleFile & F) const
  • private static clang::ASTReader::ASTReadResult ReadOptionsBlock(llvm::BitstreamCursor & Stream, unsigned int ClientLoadCapabilities, bool AllowCompatibleConfigurationMismatch, clang::ASTReaderListener & Listener, std::string & SuggestedPredefines)
  • public std::string ReadPath(clang::ASTReader::ModuleFile & F, const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • public std::string ReadPath(llvm::StringRef BaseDirectory, const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • public void ReadPendingInstantiations(SmallVectorImpl<std::pair<ValueDecl *, SourceLocation>> & Pending)
  • public void ReadPragmaDiagnosticMappings(clang::DiagnosticsEngine & Diag)
  • public clang::PreprocessedEntity * ReadPreprocessedEntity(unsigned int Index)
  • public void ReadReferencedSelectors(SmallVectorImpl<std::pair<Selector, SourceLocation>> & Sels)
  • public bool ReadSLocEntry(int ID)
  • public clang::Selector ReadSelector(clang::ASTReader::ModuleFile & M, const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • public clang::SourceRange ReadSkippedRange(unsigned int Index)
  • public clang::SourceLocation ReadSourceLocation(clang::ASTReader::ModuleFile & ModuleFile, const clang::ASTReader::RecordDataImpl & Record, unsigned int & Idx, clang::ASTReader::LocSeq * Seq = nullptr)
  • public clang::SourceLocation ReadSourceLocation(clang::ASTReader::ModuleFile & ModuleFile, SourceLocation::UIntTy Raw, clang::ASTReader::LocSeq * Seq = nullptr) const
  • private llvm::Error ReadSourceManagerBlock(clang::ASTReader::ModuleFile & F)
  • public clang::SourceRange ReadSourceRange(clang::ASTReader::ModuleFile & F, const clang::ASTReader::RecordData & Record, unsigned int & Idx, clang::ASTReader::LocSeq * Seq = nullptr)
  • public clang::Stmt * ReadStmt(clang::ASTReader::ModuleFile & F)
  • private clang::Stmt * ReadStmtFromStream(clang::ASTReader::ModuleFile & F)
  • public static std::string ReadString(const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • public clang::Expr * ReadSubExpr()
  • public clang::Stmt * ReadSubStmt()
  • private llvm::Error ReadSubmoduleBlock(clang::ASTReader::ModuleFile & F, unsigned int ClientLoadCapabilities)
  • public void ReadTentativeDefinitions(SmallVectorImpl<clang::VarDecl *> & TentativeDefs)
  • public clang::Token ReadToken(clang::ASTReader::ModuleFile & M, const clang::ASTReader::RecordDataImpl & Record, unsigned int & Idx)
  • public void ReadUndefinedButUsed(llvm::MapVector<NamedDecl *, SourceLocation> & Undefined)
  • public clang::SourceLocation ReadUntranslatedSourceLocation(SourceLocation::UIntTy Raw, clang::ASTReader::LocSeq * Seq = nullptr) const
  • public void ReadUnusedFileScopedDecls(SmallVectorImpl<const clang::DeclaratorDecl *> & Decls)
  • public void ReadUnusedLocalTypedefNameCandidates(llvm::SmallSetVector<const TypedefNameDecl *, 4> & Decls)
  • public void ReadUsedVTables(SmallVectorImpl<clang::ExternalVTableUse> & VTables)
  • public static llvm::VersionTuple ReadVersionTuple(const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • private bool ReadVisibleDeclContextStorage(clang::ASTReader::ModuleFile & M, llvm::BitstreamCursor & Cursor, uint64_t Offset, serialization::DeclID ID)
  • public void ReadWeakUndeclaredIdentifiers(SmallVectorImpl<std::pair<IdentifierInfo *, WeakInfo>> & WI)
  • public void RecordSwitchCaseID(clang::SwitchCase * SC, unsigned int ID)
  • public void ResolveImportedPath(clang::ASTReader::ModuleFile & M, std::string & Filename)
  • public static void ResolveImportedPath(std::string & Filename, llvm::StringRef Prefix)
  • private llvm::BitstreamCursor & SLocCursorForID(int ID)
  • public void SetGloballyVisibleDecls(clang::IdentifierInfo * II, const SmallVectorImpl<uint32_t> & DeclIDs, SmallVectorImpl<clang::Decl *> * Decls = nullptr)
  • public void SetIdentifierInfo(unsigned int ID, clang::IdentifierInfo * II)
  • public static void SkipPath(const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • public static void SkipString(const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • public void StartTranslationUnit(clang::ASTConsumer * Consumer)
  • public void StartedDeserializing()
  • public clang::SourceLocation TranslateSourceLocation(clang::ASTReader::ModuleFile & ModuleFile, clang::SourceLocation Loc) const
  • private clang::ASTReader::RecordLocation TypeCursorForIndex(unsigned int Index)
  • public void UpdateSema()
  • public void addInMemoryBuffer(llvm::StringRef & FileName, std::unique_ptr<llvm::MemoryBuffer> Buffer)
  • public void addListener(std::unique_ptr<ASTReaderListener> L)
  • private void addPendingDeclContextInfo(clang::Decl * D, serialization::GlobalDeclID SemaDC, serialization::GlobalDeclID LexicalDC)
  • public void addPendingMacro(clang::IdentifierInfo * II, clang::ASTReader::ModuleFile * M, uint32_t MacroDirectivesOffset)
  • private bool canRecoverFromOutOfDate(llvm::StringRef ModuleFileName, unsigned int ClientLoadCapabilities)
  • public void completeVisibleDeclsMap(const clang::DeclContext * DC)
  • private void diagnoseOdrViolations()
  • public void dump()
  • public void finalizeForWriting()
  • private serialization::PreprocessedEntityID findNextPreprocessedEntity(GlobalSLocOffsetMapType::const_iterator SLocMapI) const
  • public std::pair<unsigned int, unsigned int> findPreprocessedEntitiesInRange(clang::SourceRange Range)
  • private serialization::PreprocessedEntityID findPreprocessedEntity(clang::SourceLocation Loc, bool EndsAfter) const
  • private void finishPendingActions()
  • public template <typename Fn>void forEachImportedKeyDecl(const clang::Decl * D, Fn Visit)
  • public clang::IdentifierInfo * get(llvm::StringRef Name)
  • public clang::ASTContext & getContext()
  • public clang::ASTDeserializationListener * getDeserializationListener()
  • public clang::DiagnosticsEngine & getDiags() const
  • public clang::FileManager & getFileManager() const
  • private uint64_t getGlobalBitOffset(clang::ASTReader::ModuleFile & M, uint64_t LocalOffset)
  • public serialization::DeclID getGlobalDeclID(clang::ASTReader::ModuleFile & F, serialization::LocalDeclID LocalID) const
  • public serialization::IdentifierID getGlobalIdentifierID(clang::ASTReader::ModuleFile & M, unsigned int LocalID)
  • public clang::GlobalModuleIndex * getGlobalIndex()
  • public serialization::MacroID getGlobalMacroID(clang::ASTReader::ModuleFile & M, unsigned int LocalID)
  • public serialization::PreprocessedEntityID getGlobalPreprocessedEntityID(clang::ASTReader::ModuleFile & M, unsigned int LocalID) const
  • public serialization::SelectorID getGlobalSelectorID(clang::ASTReader::ModuleFile & F, unsigned int LocalID) const
  • public serialization::SubmoduleID getGlobalSubmoduleID(clang::ASTReader::ModuleFile & M, unsigned int LocalID)
  • public serialization::TypeID getGlobalTypeID(clang::ASTReader::ModuleFile & F, unsigned int LocalID) const
  • public clang::IdentifierResolver & getIdResolver()
  • public clang::IdentifierTable & getIdentifierTable()
  • public clang::IdentifierIterator * getIdentifiers()
  • private clang::SourceLocation getImportLocation(clang::ASTReader::ModuleFile * F)
  • private serialization::InputFile getInputFile(clang::ASTReader::ModuleFile & F, unsigned int ID, bool Complain = true)
  • public const clang::Decl * getKeyDeclaration(const clang::Decl * D)
  • public clang::Decl * getKeyDeclaration(clang::Decl * D)
  • public const serialization::reader::DeclContextLookupTable * getLoadedLookupTables(clang::DeclContext * Primary) const
  • private clang::ASTReader::RecordLocation getLocalBitOffset(uint64_t GlobalOffset)
  • public clang::IdentifierInfo * getLocalIdentifier(clang::ASTReader::ModuleFile & M, unsigned int LocalID)
  • public clang::ASTReader::ModuleFile * getLocalModuleFile(clang::ASTReader::ModuleFile & M, unsigned int ID)
  • public clang::Selector getLocalSelector(clang::ASTReader::ModuleFile & M, unsigned int LocalID)
  • public clang::QualType getLocalType(clang::ASTReader::ModuleFile & F, unsigned int LocalID)
  • public clang::MacroInfo * getMacro(serialization::MacroID ID)
  • public void getMemoryBufferSizes(clang::ExternalASTSource::MemoryBufferSizes & sizes) const
  • public clang::Module * getModule(unsigned int ID)
  • public unsigned int getModuleFileID(clang::ASTReader::ModuleFile * M)
  • public llvm::iterator_range<ModuleDeclIterator> getModuleFileLevelDecls(clang::ASTReader::ModuleFile & Mod)
  • public std::pair<SourceLocation, StringRef> getModuleImportLoc(int ID)
  • public clang::ASTReader::ModuleManager & getModuleManager()
  • private llvm::iterator_range<PreprocessingRecord::iterator> getModulePreprocessedEntities(clang::ASTReader::ModuleFile & Mod) const
  • private std::pair<ModuleFile *, unsigned int> getModulePreprocessedEntity(unsigned int GlobalIndex)
  • private clang::Decl * getMostRecentExistingDecl(clang::Decl * D)
  • public static std::string getOriginalSourceFile(const std::string & ASTFileName, clang::FileManager & FileMgr, const clang::PCHContainerReader & PCHContainerRdr, clang::DiagnosticsEngine & Diags)
  • public llvm::StringRef getOriginalSourceFile()
  • public clang::ASTReader::ModuleFile * getOwningModuleFile(const clang::Decl * D)
  • public std::string getOwningModuleNameForDiagnostic(const clang::Decl * D)
  • public clang::Preprocessor & getPreprocessor() const
  • public clang::Sema * getSema()
  • public llvm::Optional<ASTSourceDescriptor> getSourceDescriptor(unsigned int ID)
  • public clang::SourceLocation getSourceLocationForDeclID(serialization::GlobalDeclID ID)
  • public clang::SourceManager & getSourceManager() const
  • public clang::Module * getSubmodule(serialization::SubmoduleID GlobalID)
  • public const std::string & getSuggestedPredefines()
  • public clang::SwitchCase * getSwitchCaseWithID(unsigned int ID)
  • public unsigned int getTotalNumDecls() const
  • public unsigned int getTotalNumIdentifiers() const
  • public unsigned int getTotalNumMacros() const
  • public unsigned int getTotalNumPreprocessedEntities() const
  • public unsigned int getTotalNumSLocs() const
  • public unsigned int getTotalNumSelectors() const
  • public unsigned int getTotalNumSubmodules() const
  • public unsigned int getTotalNumTypes() const
  • public clang::ExternalASTSource::ExtKind hasExternalDefinitions(const clang::Decl * D)
  • public bool hasGlobalIndex() const
  • public static bool isAcceptableASTFile(llvm::StringRef Filename, clang::FileManager & FileMgr, const clang::PCHContainerReader & PCHContainerRdr, const clang::LangOptions & LangOpts, const clang::TargetOptions & TargetOpts, const clang::PreprocessorOptions & PPOpts, llvm::StringRef ExistingModuleCachePath, bool RequireStrictOptionMatches = false)
  • public bool isDeclIDFromModule(serialization::GlobalDeclID ID, clang::ASTReader::ModuleFile & M) const
  • public bool isGlobalIndexUnavailable() const
  • public Optional<bool> isPreprocessedEntityInFileID(unsigned int Index, clang::FileID FID)
  • public bool isProcessingUpdateRecords()
  • private void loadDeclUpdateRecords(clang::ASTReader::PendingUpdateRecord & Record)
  • public bool loadGlobalIndex()
  • private void loadObjCCategories(serialization::GlobalDeclID ID, clang::ObjCInterfaceDecl * D, unsigned int PreviousGeneration = 0)
  • private void loadPendingDeclChain(clang::Decl * D, uint64_t LocalOffset)
  • public void makeModuleVisible(clang::Module * Mod, Module::NameVisibilityKind NameVisibility, clang::SourceLocation ImportLoc)
  • public void makeNamesVisible(const clang::ASTReader::HiddenNames & Names, clang::Module * Owner)
  • public serialization::DeclID mapGlobalIDToModuleFileGlobalID(clang::ASTReader::ModuleFile & M, serialization::DeclID GlobalID)
  • public void markIdentifierUpToDate(clang::IdentifierInfo * II)
  • private void markIncompleteDeclChain(clang::Decl * Canon)
  • public void mergeDefinitionVisibility(clang::NamedDecl * Def, clang::NamedDecl * MergedDef)
  • private void pushExternalDeclIntoScope(clang::NamedDecl * D, clang::DeclarationName Name)
  • public static bool readASTFileControlBlock(llvm::StringRef Filename, clang::FileManager & FileMgr, const clang::PCHContainerReader & PCHContainerRdr, bool FindModuleFileExtensions, clang::ASTReaderListener & Listener, bool ValidateDiagnosticOptions)
  • public clang::IdentifierInfo * readIdentifier(clang::ASTReader::ModuleFile & M, const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • private void readIncludedFiles(clang::ASTReader::ModuleFile & F, llvm::StringRef Blob, clang::Preprocessor & PP)
  • private clang::ASTReader::InputFileInfo readInputFileInfo(clang::ASTReader::ModuleFile & F, unsigned int ID)
  • public clang::QualType readType(clang::ASTReader::ModuleFile & F, const clang::ASTReader::RecordData & Record, unsigned int & Idx)
  • private clang::QualType readTypeRecord(unsigned int Index)
  • private clang::ASTReader::ASTReadResult readUnhashedControlBlock(clang::ASTReader::ModuleFile & F, bool WasImportedBy, unsigned int ClientLoadCapabilities)
  • private static clang::ASTReader::ASTReadResult readUnhashedControlBlockImpl(clang::ASTReader::ModuleFile * F, llvm::StringRef StreamData, unsigned int ClientLoadCapabilities, bool AllowCompatibleConfigurationMismatch, clang::ASTReaderListener * Listener, bool ValidateDiagnosticOptions)
  • public void resetForReload()
  • public void resolvePendingMacro(clang::IdentifierInfo * II, const clang::ASTReader::PendingMacroInfo & PMInfo)
  • public void setDeserializationListener(clang::ASTDeserializationListener * Listener, bool TakeOwnership = false)
  • public void setListener(std::unique_ptr<ASTReaderListener> Listener)
  • private bool shouldDisableValidationForFile(const serialization::ModuleFile & M) const
  • public std::unique_ptr<ASTReaderListener> takeListener()
  • public void updateOutOfDateIdentifier(clang::IdentifierInfo & II)
  • public void updateOutOfDateSelector(clang::Selector Sel)
  • public void visitInputFiles(serialization::ModuleFile & MF, bool IncludeSystem, bool Complain, llvm::function_ref<void (const serialization::InputFile &, bool)> Visitor)
  • public void visitTopLevelModuleMaps(serialization::ModuleFile & MF, llvm::function_ref<void (const FileEntry *)> Visitor)
  • public ~ASTReader()

Inherited from ExternalSLocEntrySource:

Inherited from IdentifierInfoLookup:

Inherited from ExternalSemaSource:

Inherited from ExternalASTSource:

Inherited from ExternalHeaderFileInfoSource:

Inherited from ExternalPreprocessingRecordSource:

Inherited from ExternalPreprocessorSource:

Methods

ASTReader(const clang::ASTReader&)

Declared at: clang/include/clang/Serialization/ASTReader.h:1534

Parameters

const clang::ASTReader&

ASTReader(
    clang::Preprocessor& PP,
    clang::InMemoryModuleCache& ModuleCache,
    clang::ASTContext* Context,
    const clang::PCHContainerReader&
        PCHContainerRdr,
    ArrayRef<std::shared_ptr<ModuleFileExtension>>
        Extensions,
    llvm::StringRef isysroot = "",
    clang::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 = {})

Description

Load the AST file and validate its contents against the given Preprocessor.

Declared at: clang/include/clang/Serialization/ASTReader.h:1522

Parameters

clang::Preprocessor& PP
the preprocessor associated with the context in which this precompiled header will be loaded.
clang::InMemoryModuleCache& ModuleCache
clang::ASTContext* Context
the AST context that this precompiled header will be loaded into, if any.
const clang::PCHContainerReader& PCHContainerRdr
the PCHContainerOperations to use for loading and creating modules.
ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions
the list of module file extensions that can be loaded from the AST files.
llvm::StringRef 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 "/".
clang::DisableValidationForModuleKind DisableValidationKind = DisableValidationForModuleKind::None
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.
bool AllowASTWithCompilerErrors = false
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.
bool AllowConfigurationMismatch = false
If true, the AST reader will not check for configuration differences between the AST file and the invocation.
bool ValidateSystemInputs = false
If true, the AST reader will validate system input files in addition to user input files. This is only meaningful if \p DisableValidation is false.
bool ValidateASTInputFilesContent = false
bool UseGlobalIndex = true
If true, the AST reader will try to load and use the global module index.
std::unique_ptr<llvm::Timer> ReadTimer = {}
If non-null, a timer used to track the time spent deserializing.

void ClearSwitchCaseIDs()

Declared at: clang/include/clang/Serialization/ASTReader.h:2308

void CompleteRedeclChain(const clang::Decl* D)

Description

If any redeclarations of \p D have been imported since it was last checked, this digs out those redeclarations and adds them to the redeclaration chain for \p D.

Declared at: clang/include/clang/Serialization/ASTReader.h:1912

Parameters

const clang::Decl* D

clang::ASTReader::RecordLocation DeclCursorForID(
    serialization::DeclID ID,
    clang::SourceLocation& Location)

Declared at: clang/include/clang/Serialization/ASTReader.h:1387

Parameters

serialization::DeclID ID
clang::SourceLocation& Location

clang::IdentifierInfo* DecodeIdentifierInfo(
    serialization::IdentifierID ID)

Declared at: clang/include/clang/Serialization/ASTReader.h:2073

Parameters

serialization::IdentifierID ID

clang::Selector DecodeSelector(
    serialization::SelectorID Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2138

Parameters

serialization::SelectorID Idx

clang::DiagnosticBuilder Diag(
    clang::SourceLocation Loc,
    unsigned int DiagID) const

Description

Report a diagnostic.

Declared at: clang/include/clang/Serialization/ASTReader.h:2071

Parameters

clang::SourceLocation Loc
unsigned int DiagID

clang::DiagnosticBuilder Diag(
    unsigned int DiagID) const

Description

Report a diagnostic.

Declared at: clang/include/clang/Serialization/ASTReader.h:2068

Parameters

unsigned int DiagID

void Error(llvm::StringRef Msg) const

Description

Produce an error diagnostic and return true. This routine should only be used for fatal errors that have to do with non-routine failures (e.g., corrupted AST file).

Declared at: clang/include/clang/Serialization/ASTReader.h:1477

Parameters

llvm::StringRef Msg

void Error(
    unsigned int DiagID,
    llvm::StringRef Arg1 = llvm::StringRef(),
    llvm::StringRef Arg2 = llvm::StringRef(),
    llvm::StringRef Arg3 =
        llvm::StringRef()) const

Declared at: clang/include/clang/Serialization/ASTReader.h:1478

Parameters

unsigned int DiagID
llvm::StringRef Arg1 = llvm::StringRef()
llvm::StringRef Arg2 = llvm::StringRef()
llvm::StringRef Arg3 = llvm::StringRef()

void Error(llvm::Error&& Err) const

Declared at: clang/include/clang/Serialization/ASTReader.h:1480

Parameters

llvm::Error&& Err

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

Description

Read all of the declarations lexically stored in a declaration context.

Declared at: clang/include/clang/Serialization/ASTReader.h:1950

Parameters

const clang::DeclContext* DC
The declaration context whose declarations will be read.
llvm::function_ref<bool(Decl::Kind)> IsKindWeWant
A predicate indicating which declaration kinds we are interested in.
SmallVectorImpl<clang::Decl*>& 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.

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

Description

Finds all the visible declarations with a given name. The current implementation of this method just loads the entire lookup table as unmaterialized references.

Declared at: clang/include/clang/Serialization/ASTReader.h:1933

Parameters

const clang::DeclContext* DC
clang::DeclarationName Name

void FindFileRegionDecls(
    clang::FileID File,
    unsigned int Offset,
    unsigned int Length,
    SmallVectorImpl<clang::Decl*>& Decls)

Description

Get the decls that are contained in a file in the Offset/Length range. \p Length can be 0 to indicate a point at \p Offset instead of a range.

Declared at: clang/include/clang/Serialization/ASTReader.h:1957

Parameters

clang::FileID File
unsigned int Offset
unsigned int Length
SmallVectorImpl<clang::Decl*>& Decls

void FinishedDeserializing()

Description

Notify ASTReader that we finished the deserialization of a decl or type. Must be paired with StartedDeserializing.

Declared at: clang/include/clang/Serialization/ASTReader.h:1967

void ForgetSema()

Description

Inform the semantic consumer that Sema is no longer available.

Declared at: clang/include/clang/Serialization/ASTReader.h:1992

clang::Decl* GetDecl(serialization::DeclID ID)

Description

Resolve a declaration ID into a declaration, potentially building a new declaration.

Declared at: clang/include/clang/Serialization/ASTReader.h:1857

Parameters

serialization::DeclID ID

clang::Decl* GetExistingDecl(
    serialization::DeclID ID)

Description

Resolve a declaration ID into a declaration. Return 0 if it's not been loaded yet.

Declared at: clang/include/clang/Serialization/ASTReader.h:1862

Parameters

serialization::DeclID ID

clang::CXXBaseSpecifier*
GetExternalCXXBaseSpecifiers(uint64_t Offset)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:1914

Parameters

uint64_t Offset

clang::CXXCtorInitializer**
GetExternalCXXCtorInitializers(uint64_t Offset)

Description

Read the contents of a CXXCtorInitializer array.

Declared at: clang/include/clang/Serialization/ASTReader.h:2153

Parameters

uint64_t Offset

clang::Decl* GetExternalDecl(uint32_t ID)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:1858

Parameters

uint32_t ID

clang::Stmt* GetExternalDeclStmt(uint64_t Offset)

Description

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).

Declared at: clang/include/clang/Serialization/ASTReader.h:1921

Parameters

uint64_t Offset

clang::Selector GetExternalSelector(
    serialization::SelectorID ID)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2140

Parameters

serialization::SelectorID ID

clang::HeaderFileInfo GetHeaderFileInfo(
    const clang::FileEntry* FE)

Description

Read the header file information for the given file entry.

Declared at: clang/include/clang/Serialization/ASTReader.h:1769

Parameters

const clang::FileEntry* FE

clang::IdentifierInfo* GetIdentifier(
    serialization::IdentifierID ID)

Description

Return the identifier associated with the given ID number. The ID 0 is associated with the NULL identifier.

Declared at: clang/include/clang/Serialization/ASTReader.h:2080

Parameters

serialization::IdentifierID ID

clang::Decl* GetLocalDecl(
    clang::ASTReader::ModuleFile& F,
    uint32_t LocalID)

Description

Reads a declaration with the given local ID in the given module.

Declared at: clang/include/clang/Serialization/ASTReader.h:1865

Parameters

clang::ASTReader::ModuleFile& F
uint32_t LocalID

template <typename T>
T* GetLocalDeclAs(clang::ASTReader::ModuleFile& F,
                  uint32_t LocalID)

Description

Reads a declaration with the given local ID in the given module.

Declared at: clang/include/clang/Serialization/ASTReader.h:1873

Templates

T

Parameters

clang::ASTReader::ModuleFile& F
uint32_t LocalID

Returns

The requested declaration, casted to the given return type.

uint32_t GetNumExternalSelectors()

Description

Returns the number of selectors known to the external AST source. The default implementation of this method is a no-op.

Declared at: clang/include/clang/Serialization/ASTReader.h:2141

clang::QualType GetType(serialization::TypeID ID)

Description

Resolve a type ID into a type, potentially building a new type.

Declared at: clang/include/clang/Serialization/ASTReader.h:1819

Parameters

serialization::TypeID ID

void InitializeContext()

Description

Initializes the ASTContext

Declared at: clang/include/clang/Serialization/ASTReader.h:1687

void InitializeSema(clang::Sema& S)

Description

Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree.

Declared at: clang/include/clang/Serialization/ASTReader.h:1989

Parameters

clang::Sema& S

void LoadSelector(clang::Selector Sel)

Description

Load a selector from disk, registering its ID if it exists.

Declared at: clang/include/clang/Serialization/ASTReader.h:2060

Parameters

clang::Selector Sel

void LoadedDecl(unsigned int Index,
                clang::Decl* D)

Declared at: clang/include/clang/Serialization/ASTReader.h:1378

Parameters

unsigned int Index
clang::Decl* D

static bool ParseDiagnosticOptions(
    const clang::ASTReader::RecordData& Record,
    bool Complain,
    clang::ASTReaderListener& Listener)

Declared at: clang/include/clang/Serialization/ASTReader.h:1359

Parameters

const clang::ASTReader::RecordData& Record
bool Complain
clang::ASTReaderListener& Listener

static bool ParseFileSystemOptions(
    const clang::ASTReader::RecordData& Record,
    bool Complain,
    clang::ASTReaderListener& Listener)

Declared at: clang/include/clang/Serialization/ASTReader.h:1361

Parameters

const clang::ASTReader::RecordData& Record
bool Complain
clang::ASTReaderListener& Listener

static bool ParseHeaderSearchOptions(
    const clang::ASTReader::RecordData& Record,
    bool Complain,
    clang::ASTReaderListener& Listener)

Declared at: clang/include/clang/Serialization/ASTReader.h:1363

Parameters

const clang::ASTReader::RecordData& Record
bool Complain
clang::ASTReaderListener& Listener

static bool ParseLanguageOptions(
    const clang::ASTReader::RecordData& Record,
    bool Complain,
    clang::ASTReaderListener& Listener,
    bool AllowCompatibleDifferences)

Declared at: clang/include/clang/Serialization/ASTReader.h:1353

Parameters

const clang::ASTReader::RecordData& Record
bool Complain
clang::ASTReaderListener& Listener
bool AllowCompatibleDifferences

void ParseLineTable(
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::RecordData& Record)

Declared at: clang/include/clang/Serialization/ASTReader.h:1343

Parameters

clang::ASTReader::ModuleFile& F
const clang::ASTReader::RecordData& Record

static bool ParsePreprocessorOptions(
    const clang::ASTReader::RecordData& Record,
    bool Complain,
    clang::ASTReaderListener& Listener,
    std::string& SuggestedPredefines)

Declared at: clang/include/clang/Serialization/ASTReader.h:1365

Parameters

const clang::ASTReader::RecordData& Record
bool Complain
clang::ASTReaderListener& Listener
std::string& SuggestedPredefines

static bool ParseTargetOptions(
    const clang::ASTReader::RecordData& Record,
    bool Complain,
    clang::ASTReaderListener& Listener,
    bool AllowCompatibleDifferences)

Declared at: clang/include/clang/Serialization/ASTReader.h:1356

Parameters

const clang::ASTReader::RecordData& Record
bool Complain
clang::ASTReaderListener& Listener
bool AllowCompatibleDifferences

void PassInterestingDeclToConsumer(clang::Decl* D)

Declared at: clang/include/clang/Serialization/ASTReader.h:1458

Parameters

clang::Decl* D

void PassInterestingDeclsToConsumer()

Declared at: clang/include/clang/Serialization/ASTReader.h:1457

void PrintStats()

Description

Print some statistics about AST usage.

Declared at: clang/include/clang/Serialization/ASTReader.h:1977

clang::ASTReader::ASTReadResult ReadAST(
    llvm::StringRef FileName,
    clang::ASTReader::ModuleKind Type,
    clang::SourceLocation ImportLoc,
    unsigned int ClientLoadCapabilities,
    SmallVectorImpl<
        clang::ASTReader::ImportedSubmodule>*
        Imported = nullptr)

Description

Load the AST file designated by the given file name.

Declared at: clang/include/clang/Serialization/ASTReader.h:1589

Parameters

llvm::StringRef FileName
The name of the AST file to load.
clang::ASTReader::ModuleKind Type
The kind of AST being loaded, e.g., PCH, module, main file, or preamble.
clang::SourceLocation ImportLoc
the location where the module file will be considered as imported from. For non-module AST types it should be invalid.
unsigned int ClientLoadCapabilities
The set of client load-failure capabilities, represented as a bitset of the enumerators of LoadFailureCapabilities.
SmallVectorImpl< clang::ASTReader::ImportedSubmodule>* Imported = nullptr
optional out-parameter to append the list of modules that were imported by precompiled headers or any other non-module AST file

llvm::Error ReadASTBlock(
    clang::ASTReader::ModuleFile& F,
    unsigned int ClientLoadCapabilities)

Declared at: clang/include/clang/Serialization/ASTReader.h:1340

Parameters

clang::ASTReader::ModuleFile& F
unsigned int ClientLoadCapabilities

clang::ASTReader::ASTReadResult ReadASTCore(
    llvm::StringRef FileName,
    clang::ASTReader::ModuleKind Type,
    clang::SourceLocation ImportLoc,
    clang::ASTReader::ModuleFile* ImportedBy,
    SmallVectorImpl<
        clang::ASTReader::ImportedModule>& Loaded,
    off_t ExpectedSize,
    time_t ExpectedModTime,
    clang::ASTFileSignature ExpectedSignature,
    unsigned int ClientLoadCapabilities)

Declared at: clang/include/clang/Serialization/ASTReader.h:1311

Parameters

llvm::StringRef FileName
clang::ASTReader::ModuleKind Type
clang::SourceLocation ImportLoc
clang::ASTReader::ModuleFile* ImportedBy
SmallVectorImpl<clang::ASTReader::ImportedModule>& Loaded
off_t ExpectedSize
time_t ExpectedModTime
clang::ASTFileSignature ExpectedSignature
unsigned int ClientLoadCapabilities

Sema::AlignPackInfo ReadAlignPackInfo(
    uint32_t Raw) const

Description

Read a AlignPackInfo from raw form.

Declared at: clang/include/clang/Serialization/ASTReader.h:2156

Parameters

uint32_t Raw

static llvm::Error ReadBlockAbbrevs(
    llvm::BitstreamCursor& Cursor,
    unsigned int BlockID,
    uint64_t* StartOfBlockOffset = nullptr)

Description

ReadBlockAbbrevs - 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.

Declared at: clang/include/clang/Serialization/ASTReader.h:1926

Parameters

llvm::BitstreamCursor& Cursor
unsigned int BlockID
uint64_t* StartOfBlockOffset = nullptr

clang::CXXTemporary* ReadCXXTemporary(
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2223

Parameters

clang::ASTReader::ModuleFile& F
const clang::ASTReader::RecordData& Record
unsigned int& Idx

void ReadComments()

Description

Loads comments ranges.

Declared at: clang/include/clang/Serialization/ASTReader.h:2315

clang::ASTReader::ASTReadResult ReadControlBlock(
    clang::ASTReader::ModuleFile& F,
    SmallVectorImpl<
        clang::ASTReader::ImportedModule>& Loaded,
    const clang::ASTReader::ModuleFile*
        ImportedBy,
    unsigned int ClientLoadCapabilities)

Declared at: clang/include/clang/Serialization/ASTReader.h:1317

Parameters

clang::ASTReader::ModuleFile& F
SmallVectorImpl<clang::ASTReader::ImportedModule>& Loaded
const clang::ASTReader::ModuleFile* ImportedBy
unsigned int ClientLoadCapabilities

clang::Decl* ReadDecl(
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::RecordData& R,
    unsigned int& I)

Description

Reads a declaration from the given position in a record in the given module.

Declared at: clang/include/clang/Serialization/ASTReader.h:1895

Parameters

clang::ASTReader::ModuleFile& F
const clang::ASTReader::RecordData& R
unsigned int& I

template <typename T>
T* ReadDeclAs(
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::RecordData& R,
    unsigned int& I)

Description

Reads a declaration from the given position in a record in the given module.

Declared at: clang/include/clang/Serialization/ASTReader.h:1905

Templates

T

Parameters

clang::ASTReader::ModuleFile& F
const clang::ASTReader::RecordData& R
unsigned int& I

Returns

The declaration read from this location, casted to the given result type.

serialization::DeclID ReadDeclID(
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Description

Reads a declaration ID from the given position in a record in the given module.

Declared at: clang/include/clang/Serialization/ASTReader.h:1890

Parameters

clang::ASTReader::ModuleFile& F
const clang::ASTReader::RecordData& Record
unsigned int& Idx

Returns

The declaration ID read from the record, adjusted to a global ID.

clang::Decl* ReadDeclRecord(
    serialization::DeclID ID)

Declared at: clang/include/clang/Serialization/ASTReader.h:1379

Parameters

serialization::DeclID ID

void ReadDeclsToCheckForDeferredDiags(
    llvm::SmallSetVector<Decl*, 4>& Decls)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2040

Parameters

llvm::SmallSetVector<Decl*, 4>& Decls

void ReadDefinedMacros()

Description

Read the set of macros defined by this external macro source.

Declared at: clang/include/clang/Serialization/ASTReader.h:2266

void ReadDelegatingConstructors(
    SmallVectorImpl<clang::CXXConstructorDecl*>&
        Decls)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2032

Parameters

SmallVectorImpl<clang::CXXConstructorDecl*>& Decls

clang::Expr* ReadExpr(
    clang::ASTReader::ModuleFile& F)

Description

Reads an expression.

Declared at: clang/include/clang/Serialization/ASTReader.h:2230

Parameters

clang::ASTReader::ModuleFile& F

void ReadExtVectorDecls(
    SmallVectorImpl<clang::TypedefNameDecl*>&
        Decls)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2035

Parameters

SmallVectorImpl<clang::TypedefNameDecl*>& Decls

llvm::Error ReadExtensionBlock(
    clang::ASTReader::ModuleFile& F)

Declared at: clang/include/clang/Serialization/ASTReader.h:1341

Parameters

clang::ASTReader::ModuleFile& F

void ReadKnownNamespaces(
    SmallVectorImpl<clang::NamespaceDecl*>&
        Namespaces)

Description

Load the set of namespaces that are known to the external source, which will be used during typo correction.

Declared at: clang/include/clang/Serialization/ASTReader.h:2016

Parameters

SmallVectorImpl<clang::NamespaceDecl*>& Namespaces

void ReadLateParsedTemplates(
    llvm::MapVector<
        const FunctionDecl*,
        std::unique_ptr<LateParsedTemplate>>&
        LPTMap)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2055

Parameters

llvm::MapVector< const FunctionDecl*, std::unique_ptr<LateParsedTemplate>>& LPTMap

bool ReadLexicalDeclContextStorage(
    clang::ASTReader::ModuleFile& M,
    llvm::BitstreamCursor& Cursor,
    uint64_t Offset,
    clang::DeclContext* DC)

Description

Read the record that describes the lexical contents of a DC.

Declared at: clang/include/clang/Serialization/ASTReader.h:612

Parameters

clang::ASTReader::ModuleFile& M
llvm::BitstreamCursor& Cursor
uint64_t Offset
clang::DeclContext* DC

clang::MacroInfo* ReadMacroRecord(
    clang::ASTReader::ModuleFile& F,
    uint64_t Offset)

Description

Reads the macro record located at the given offset.

Declared at: clang/include/clang/Serialization/ASTReader.h:2249

Parameters

clang::ASTReader::ModuleFile& F
uint64_t Offset

void ReadMethodPool(clang::Selector Sel)

Description

Load the contents of the global method pool for a given selector.

Declared at: clang/include/clang/Serialization/ASTReader.h:2008

Parameters

clang::Selector Sel

void ReadMismatchingDeleteExpressions(
    llvm::MapVector<
        FieldDecl*,
        llvm::SmallVector<
            std::pair<SourceLocation, bool>,
            4>>& Exprs)

Declared at: clang/include/clang/Serialization/ASTReader.h:2022

Parameters

llvm::MapVector< FieldDecl*, llvm::SmallVector< std::pair<SourceLocation, bool>, 4>>& Exprs

clang::ASTReader::ASTReadResult
ReadModuleMapFileBlock(
    clang::ASTReader::RecordData& Record,
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::ModuleFile*
        ImportedBy,
    unsigned int ClientLoadCapabilities)

Declared at: clang/include/clang/Serialization/ASTReader.h:1348

Parameters

clang::ASTReader::RecordData& Record
clang::ASTReader::ModuleFile& F
const clang::ASTReader::ModuleFile* ImportedBy
unsigned int ClientLoadCapabilities

void ReadModuleOffsetMap(
    clang::ASTReader::ModuleFile& F) const

Declared at: clang/include/clang/Serialization/ASTReader.h:1342

Parameters

clang::ASTReader::ModuleFile& F

static clang::ASTReader::ASTReadResult
ReadOptionsBlock(
    llvm::BitstreamCursor& Stream,
    unsigned int ClientLoadCapabilities,
    bool AllowCompatibleConfigurationMismatch,
    clang::ASTReaderListener& Listener,
    std::string& SuggestedPredefines)

Declared at: clang/include/clang/Serialization/ASTReader.h:1321

Parameters

llvm::BitstreamCursor& Stream
unsigned int ClientLoadCapabilities
bool AllowCompatibleConfigurationMismatch
clang::ASTReaderListener& Listener
std::string& SuggestedPredefines

std::string ReadPath(
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2209

Parameters

clang::ASTReader::ModuleFile& F
const clang::ASTReader::RecordData& Record
unsigned int& Idx

std::string ReadPath(
    llvm::StringRef BaseDirectory,
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2212

Parameters

llvm::StringRef BaseDirectory
const clang::ASTReader::RecordData& Record
unsigned int& Idx

void ReadPendingInstantiations(
    SmallVectorImpl<
        std::pair<ValueDecl*, SourceLocation>>&
        Pending)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2051

Parameters

SmallVectorImpl< std::pair<ValueDecl*, SourceLocation>>& Pending

void ReadPragmaDiagnosticMappings(
    clang::DiagnosticsEngine& Diag)

Declared at: clang/include/clang/Serialization/ASTReader.h:1771

Parameters

clang::DiagnosticsEngine& Diag

clang::PreprocessedEntity* ReadPreprocessedEntity(
    unsigned int Index)

Description

Read a preallocated preprocessed entity from the external source.

Declared at: clang/include/clang/Serialization/ASTReader.h:1753

Parameters

unsigned int Index

Returns

null if an error occurred that prevented the preprocessed entity from being loaded.

void ReadReferencedSelectors(
    SmallVectorImpl<
        std::pair<Selector, SourceLocation>>&
        Sels)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2043

Parameters

SmallVectorImpl< std::pair<Selector, SourceLocation>>& Sels

bool ReadSLocEntry(int ID)

Description

Read the source location entry with index ID.

Declared at: clang/include/clang/Serialization/ASTReader.h:2102

Parameters

int ID

clang::Selector ReadSelector(
    clang::ASTReader::ModuleFile& M,
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2143

Parameters

clang::ASTReader::ModuleFile& M
const clang::ASTReader::RecordData& Record
unsigned int& Idx

clang::SourceRange ReadSkippedRange(
    unsigned int Index)

Description

Read a preallocated skipped range from the external source.

Declared at: clang/include/clang/Serialization/ASTReader.h:1766

Parameters

unsigned int Index

clang::SourceLocation ReadSourceLocation(
    clang::ASTReader::ModuleFile& ModuleFile,
    const clang::ASTReader::RecordDataImpl&
        Record,
    unsigned int& Idx,
    clang::ASTReader::LocSeq* Seq = nullptr)

Description

Read a source location.

Declared at: clang/include/clang/Serialization/ASTReader.h:2190

Parameters

clang::ASTReader::ModuleFile& ModuleFile
const clang::ASTReader::RecordDataImpl& Record
unsigned int& Idx
clang::ASTReader::LocSeq* Seq = nullptr

clang::SourceLocation ReadSourceLocation(
    clang::ASTReader::ModuleFile& ModuleFile,
    SourceLocation::UIntTy Raw,
    clang::ASTReader::LocSeq* Seq = nullptr) const

Description

Read a source location from raw form.

Declared at: clang/include/clang/Serialization/ASTReader.h:2168

Parameters

clang::ASTReader::ModuleFile& ModuleFile
SourceLocation::UIntTy Raw
clang::ASTReader::LocSeq* Seq = nullptr

llvm::Error ReadSourceManagerBlock(
    clang::ASTReader::ModuleFile& F)

Declared at: clang/include/clang/Serialization/ASTReader.h:1344

Parameters

clang::ASTReader::ModuleFile& F

clang::SourceRange ReadSourceRange(
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx,
    clang::ASTReader::LocSeq* Seq = nullptr)

Description

Read a source range.

Declared at: clang/include/clang/Serialization/ASTReader.h:2197

Parameters

clang::ASTReader::ModuleFile& F
const clang::ASTReader::RecordData& Record
unsigned int& Idx
clang::ASTReader::LocSeq* Seq = nullptr

clang::Stmt* ReadStmt(
    clang::ASTReader::ModuleFile& F)

Description

Reads a statement.

Declared at: clang/include/clang/Serialization/ASTReader.h:2227

Parameters

clang::ASTReader::ModuleFile& F

clang::Stmt* ReadStmtFromStream(
    clang::ASTReader::ModuleFile& F)

Description

Reads a statement from the specified cursor.

Declared at: clang/include/clang/Serialization/ASTReader.h:1241

Parameters

clang::ASTReader::ModuleFile& F

static std::string ReadString(
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2201

Parameters

const clang::ASTReader::RecordData& Record
unsigned int& Idx

clang::Expr* ReadSubExpr()

Description

Reads a sub-expression operand during statement reading.

Declared at: clang/include/clang/Serialization/ASTReader.h:2243

clang::Stmt* ReadSubStmt()

Description

Reads a sub-statement operand during statement reading.

Declared at: clang/include/clang/Serialization/ASTReader.h:2233

llvm::Error ReadSubmoduleBlock(
    clang::ASTReader::ModuleFile& F,
    unsigned int ClientLoadCapabilities)

Declared at: clang/include/clang/Serialization/ASTReader.h:1351

Parameters

clang::ASTReader::ModuleFile& F
unsigned int ClientLoadCapabilities

void ReadTentativeDefinitions(
    SmallVectorImpl<clang::VarDecl*>&
        TentativeDefs)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2026

Parameters

SmallVectorImpl<clang::VarDecl*>& TentativeDefs

clang::Token ReadToken(
    clang::ASTReader::ModuleFile& M,
    const clang::ASTReader::RecordDataImpl&
        Record,
    unsigned int& Idx)

Description

Reads a token out of a record.

Declared at: clang/include/clang/Serialization/ASTReader.h:2246

Parameters

clang::ASTReader::ModuleFile& M
const clang::ASTReader::RecordDataImpl& Record
unsigned int& Idx

void ReadUndefinedButUsed(
    llvm::MapVector<NamedDecl*, SourceLocation>&
        Undefined)

Description

Load the set of used but not defined functions or variables with internal linkage, or used but not defined internal functions.

Declared at: clang/include/clang/Serialization/ASTReader.h:2019

Parameters

llvm::MapVector<NamedDecl*, SourceLocation>& Undefined

clang::SourceLocation
ReadUntranslatedSourceLocation(
    SourceLocation::UIntTy Raw,
    clang::ASTReader::LocSeq* Seq = nullptr) const

Description

Read a source location from raw form and return it in its originating module file's source location space.

Declared at: clang/include/clang/Serialization/ASTReader.h:2162

Parameters

SourceLocation::UIntTy Raw
clang::ASTReader::LocSeq* Seq = nullptr

void ReadUnusedFileScopedDecls(
    SmallVectorImpl<const clang::DeclaratorDecl*>&
        Decls)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2029

Parameters

SmallVectorImpl<const clang::DeclaratorDecl*>& Decls

void ReadUnusedLocalTypedefNameCandidates(
    llvm::SmallSetVector<const TypedefNameDecl*,
                         4>& Decls)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2037

Parameters

llvm::SmallSetVector<const TypedefNameDecl*, 4>& Decls

void ReadUsedVTables(
    SmallVectorImpl<clang::ExternalVTableUse>&
        VTables)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2049

Parameters

SmallVectorImpl<clang::ExternalVTableUse>& VTables

static llvm::VersionTuple ReadVersionTuple(
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Description

Read a version tuple.

Declared at: clang/include/clang/Serialization/ASTReader.h:2221

Parameters

const clang::ASTReader::RecordData& Record
unsigned int& Idx

bool ReadVisibleDeclContextStorage(
    clang::ASTReader::ModuleFile& M,
    llvm::BitstreamCursor& Cursor,
    uint64_t Offset,
    serialization::DeclID ID)

Description

Read the record that describes the visible contents of a DC.

Declared at: clang/include/clang/Serialization/ASTReader.h:617

Parameters

clang::ASTReader::ModuleFile& M
llvm::BitstreamCursor& Cursor
uint64_t Offset
serialization::DeclID ID

void ReadWeakUndeclaredIdentifiers(
    SmallVectorImpl<
        std::pair<IdentifierInfo*, WeakInfo>>& WI)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2046

Parameters

SmallVectorImpl< std::pair<IdentifierInfo*, WeakInfo>>& WI

void RecordSwitchCaseID(clang::SwitchCase* SC,
                        unsigned int ID)

Description

Record that the given ID maps to the given switch-case statement.

Declared at: clang/include/clang/Serialization/ASTReader.h:2303

Parameters

clang::SwitchCase* SC
unsigned int ID

void ResolveImportedPath(
    clang::ASTReader::ModuleFile& M,
    std::string& Filename)

Declared at: clang/include/clang/Serialization/ASTReader.h:1262

Parameters

clang::ASTReader::ModuleFile& M
std::string& Filename

static void ResolveImportedPath(
    std::string& Filename,
    llvm::StringRef Prefix)

Declared at: clang/include/clang/Serialization/ASTReader.h:1263

Parameters

std::string& Filename
llvm::StringRef Prefix

llvm::BitstreamCursor& SLocCursorForID(int ID)

Declared at: clang/include/clang/Serialization/ASTReader.h:1345

Parameters

int ID

void SetGloballyVisibleDecls(
    clang::IdentifierInfo* II,
    const SmallVectorImpl<uint32_t>& DeclIDs,
    SmallVectorImpl<clang::Decl*>* Decls =
        nullptr)

Declared at: clang/include/clang/Serialization/ASTReader.h:2063

Parameters

clang::IdentifierInfo* II
const SmallVectorImpl<uint32_t>& DeclIDs
SmallVectorImpl<clang::Decl*>* Decls = nullptr

void SetIdentifierInfo(unsigned int ID,
                       clang::IdentifierInfo* II)

Declared at: clang/include/clang/Serialization/ASTReader.h:2062

Parameters

unsigned int ID
clang::IdentifierInfo* II

static void SkipPath(
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2216

Parameters

const clang::ASTReader::RecordData& Record
unsigned int& Idx

static void SkipString(
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2204

Parameters

const clang::ASTReader::RecordData& Record
unsigned int& Idx

void StartTranslationUnit(
    clang::ASTConsumer* Consumer)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:1974

Parameters

clang::ASTConsumer* Consumer

void StartedDeserializing()

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:1963

clang::SourceLocation TranslateSourceLocation(
    clang::ASTReader::ModuleFile& ModuleFile,
    clang::SourceLocation Loc) const

Description

Translate a source location from another module file's source location space into ours.

Declared at: clang/include/clang/Serialization/ASTReader.h:2177

Parameters

clang::ASTReader::ModuleFile& ModuleFile
clang::SourceLocation Loc

clang::ASTReader::RecordLocation
TypeCursorForIndex(unsigned int Index)

Declared at: clang/include/clang/Serialization/ASTReader.h:1377

Parameters

unsigned int Index

void UpdateSema()

Description

Update the state of Sema after loading some additional modules.

Declared at: clang/include/clang/Serialization/ASTReader.h:1690

void addInMemoryBuffer(
    llvm::StringRef& FileName,
    std::unique_ptr<llvm::MemoryBuffer> Buffer)

Description

Add in-memory (virtual file) buffer.

Declared at: clang/include/clang/Serialization/ASTReader.h:1693

Parameters

llvm::StringRef& FileName
std::unique_ptr<llvm::MemoryBuffer> Buffer

void addListener(
    std::unique_ptr<ASTReaderListener> L)

Description

Add an AST callback listener. Takes ownership of \p L.

Declared at: clang/include/clang/Serialization/ASTReader.h:1627

Parameters

std::unique_ptr<ASTReaderListener> L

void addPendingDeclContextInfo(
    clang::Decl* D,
    serialization::GlobalDeclID SemaDC,
    serialization::GlobalDeclID LexicalDC)

Declared at: clang/include/clang/Serialization/ASTReader.h:1465

Parameters

clang::Decl* D
serialization::GlobalDeclID SemaDC
serialization::GlobalDeclID LexicalDC

void addPendingMacro(
    clang::IdentifierInfo* II,
    clang::ASTReader::ModuleFile* M,
    uint32_t MacroDirectivesOffset)

Description

Add a macro to deserialize its macro directive history.

Declared at: clang/include/clang/Serialization/ASTReader.h:2262

Parameters

clang::IdentifierInfo* II
The name of the macro.
clang::ASTReader::ModuleFile* M
The module file.
uint32_t MacroDirectivesOffset
Offset of the serialized macro directive history.

bool canRecoverFromOutOfDate(
    llvm::StringRef ModuleFileName,
    unsigned int ClientLoadCapabilities)

Declared at: clang/include/clang/Serialization/ASTReader.h:1422

Parameters

llvm::StringRef ModuleFileName
unsigned int ClientLoadCapabilities

void completeVisibleDeclsMap(
    const clang::DeclContext* DC)

Description

Load all external visible decls in the given DeclContext.

Declared at: clang/include/clang/Serialization/ASTReader.h:2275

Parameters

const clang::DeclContext* DC

void diagnoseOdrViolations()

Declared at: clang/include/clang/Serialization/ASTReader.h:1461

void dump()

Description

Dump information about the AST reader to standard error.

Declared at: clang/include/clang/Serialization/ASTReader.h:1980

void finalizeForWriting()

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:1703

serialization::PreprocessedEntityID
findNextPreprocessedEntity(
    GlobalSLocOffsetMapType::const_iterator
        SLocMapI) const

Description

Find the next module that contains entities and return the ID of the first entry.

Declared at: clang/include/clang/Serialization/ASTReader.h:1409

Parameters

GlobalSLocOffsetMapType::const_iterator SLocMapI
points at a chunk of a module that contains no preprocessed entities or the entities it contains are not the ones we are looking for.

std::pair<unsigned int, unsigned int>
findPreprocessedEntitiesInRange(
    clang::SourceRange Range)

Description

Returns a pair of [Begin, End) indices of preallocated preprocessed entities that \p Range encompasses.

Declared at: clang/include/clang/Serialization/ASTReader.h:1758

Parameters

clang::SourceRange Range

serialization::PreprocessedEntityID
findPreprocessedEntity(clang::SourceLocation Loc,
                       bool EndsAfter) const

Description

Returns the first preprocessed entity ID that begins or ends after

Declared at: clang/include/clang/Serialization/ASTReader.h:1400

Parameters

clang::SourceLocation Loc
bool EndsAfter

void finishPendingActions()

Declared at: clang/include/clang/Serialization/ASTReader.h:1460

template <typename Fn>
void forEachImportedKeyDecl(const clang::Decl* D,
                            Fn Visit)

Description

Run a callback on each imported key declaration of \p D.

Declared at: clang/include/clang/Serialization/ASTReader.h:1284

Templates

Fn

Parameters

const clang::Decl* D
Fn Visit

clang::IdentifierInfo* get(llvm::StringRef Name)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2000

Parameters

llvm::StringRef Name

clang::ASTContext& getContext()

Description

Retrieve the AST context that this AST reader supplements.

Declared at: clang/include/clang/Serialization/ASTReader.h:2278

clang::ASTDeserializationListener*
getDeserializationListener()

Description

Get the AST deserialization listener.

Declared at: clang/include/clang/Serialization/ASTReader.h:1664

clang::DiagnosticsEngine& getDiags() const

Declared at: clang/include/clang/Serialization/ASTReader.h:1540

clang::FileManager& getFileManager() const

Declared at: clang/include/clang/Serialization/ASTReader.h:1539

uint64_t getGlobalBitOffset(
    clang::ASTReader::ModuleFile& M,
    uint64_t LocalOffset)

Declared at: clang/include/clang/Serialization/ASTReader.h:1395

Parameters

clang::ASTReader::ModuleFile& M
uint64_t LocalOffset

serialization::DeclID getGlobalDeclID(
    clang::ASTReader::ModuleFile& F,
    serialization::LocalDeclID LocalID) const

Description

Map from a local declaration ID within a given module to a global declaration ID.

Declared at: clang/include/clang/Serialization/ASTReader.h:1838

Parameters

clang::ASTReader::ModuleFile& F
serialization::LocalDeclID LocalID

serialization::IdentifierID getGlobalIdentifierID(
    clang::ASTReader::ModuleFile& M,
    unsigned int LocalID)

Declared at: clang/include/clang/Serialization/ASTReader.h:2089

Parameters

clang::ASTReader::ModuleFile& M
unsigned int LocalID

clang::GlobalModuleIndex* getGlobalIndex()

Description

Return global module index.

Declared at: clang/include/clang/Serialization/ASTReader.h:1672

serialization::MacroID getGlobalMacroID(
    clang::ASTReader::ModuleFile& M,
    unsigned int LocalID)

Description

Retrieve the global macro ID corresponding to the given local ID within the given module file.

Declared at: clang/include/clang/Serialization/ASTReader.h:2099

Parameters

clang::ASTReader::ModuleFile& M
unsigned int LocalID

serialization::PreprocessedEntityID
getGlobalPreprocessedEntityID(
    clang::ASTReader::ModuleFile& M,
    unsigned int LocalID) const

Description

Determine the global preprocessed entity ID that corresponds to the given local ID within the given module.

Declared at: clang/include/clang/Serialization/ASTReader.h:2254

Parameters

clang::ASTReader::ModuleFile& M
unsigned int LocalID

serialization::SelectorID getGlobalSelectorID(
    clang::ASTReader::ModuleFile& F,
    unsigned int LocalID) const

Description

Retrieve the global selector ID that corresponds to this the local selector ID in a given module.

Declared at: clang/include/clang/Serialization/ASTReader.h:2149

Parameters

clang::ASTReader::ModuleFile& F
unsigned int LocalID

serialization::SubmoduleID getGlobalSubmoduleID(
    clang::ASTReader::ModuleFile& M,
    unsigned int LocalID)

Description

Retrieve the global submodule ID given a module and its local ID number.

Declared at: clang/include/clang/Serialization/ASTReader.h:2111

Parameters

clang::ASTReader::ModuleFile& M
unsigned int LocalID

serialization::TypeID getGlobalTypeID(
    clang::ASTReader::ModuleFile& F,
    unsigned int LocalID) const

Description

Map a local type ID within a given AST file into a global type ID.

Declared at: clang/include/clang/Serialization/ASTReader.h:1825

Parameters

clang::ASTReader::ModuleFile& F
unsigned int LocalID

clang::IdentifierResolver& getIdResolver()

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:2295

clang::IdentifierTable& getIdentifierTable()

Description

Retrieve the identifier table associated with the preprocessor.

Declared at: clang/include/clang/Serialization/ASTReader.h:2299

clang::IdentifierIterator* getIdentifiers()

Description

Retrieve an iterator into the set of all identifiers in all loaded AST files.

Declared at: clang/include/clang/Serialization/ASTReader.h:2004

clang::SourceLocation getImportLocation(
    clang::ASTReader::ModuleFile* F)

Declared at: clang/include/clang/Serialization/ASTReader.h:1346

Parameters

clang::ASTReader::ModuleFile* F

serialization::InputFile getInputFile(
    clang::ASTReader::ModuleFile& F,
    unsigned int ID,
    bool Complain = true)

Description

Retrieve the file entry and 'overridden' bit for an input file in the given module file.

Declared at: clang/include/clang/Serialization/ASTReader.h:1258

Parameters

clang::ASTReader::ModuleFile& F
unsigned int ID
bool Complain = true

const clang::Decl* getKeyDeclaration(
    const clang::Decl* D)

Declared at: clang/include/clang/Serialization/ASTReader.h:1278

Parameters

const clang::Decl* D

clang::Decl* getKeyDeclaration(clang::Decl* D)

Description

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.

Declared at: clang/include/clang/Serialization/ASTReader.h:1268

Parameters

clang::Decl* D

const serialization::reader::
    DeclContextLookupTable*
    getLoadedLookupTables(
        clang::DeclContext* Primary) const

Description

Get the loaded lookup tables for \p Primary, if any.

Declared at: clang/include/clang/Serialization/ASTReader.h:1297

Parameters

clang::DeclContext* Primary

clang::ASTReader::RecordLocation
getLocalBitOffset(uint64_t GlobalOffset)

Declared at: clang/include/clang/Serialization/ASTReader.h:1394

Parameters

uint64_t GlobalOffset

clang::IdentifierInfo* getLocalIdentifier(
    clang::ASTReader::ModuleFile& M,
    unsigned int LocalID)

Declared at: clang/include/clang/Serialization/ASTReader.h:2087

Parameters

clang::ASTReader::ModuleFile& M
unsigned int LocalID

clang::ASTReader::ModuleFile* getLocalModuleFile(
    clang::ASTReader::ModuleFile& M,
    unsigned int ID)

Description

Retrieve the module file with a given local ID within the specified ModuleFile.

Declared at: clang/include/clang/Serialization/ASTReader.h:2124

Parameters

clang::ASTReader::ModuleFile& M
unsigned int ID

clang::Selector getLocalSelector(
    clang::ASTReader::ModuleFile& M,
    unsigned int LocalID)

Description

Retrieve a selector from the given module with its local ID number.

Declared at: clang/include/clang/Serialization/ASTReader.h:2136

Parameters

clang::ASTReader::ModuleFile& M
unsigned int LocalID

clang::QualType getLocalType(
    clang::ASTReader::ModuleFile& F,
    unsigned int LocalID)

Description

Resolve a local type ID within a given AST file into a type.

Declared at: clang/include/clang/Serialization/ASTReader.h:1822

Parameters

clang::ASTReader::ModuleFile& F
unsigned int LocalID

clang::MacroInfo* getMacro(
    serialization::MacroID ID)

Description

Retrieve the macro with the given ID.

Declared at: clang/include/clang/Serialization/ASTReader.h:2095

Parameters

serialization::MacroID ID

void getMemoryBufferSizes(
    clang::ExternalASTSource::MemoryBufferSizes&
        sizes) const

Description

Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memory.

Declared at: clang/include/clang/Serialization/ASTReader.h:1984

Parameters

clang::ExternalASTSource::MemoryBufferSizes& sizes

clang::Module* getModule(unsigned int ID)

Description

Retrieve the module that corresponds to the given module ID. Note: overrides method in ExternalASTSource

Declared at: clang/include/clang/Serialization/ASTReader.h:2120

Parameters

unsigned int ID

unsigned int getModuleFileID(
    clang::ASTReader::ModuleFile* M)

Description

Get an ID for the given module file.

Declared at: clang/include/clang/Serialization/ASTReader.h:2127

Parameters

clang::ASTReader::ModuleFile* M

llvm::iterator_range<ModuleDeclIterator>
getModuleFileLevelDecls(
    clang::ASTReader::ModuleFile& Mod)

Declared at: clang/include/clang/Serialization/ASTReader.h:1454

Parameters

clang::ASTReader::ModuleFile& Mod

std::pair<SourceLocation, StringRef>
getModuleImportLoc(int ID)

Description

Retrieve the module import location and module name for the given source manager entry ID.

Declared at: clang/include/clang/Serialization/ASTReader.h:2106

Parameters

int ID

clang::ASTReader::ModuleManager&
getModuleManager()

Description

Retrieve the module manager.

Declared at: clang/include/clang/Serialization/ASTReader.h:1706

llvm::iterator_range<
    PreprocessingRecord::iterator>
getModulePreprocessedEntities(
    clang::ASTReader::ModuleFile& Mod) const

Description

Returns (begin, end) pair for the preprocessed entities of a particular module.

Declared at: clang/include/clang/Serialization/ASTReader.h:1420

Parameters

clang::ASTReader::ModuleFile& Mod

std::pair<ModuleFile*, unsigned int>
getModulePreprocessedEntity(
    unsigned int GlobalIndex)

Description

Returns (ModuleFile, Local index) pair for \p GlobalIndex of a preprocessed entity.

Declared at: clang/include/clang/Serialization/ASTReader.h:1415

Parameters

unsigned int GlobalIndex

clang::Decl* getMostRecentExistingDecl(
    clang::Decl* D)

Description

Returns the most recent declaration of a declaration (which must be of a redeclarable kind) that is either local or has already been loaded merged into its redecl chain.

Declared at: clang/include/clang/Serialization/ASTReader.h:1385

Parameters

clang::Decl* D

static std::string getOriginalSourceFile(
    const std::string& ASTFileName,
    clang::FileManager& FileMgr,
    const clang::PCHContainerReader&
        PCHContainerRdr,
    clang::DiagnosticsEngine& Diags)

Description

Retrieve the name of the original source file name directly from the AST file, without actually loading the AST file.

Declared at: clang/include/clang/Serialization/ASTReader.h:1720

Parameters

const std::string& ASTFileName
clang::FileManager& FileMgr
const clang::PCHContainerReader& PCHContainerRdr
clang::DiagnosticsEngine& Diags

llvm::StringRef getOriginalSourceFile()

Description

Retrieve the name of the original source file name for the primary module file.

Declared at: clang/include/clang/Serialization/ASTReader.h:1713

clang::ASTReader::ModuleFile* getOwningModuleFile(
    const clang::Decl* D)

Description

Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a module file.

Declared at: clang/include/clang/Serialization/ASTReader.h:1846

Parameters

const clang::Decl* D

std::string getOwningModuleNameForDiagnostic(
    const clang::Decl* D)

Description

Get the best name we know for the module that owns the given declaration, or an empty string if the declaration is not from a module.

Declared at: clang/include/clang/Serialization/ASTReader.h:1850

Parameters

const clang::Decl* D

clang::Preprocessor& getPreprocessor() const

Description

Retrieve the preprocessor.

Declared at: clang/include/clang/Serialization/ASTReader.h:1709

clang::Sema* getSema()

Description

Retrieve the semantic analysis object used to analyze the translation unit in which the precompiled header is being imported.

Declared at: clang/include/clang/Serialization/ASTReader.h:2290

llvm::Optional<ASTSourceDescriptor>
getSourceDescriptor(unsigned int ID)

Description

Return a descriptor for the corresponding module.

Declared at: clang/include/clang/Serialization/ASTReader.h:2130

Parameters

unsigned int ID

clang::SourceLocation getSourceLocationForDeclID(
    serialization::GlobalDeclID ID)

Description

Returns the source location for the decl \p ID.

Declared at: clang/include/clang/Serialization/ASTReader.h:1853

Parameters

serialization::GlobalDeclID ID

clang::SourceManager& getSourceManager() const

Declared at: clang/include/clang/Serialization/ASTReader.h:1538

clang::Module* getSubmodule(
    serialization::SubmoduleID GlobalID)

Description

Retrieve the submodule that corresponds to a global submodule ID.

Declared at: clang/include/clang/Serialization/ASTReader.h:2115

Parameters

serialization::SubmoduleID GlobalID

const std::string& getSuggestedPredefines()

Description

Returns the suggested contents of the predefines buffer, which contains a (typically-empty) subset of the predefines build prior to including the precompiled header.

Declared at: clang/include/clang/Serialization/ASTReader.h:1747

clang::SwitchCase* getSwitchCaseWithID(
    unsigned int ID)

Description

Retrieve the switch-case statement with the given ID.

Declared at: clang/include/clang/Serialization/ASTReader.h:2306

Parameters

unsigned int ID

unsigned int getTotalNumDecls() const

Description

Returns the number of declarations found in the chain.

Declared at: clang/include/clang/Serialization/ASTReader.h:1794

unsigned int getTotalNumIdentifiers() const

Description

Returns the number of identifiers found in the chain.

Declared at: clang/include/clang/Serialization/ASTReader.h:1779

unsigned int getTotalNumMacros() const

Description

Returns the number of macros found in the chain.

Declared at: clang/include/clang/Serialization/ASTReader.h:1784

unsigned int getTotalNumPreprocessedEntities()
    const

Description

Returns the number of preprocessed entities known to the AST reader.

Declared at: clang/include/clang/Serialization/ASTReader.h:1810

unsigned int getTotalNumSLocs() const

Description

Returns the number of source locations found in the chain.

Declared at: clang/include/clang/Serialization/ASTReader.h:1774

unsigned int getTotalNumSelectors() const

Description

Returns the number of selectors found in the chain.

Declared at: clang/include/clang/Serialization/ASTReader.h:1804

unsigned int getTotalNumSubmodules() const

Description

Returns the number of submodules known.

Declared at: clang/include/clang/Serialization/ASTReader.h:1799

unsigned int getTotalNumTypes() const

Description

Returns the number of types found in the chain.

Declared at: clang/include/clang/Serialization/ASTReader.h:1789

clang::ExternalASTSource::ExtKind
hasExternalDefinitions(const clang::Decl* D)

Declared at: clang/include/clang/Serialization/ASTReader.h:2132

Parameters

const clang::Decl* D

bool hasGlobalIndex() const

Description

Determine whether this AST reader has a global index.

Declared at: clang/include/clang/Serialization/ASTReader.h:1669

static bool isAcceptableASTFile(
    llvm::StringRef Filename,
    clang::FileManager& FileMgr,
    const clang::PCHContainerReader&
        PCHContainerRdr,
    const clang::LangOptions& LangOpts,
    const clang::TargetOptions& TargetOpts,
    const clang::PreprocessorOptions& PPOpts,
    llvm::StringRef ExistingModuleCachePath,
    bool RequireStrictOptionMatches = false)

Description

Determine whether the given AST file is acceptable to load into a translation unit with the given language and target options.

Declared at: clang/include/clang/Serialization/ASTReader.h:1736

Parameters

llvm::StringRef Filename
clang::FileManager& FileMgr
const clang::PCHContainerReader& PCHContainerRdr
const clang::LangOptions& LangOpts
const clang::TargetOptions& TargetOpts
const clang::PreprocessorOptions& PPOpts
llvm::StringRef ExistingModuleCachePath
bool RequireStrictOptionMatches = false

bool isDeclIDFromModule(
    serialization::GlobalDeclID ID,
    clang::ASTReader::ModuleFile& M) const

Description

Returns true if global DeclID \p ID originated from module \p M.

Declared at: clang/include/clang/Serialization/ASTReader.h:1842

Parameters

serialization::GlobalDeclID ID
clang::ASTReader::ModuleFile& M

bool isGlobalIndexUnavailable() const

Description

Determine whether we tried to load the global index, but failed, e.g., because it is out-of-date or does not exist.

Declared at: clang/include/clang/Serialization/ASTReader.h:1684

Optional<bool> isPreprocessedEntityInFileID(
    unsigned int Index,
    clang::FileID FID)

Description

Optionally returns true or false if the preallocated preprocessed entity with index \p Index came from file \p FID.

Declared at: clang/include/clang/Serialization/ASTReader.h:1762

Parameters

unsigned int Index
clang::FileID FID

bool isProcessingUpdateRecords()

Declared at: clang/include/clang/Serialization/ASTReader.h:2329

void loadDeclUpdateRecords(
    clang::ASTReader::PendingUpdateRecord& Record)

Declared at: clang/include/clang/Serialization/ASTReader.h:1389

Parameters

clang::ASTReader::PendingUpdateRecord& Record

bool loadGlobalIndex()

Description

Attempts to load the global index.

Declared at: clang/include/clang/Serialization/ASTReader.h:1680

Returns

true if loading the global index has failed for any reason.

void loadObjCCategories(
    serialization::GlobalDeclID ID,
    clang::ObjCInterfaceDecl* D,
    unsigned int PreviousGeneration = 0)

Declared at: clang/include/clang/Serialization/ASTReader.h:1391

Parameters

serialization::GlobalDeclID ID
clang::ObjCInterfaceDecl* D
unsigned int PreviousGeneration = 0

void loadPendingDeclChain(clang::Decl* D,
                          uint64_t LocalOffset)

Declared at: clang/include/clang/Serialization/ASTReader.h:1390

Parameters

clang::Decl* D
uint64_t LocalOffset

void makeModuleVisible(
    clang::Module* Mod,
    Module::NameVisibilityKind NameVisibility,
    clang::SourceLocation ImportLoc)

Description

Make the entities in the given module and any of its (non-explicit) submodules visible to name lookup.

Declared at: clang/include/clang/Serialization/ASTReader.h:1603

Parameters

clang::Module* Mod
The module whose names should be made visible.
Module::NameVisibilityKind NameVisibility
The level of visibility to give the names in the module. Visibility can only be increased over time.
clang::SourceLocation ImportLoc
The location at which the import occurs.

void makeNamesVisible(
    const clang::ASTReader::HiddenNames& Names,
    clang::Module* Owner)

Description

Make the names within this set of hidden names visible.

Declared at: clang/include/clang/Serialization/ASTReader.h:1608

Parameters

const clang::ASTReader::HiddenNames& Names
clang::Module* Owner

serialization::DeclID
mapGlobalIDToModuleFileGlobalID(
    clang::ASTReader::ModuleFile& M,
    serialization::DeclID GlobalID)

Description

Map a global declaration ID into the declaration ID used to refer to this declaration within the given module fule.

Declared at: clang/include/clang/Serialization/ASTReader.h:1883

Parameters

clang::ASTReader::ModuleFile& M
serialization::DeclID GlobalID

Returns

the global ID of the given declaration as known in the given module file.

void markIdentifierUpToDate(
    clang::IdentifierInfo* II)

Description

Note that this identifier is up-to-date.

Declared at: clang/include/clang/Serialization/ASTReader.h:2272

Parameters

clang::IdentifierInfo* II

void markIncompleteDeclChain(clang::Decl* Canon)

Declared at: clang/include/clang/Serialization/ASTReader.h:1380

Parameters

clang::Decl* Canon

void mergeDefinitionVisibility(
    clang::NamedDecl* Def,
    clang::NamedDecl* MergedDef)

Description

Note that MergedDef is a redefinition of the canonical definition Def, so Def should be visible whenever MergedDef is.

Declared at: clang/include/clang/Serialization/ASTReader.h:1612

Parameters

clang::NamedDecl* Def
clang::NamedDecl* MergedDef

void pushExternalDeclIntoScope(
    clang::NamedDecl* D,
    clang::DeclarationName Name)

Declared at: clang/include/clang/Serialization/ASTReader.h:1463

Parameters

clang::NamedDecl* D
clang::DeclarationName Name

static bool readASTFileControlBlock(
    llvm::StringRef Filename,
    clang::FileManager& FileMgr,
    const clang::PCHContainerReader&
        PCHContainerRdr,
    bool FindModuleFileExtensions,
    clang::ASTReaderListener& Listener,
    bool ValidateDiagnosticOptions)

Description

Read the control block for the named AST file.

Declared at: clang/include/clang/Serialization/ASTReader.h:1728

Parameters

llvm::StringRef Filename
clang::FileManager& FileMgr
const clang::PCHContainerReader& PCHContainerRdr
bool FindModuleFileExtensions
clang::ASTReaderListener& Listener
bool ValidateDiagnosticOptions

Returns

true if an error occurred, false otherwise.

clang::IdentifierInfo* readIdentifier(
    clang::ASTReader::ModuleFile& M,
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Declared at: clang/include/clang/Serialization/ASTReader.h:2075

Parameters

clang::ASTReader::ModuleFile& M
const clang::ASTReader::RecordData& Record
unsigned int& Idx

void readIncludedFiles(
    clang::ASTReader::ModuleFile& F,
    llvm::StringRef Blob,
    clang::Preprocessor& PP)

Declared at: clang/include/clang/Serialization/ASTReader.h:1347

Parameters

clang::ASTReader::ModuleFile& F
llvm::StringRef Blob
clang::Preprocessor& PP

clang::ASTReader::InputFileInfo readInputFileInfo(
    clang::ASTReader::ModuleFile& F,
    unsigned int ID)

Description

Reads the stored information about an input file.

Declared at: clang/include/clang/Serialization/ASTReader.h:1254

Parameters

clang::ASTReader::ModuleFile& F
unsigned int ID

clang::QualType readType(
    clang::ASTReader::ModuleFile& F,
    const clang::ASTReader::RecordData& Record,
    unsigned int& Idx)

Description

Read a type from the current position in the given record, which was read from the given AST file.

Declared at: clang/include/clang/Serialization/ASTReader.h:1829

Parameters

clang::ASTReader::ModuleFile& F
const clang::ASTReader::RecordData& Record
unsigned int& Idx

clang::QualType readTypeRecord(unsigned int Index)

Declared at: clang/include/clang/Serialization/ASTReader.h:1376

Parameters

unsigned int Index

clang::ASTReader::ASTReadResult
readUnhashedControlBlock(
    clang::ASTReader::ModuleFile& F,
    bool WasImportedBy,
    unsigned int ClientLoadCapabilities)

Description

Read the unhashed control block. This has no effect on \c F.Stream, instead creating a fresh cursor from\c F.Data and reading ahead.

Declared at: clang/include/clang/Serialization/ASTReader.h:1330

Parameters

clang::ASTReader::ModuleFile& F
bool WasImportedBy
unsigned int ClientLoadCapabilities

static clang::ASTReader::ASTReadResult
readUnhashedControlBlockImpl(
    clang::ASTReader::ModuleFile* F,
    llvm::StringRef StreamData,
    unsigned int ClientLoadCapabilities,
    bool AllowCompatibleConfigurationMismatch,
    clang::ASTReaderListener* Listener,
    bool ValidateDiagnosticOptions)

Declared at: clang/include/clang/Serialization/ASTReader.h:1334

Parameters

clang::ASTReader::ModuleFile* F
llvm::StringRef StreamData
unsigned int ClientLoadCapabilities
bool AllowCompatibleConfigurationMismatch
clang::ASTReaderListener* Listener
bool ValidateDiagnosticOptions

void resetForReload()

Description

Reset reader for a reload try.

Declared at: clang/include/clang/Serialization/ASTReader.h:1675

void resolvePendingMacro(
    clang::IdentifierInfo* II,
    const clang::ASTReader::PendingMacroInfo&
        PMInfo)

Declared at: clang/include/clang/Serialization/ASTReader.h:2092

Parameters

clang::IdentifierInfo* II
const clang::ASTReader::PendingMacroInfo& PMInfo

void setDeserializationListener(
    clang::ASTDeserializationListener* Listener,
    bool TakeOwnership = false)

Description

Set the AST deserialization listener.

Declared at: clang/include/clang/Serialization/ASTReader.h:1660

Parameters

clang::ASTDeserializationListener* Listener
bool TakeOwnership = false

void setListener(
    std::unique_ptr<ASTReaderListener> Listener)

Description

Set the AST callbacks listener.

Declared at: clang/include/clang/Serialization/ASTReader.h:1620

Parameters

std::unique_ptr<ASTReaderListener> Listener

bool shouldDisableValidationForFile(
    const serialization::ModuleFile& M) const

Declared at: clang/include/clang/Serialization/ASTReader.h:1238

Parameters

const serialization::ModuleFile& M

std::unique_ptr<ASTReaderListener> takeListener()

Description

Take the AST callbacks listener.

Declared at: clang/include/clang/Serialization/ASTReader.h:1615

void updateOutOfDateIdentifier(
    clang::IdentifierInfo& II)

Description

Update an out-of-date identifier.

Declared at: clang/include/clang/Serialization/ASTReader.h:2269

Parameters

clang::IdentifierInfo& II

void updateOutOfDateSelector(clang::Selector Sel)

Description

Load the contents of the global method pool for a given selector if necessary.

Declared at: clang/include/clang/Serialization/ASTReader.h:2012

Parameters

clang::Selector Sel

void visitInputFiles(
    serialization::ModuleFile& MF,
    bool IncludeSystem,
    bool Complain,
    llvm::function_ref<
        void(const serialization::InputFile&,
             bool)> Visitor)

Description

Visit all the input files of the given module file.

Declared at: clang/include/clang/Serialization/ASTReader.h:2318

Parameters

serialization::ModuleFile& MF
bool IncludeSystem
bool Complain
llvm::function_ref< void(const serialization::InputFile&, bool)> Visitor

void visitTopLevelModuleMaps(
    serialization::ModuleFile& MF,
    llvm::function_ref<void(const FileEntry*)>
        Visitor)

Description

Visit all the top-level module maps loaded when building the given module file.

Declared at: clang/include/clang/Serialization/ASTReader.h:2325

Parameters

serialization::ModuleFile& MF
llvm::function_ref<void(const FileEntry*)> Visitor

~ASTReader()

Declared at: clang/include/clang/Serialization/ASTReader.h:1536