clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends
clang::ASTReader Class Reference

Reads an AST files chain containing the contents of a translation unit. More...

#include <ASTReader.h>

Inheritance diagram for clang::ASTReader:
Inheritance graph
[legend]
Collaboration diagram for clang::ASTReader:
Collaboration graph
[legend]

List of all members.

Classes

struct  FileDeclsInfo
class  HiddenName
 An entity that has been hidden.
struct  HiddenNames
 A set of hidden declarations.
struct  ImportedModule
struct  ImportedSubmodule
struct  InputFileInfo
class  ListenerScope
 RAII object to temporarily add an AST callback listener. More...
class  ModuleDeclIterator
struct  ModuleMacroInfo
struct  PendingDeclContextInfo
 The Decl IDs for the Sema/Lexical DeclContext of a Decl that has been loaded but its DeclContext was not set yet.
struct  PendingMacroInfo
class  ReadingKindTracker
 RAII object to change the reading kind.
struct  RecordLocation
struct  ReplacedDeclInfo
struct  UnresolvedModuleRef
 A module import, export, or conflict that hasn't yet been resolved.

Public Types

enum  ASTReadResult {
  Success, Failure, Missing, OutOfDate,
  VersionMismatch, ConfigurationMismatch, HadErrors
}
 The result of reading the control block of an AST file, which can fail for various reasons. More...
enum  LoadFailureCapabilities {
  ARR_None = 0, ARR_Missing = 0x1, ARR_OutOfDate = 0x2, ARR_VersionMismatch = 0x4,
  ARR_ConfigurationMismatch = 0x8
}
 Flags that indicate what kind of AST loading failures the client of the AST reader can directly handle. More...
typedef SmallVector< uint64_t, 64 > RecordData
typedef SmallVectorImpl< uint64_t > RecordDataImpl
typedef serialization::ModuleFile ModuleFile
typedef serialization::ModuleKind ModuleKind
typedef
serialization::ModuleManager 
ModuleManager
typedef
ModuleManager::ModuleIterator 
ModuleIterator
typedef
ModuleManager::ModuleConstIterator 
ModuleConstIterator
typedef
ModuleManager::ModuleReverseIterator 
ModuleReverseIterator
typedef llvm::TinyPtrVector
< DefMacroDirective * > 
AmbiguousMacros

Public Member Functions

 ASTReader (Preprocessor &PP, ASTContext &Context, StringRef isysroot="", bool DisableValidation=false, bool AllowASTWithCompilerErrors=false, bool AllowConfigurationMismatch=false, bool ValidateSystemInputs=false, bool UseGlobalIndex=true)
 Load the AST file and validate its contents against the given Preprocessor.
 ~ASTReader ()
SourceManagergetSourceManager () const
FileManagergetFileManager () const
ASTReadResult ReadAST (const std::string &FileName, ModuleKind Type, SourceLocation ImportLoc, unsigned ClientLoadCapabilities)
 Load the AST file designated by the given file name.
void makeModuleVisible (Module *Mod, Module::NameVisibilityKind NameVisibility, SourceLocation ImportLoc, bool Complain)
 Make the entities in the given module and any of its (non-explicit) submodules visible to name lookup.
void makeNamesVisible (const HiddenNames &Names, Module *Owner, bool FromFinalization)
 Make the names within this set of hidden names visible.
std::unique_ptr
< ASTReaderListener
takeListener ()
 Take the AST callbacks listener.
void setListener (std::unique_ptr< ASTReaderListener > Listener)
 Set the AST callbacks listener.
void addListener (std::unique_ptr< ASTReaderListener > L)
 Add an AST callback listener.
void setDeserializationListener (ASTDeserializationListener *Listener, bool TakeOwnership=false)
 Set the AST deserialization listener.
bool hasGlobalIndex () const
 Determine whether this AST reader has a global index.
GlobalModuleIndexgetGlobalIndex ()
 Return global module index.
void resetForReload ()
 Reset reader for a reload try.
bool loadGlobalIndex ()
 Attempts to load the global index.
bool isGlobalIndexUnavailable () const
 Determine whether we tried to load the global index, but failed, e.g., because it is out-of-date or does not exist.
void InitializeContext ()
 Initializes the ASTContext.
void UpdateSema ()
 Update the state of Sema after loading some additional modules.
void addInMemoryBuffer (StringRef &FileName, std::unique_ptr< llvm::MemoryBuffer > Buffer)
 Add in-memory (virtual file) buffer.
void finalizeForWriting ()
 Finalizes the AST reader's state before writing an AST file to disk.
ModuleManagergetModuleManager ()
 Retrieve the module manager.
PreprocessorgetPreprocessor () const
 Retrieve the preprocessor.
StringRef getOriginalSourceFile ()
 Retrieve the name of the original source file name for the primary module file.
const std::string & getSuggestedPredefines ()
 Returns the suggested contents of the predefines buffer, which contains a (typically-empty) subset of the predefines build prior to including the precompiled header.
PreprocessedEntityReadPreprocessedEntity (unsigned Index) override
 Read a preallocated preprocessed entity from the external source.
std::pair< unsigned, unsignedfindPreprocessedEntitiesInRange (SourceRange Range) override
 Returns a pair of [Begin, End) indices of preallocated preprocessed entities that Range encompasses.
Optional< boolisPreprocessedEntityInFileID (unsigned Index, FileID FID) override
 Optionally returns true or false if the preallocated preprocessed entity with index Index came from file FID.
HeaderFileInfo GetHeaderFileInfo (const FileEntry *FE) override
 Read the header file information for the given file entry.
void ReadPragmaDiagnosticMappings (DiagnosticsEngine &Diag)
unsigned getTotalNumSLocs () const
 Returns the number of source locations found in the chain.
unsigned getTotalNumIdentifiers () const
 Returns the number of identifiers found in the chain.
unsigned getTotalNumMacros () const
 Returns the number of macros found in the chain.
unsigned getTotalNumTypes () const
 Returns the number of types found in the chain.
unsigned getTotalNumDecls () const
 Returns the number of declarations found in the chain.
unsigned getTotalNumSubmodules () const
 Returns the number of submodules known.
unsigned getTotalNumSelectors () const
 Returns the number of selectors found in the chain.
unsigned getTotalNumPreprocessedEntities () const
 Returns the number of preprocessed entities known to the AST reader.
unsigned getTotalNumCXXBaseSpecifiers () const
 Returns the number of C++ base specifiers found in the chain.
TemplateArgumentLocInfo GetTemplateArgumentLocInfo (ModuleFile &F, TemplateArgument::ArgKind Kind, const RecordData &Record, unsigned &Idx)
 Reads a TemplateArgumentLocInfo appropriate for the given TemplateArgument kind.
TemplateArgumentLoc ReadTemplateArgumentLoc (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Reads a TemplateArgumentLoc.
const ASTTemplateArgumentListInfoReadASTTemplateArgumentListInfo (ModuleFile &F, const RecordData &Record, unsigned &Index)
TypeSourceInfoGetTypeSourceInfo (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Reads a declarator info from the given record.
QualType GetType (serialization::TypeID ID)
 Resolve a type ID into a type, potentially building a new type.
QualType getLocalType (ModuleFile &F, unsigned LocalID)
 Resolve a local type ID within a given AST file into a type.
serialization::TypeID getGlobalTypeID (ModuleFile &F, unsigned LocalID) const
 Map a local type ID within a given AST file into a global type ID.
QualType readType (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a type from the current position in the given record, which was read from the given AST file.
serialization::DeclID getGlobalDeclID (ModuleFile &F, serialization::LocalDeclID LocalID) const
 Map from a local declaration ID within a given module to a global declaration ID.
bool isDeclIDFromModule (serialization::GlobalDeclID ID, ModuleFile &M) const
 Returns true if global DeclID ID originated from module M.
ModuleFilegetOwningModuleFile (const Decl *D)
 Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a module file.
std::string getOwningModuleNameForDiagnostic (const Decl *D)
 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.
SourceLocation getSourceLocationForDeclID (serialization::GlobalDeclID ID)
 Returns the source location for the decl ID.
DeclGetDecl (serialization::DeclID ID)
 Resolve a declaration ID into a declaration, potentially building a new declaration.
DeclGetExternalDecl (uint32_t ID) override
 Resolve a declaration ID into a declaration, potentially building a new declaration.
DeclGetExistingDecl (serialization::DeclID ID)
 Resolve a declaration ID into a declaration. Return 0 if it's not been loaded yet.
DeclGetLocalDecl (ModuleFile &F, uint32_t LocalID)
 Reads a declaration with the given local ID in the given module.
template<typename T >
T * GetLocalDeclAs (ModuleFile &F, uint32_t LocalID)
 Reads a declaration with the given local ID in the given module.
serialization::DeclID mapGlobalIDToModuleFileGlobalID (ModuleFile &M, serialization::DeclID GlobalID)
 Map a global declaration ID into the declaration ID used to refer to this declaration within the given module fule.
serialization::DeclID ReadDeclID (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Reads a declaration ID from the given position in a record in the given module.
DeclReadDecl (ModuleFile &F, const RecordData &R, unsigned &I)
 Reads a declaration from the given position in a record in the given module.
template<typename T >
T * ReadDeclAs (ModuleFile &F, const RecordData &R, unsigned &I)
 Reads a declaration from the given position in a record in the given module.
void CompleteRedeclChain (const Decl *D) override
 If any redeclarations of D have been imported since it was last checked, this digs out those redeclarations and adds them to the redeclaration chain for D.
uint64_t readCXXBaseSpecifiers (ModuleFile &M, const RecordData &Record, unsigned &Idx)
 Read a CXXBaseSpecifiers ID form the given record and return its global bit offset.
CXXBaseSpecifierGetExternalCXXBaseSpecifiers (uint64_t Offset) override
 Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers.
StmtGetExternalDeclStmt (uint64_t Offset) override
 Resolve the offset of a statement into a statement.
bool ReadBlockAbbrevs (llvm::BitstreamCursor &Cursor, unsigned BlockID)
bool FindExternalVisibleDeclsByName (const DeclContext *DC, DeclarationName Name) override
 Finds all the visible declarations with a given name. The current implementation of this method just loads the entire lookup table as unmaterialized references.
ExternalLoadResult FindExternalLexicalDecls (const DeclContext *DC, bool(*isKindWeWant)(Decl::Kind), SmallVectorImpl< Decl * > &Decls) override
 Read all of the declarations lexically stored in a declaration context.
void FindFileRegionDecls (FileID File, unsigned Offset, unsigned Length, SmallVectorImpl< Decl * > &Decls) override
 Get the decls that are contained in a file in the Offset/Length range. Length can be 0 to indicate a point at Offset instead of a range.
void StartedDeserializing () override
 Notify ASTReader that we started deserialization of a decl or type so until FinishedDeserializing is called there may be decls that are initializing. Must be paired with FinishedDeserializing.
void FinishedDeserializing () override
 Notify ASTReader that we finished the deserialization of a decl or type. Must be paired with StartedDeserializing.
void StartTranslationUnit (ASTConsumer *Consumer) override
 Function that will be invoked when we begin parsing a new translation unit involving this external AST source.
void PrintStats () override
 Print some statistics about AST usage.
void dump ()
 Dump information about the AST reader to standard error.
void getMemoryBufferSizes (MemoryBufferSizes &sizes) const override
void InitializeSema (Sema &S) override
 Initialize the semantic source with the Sema instance being used to perform semantic analysis on the abstract syntax tree.
void ForgetSema () override
 Inform the semantic consumer that Sema is no longer available.
virtual IdentifierInfoget (const char *NameStart, const char *NameEnd)
 Retrieve the IdentifierInfo for the named identifier.
IdentifierInfoget (StringRef Name) override
 Return the IdentifierInfo for the specified named identifier.
IdentifierIteratorgetIdentifiers () override
 Retrieve an iterator into the set of all identifiers in all loaded AST files.
void ReadMethodPool (Selector Sel) override
 Load the contents of the global method pool for a given selector.
void ReadKnownNamespaces (SmallVectorImpl< NamespaceDecl * > &Namespaces) override
 Load the set of namespaces that are known to the external source, which will be used during typo correction.
void ReadUndefinedButUsed (llvm::DenseMap< NamedDecl *, SourceLocation > &Undefined) override
 Load the set of used but not defined functions or variables with internal linkage, or used but not defined internal functions.
void ReadTentativeDefinitions (SmallVectorImpl< VarDecl * > &TentativeDefs) override
 Read the set of tentative definitions known to the external Sema source.
void ReadUnusedFileScopedDecls (SmallVectorImpl< const DeclaratorDecl * > &Decls) override
 Read the set of unused file-scope declarations known to the external Sema source.
void ReadDelegatingConstructors (SmallVectorImpl< CXXConstructorDecl * > &Decls) override
 Read the set of delegating constructors known to the external Sema source.
void ReadExtVectorDecls (SmallVectorImpl< TypedefNameDecl * > &Decls) override
 Read the set of ext_vector type declarations known to the external Sema source.
void ReadDynamicClasses (SmallVectorImpl< CXXRecordDecl * > &Decls) override
 Read the set of dynamic classes known to the external Sema source.
void ReadUnusedLocalTypedefNameCandidates (llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) override
 Read the set of potentially unused typedefs known to the source.
void ReadLocallyScopedExternCDecls (SmallVectorImpl< NamedDecl * > &Decls) override
 Read the set of locally-scoped external declarations known to the external Sema source.
void ReadReferencedSelectors (SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) override
 Read the set of referenced selectors known to the external Sema source.
void ReadWeakUndeclaredIdentifiers (SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WI) override
 Read the set of weak, undeclared identifiers known to the external Sema source.
void ReadUsedVTables (SmallVectorImpl< ExternalVTableUse > &VTables) override
 Read the set of used vtables known to the external Sema source.
void ReadPendingInstantiations (SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) override
 Read the set of pending instantiations known to the external Sema source.
void ReadLateParsedTemplates (llvm::DenseMap< const FunctionDecl *, LateParsedTemplate * > &LPTMap) override
 Read the set of late parsed template functions for this source.
void LoadSelector (Selector Sel)
 Load a selector from disk, registering its ID if it exists.
void SetIdentifierInfo (unsigned ID, IdentifierInfo *II)
void SetGloballyVisibleDecls (IdentifierInfo *II, const SmallVectorImpl< uint32_t > &DeclIDs, SmallVectorImpl< Decl * > *Decls=nullptr)
 Set the globally-visible declarations associated with the given identifier.
DiagnosticBuilder Diag (unsigned DiagID)
 Report a diagnostic.
DiagnosticBuilder Diag (SourceLocation Loc, unsigned DiagID)
 Report a diagnostic.
IdentifierInfoDecodeIdentifierInfo (serialization::IdentifierID ID)
IdentifierInfoGetIdentifierInfo (ModuleFile &M, const RecordData &Record, unsigned &Idx)
IdentifierInfoGetIdentifier (serialization::IdentifierID ID) override
IdentifierInfogetLocalIdentifier (ModuleFile &M, unsigned LocalID)
serialization::IdentifierID getGlobalIdentifierID (ModuleFile &M, unsigned LocalID)
ModuleMacroInfogetModuleMacro (const PendingMacroInfo &PMInfo)
void resolvePendingMacro (IdentifierInfo *II, const PendingMacroInfo &PMInfo)
void installPCHMacroDirectives (IdentifierInfo *II, ModuleFile &M, uint64_t Offset)
void installImportedMacro (IdentifierInfo *II, ModuleMacroInfo *MMI, Module *Owner)
void removeOverriddenMacros (IdentifierInfo *II, SourceLocation Loc, AmbiguousMacros &Ambig, ArrayRef< serialization::SubmoduleID > Overrides)
AmbiguousMacrosremoveOverriddenMacros (IdentifierInfo *II, SourceLocation Loc, ArrayRef< serialization::SubmoduleID > Overrides)
MacroInfogetMacro (serialization::MacroID ID)
 Retrieve the macro with the given ID.
serialization::MacroID getGlobalMacroID (ModuleFile &M, unsigned LocalID)
 Retrieve the global macro ID corresponding to the given local ID within the given module file.
bool ReadSLocEntry (int ID) override
 Read the source location entry with index ID.
std::pair< SourceLocation,
StringRef > 
getModuleImportLoc (int ID) override
 Retrieve the module import location and module name for the given source manager entry ID.
serialization::SubmoduleID getGlobalSubmoduleID (ModuleFile &M, unsigned LocalID)
 Retrieve the global submodule ID given a module and its local ID number.
ModulegetSubmodule (serialization::SubmoduleID GlobalID)
 Retrieve the submodule that corresponds to a global submodule ID.
ModulegetModule (unsigned ID) override
 Retrieve the module that corresponds to the given module ID.
Selector getLocalSelector (ModuleFile &M, unsigned LocalID)
 Retrieve a selector from the given module with its local ID number.
Selector DecodeSelector (serialization::SelectorID Idx)
Selector GetExternalSelector (serialization::SelectorID ID) override
 Resolve a selector ID into a selector.
uint32_t GetNumExternalSelectors () override
 Returns the number of selectors known to the external AST source.
Selector ReadSelector (ModuleFile &M, const RecordData &Record, unsigned &Idx)
serialization::SelectorID getGlobalSelectorID (ModuleFile &F, unsigned LocalID) const
 Retrieve the global selector ID that corresponds to this the local selector ID in a given module.
DeclarationName ReadDeclarationName (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a declaration name.
void ReadDeclarationNameLoc (ModuleFile &F, DeclarationNameLoc &DNLoc, DeclarationName Name, const RecordData &Record, unsigned &Idx)
void ReadDeclarationNameInfo (ModuleFile &F, DeclarationNameInfo &NameInfo, const RecordData &Record, unsigned &Idx)
void ReadQualifierInfo (ModuleFile &F, QualifierInfo &Info, const RecordData &Record, unsigned &Idx)
NestedNameSpecifierReadNestedNameSpecifier (ModuleFile &F, const RecordData &Record, unsigned &Idx)
NestedNameSpecifierLoc ReadNestedNameSpecifierLoc (ModuleFile &F, const RecordData &Record, unsigned &Idx)
TemplateName ReadTemplateName (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a template name.
TemplateArgument ReadTemplateArgument (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a template argument.
TemplateParameterListReadTemplateParameterList (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a template parameter list.
void ReadTemplateArgumentList (SmallVectorImpl< TemplateArgument > &TemplArgs, ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a template argument array.
void ReadUnresolvedSet (ModuleFile &F, LazyASTUnresolvedSet &Set, const RecordData &Record, unsigned &Idx)
 Read a UnresolvedSet structure.
CXXBaseSpecifier ReadCXXBaseSpecifier (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a C++ base specifier.
std::pair< CXXCtorInitializer
**, unsigned
ReadCXXCtorInitializers (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a CXXCtorInitializer array.
SourceLocation ReadSourceLocation (ModuleFile &ModuleFile, unsigned Raw) const
 Read a source location from raw form.
SourceLocation ReadSourceLocation (ModuleFile &ModuleFile, const RecordDataImpl &Record, unsigned &Idx)
 Read a source location.
SourceRange ReadSourceRange (ModuleFile &F, const RecordData &Record, unsigned &Idx)
 Read a source range.
llvm::APInt ReadAPInt (const RecordData &Record, unsigned &Idx)
 Read an integral value.
llvm::APSInt ReadAPSInt (const RecordData &Record, unsigned &Idx)
 Read a signed integral value.
llvm::APFloat ReadAPFloat (const RecordData &Record, const llvm::fltSemantics &Sem, unsigned &Idx)
 Read a floating-point value.
CXXTemporaryReadCXXTemporary (ModuleFile &F, const RecordData &Record, unsigned &Idx)
void ReadAttributes (ModuleFile &F, AttrVec &Attrs, const RecordData &Record, unsigned &Idx)
 Reads attributes from the current stream position.
StmtReadStmt (ModuleFile &F)
 Reads a statement.
ExprReadExpr (ModuleFile &F)
 Reads an expression.
StmtReadSubStmt ()
 Reads a sub-statement operand during statement reading.
ExprReadSubExpr ()
 Reads a sub-expression operand during statement reading.
Token ReadToken (ModuleFile &M, const RecordDataImpl &Record, unsigned &Idx)
 Reads a token out of a record.
MacroInfoReadMacroRecord (ModuleFile &F, uint64_t Offset)
 Reads the macro record located at the given offset.
serialization::PreprocessedEntityID getGlobalPreprocessedEntityID (ModuleFile &M, unsigned LocalID) const
 Determine the global preprocessed entity ID that corresponds to the given local ID within the given module.
void addPendingMacroFromModule (IdentifierInfo *II, ModuleFile *M, serialization::GlobalMacroID GMacID, ArrayRef< serialization::SubmoduleID >)
 Add a macro to resolve imported from a module.
void addPendingMacroFromPCH (IdentifierInfo *II, ModuleFile *M, uint64_t MacroDirectivesOffset)
 Add a macro to deserialize its macro directive history from a PCH.
void ReadDefinedMacros () override
 Read the set of macros defined by this external macro source.
void updateOutOfDateIdentifier (IdentifierInfo &II) override
 Update an out-of-date identifier.
void markIdentifierUpToDate (IdentifierInfo *II)
 Note that this identifier is up-to-date.
void completeVisibleDeclsMap (const DeclContext *DC) override
 Load all external visible decls in the given DeclContext.
ASTContextgetContext ()
 Retrieve the AST context that this AST reader supplements.
SemagetSema ()
 Retrieve the semantic analysis object used to analyze the translation unit in which the precompiled header is being imported.
IdentifierTablegetIdentifierTable ()
 Retrieve the identifier table associated with the preprocessor.
void RecordSwitchCaseID (SwitchCase *SC, unsigned ID)
 Record that the given ID maps to the given switch-case statement.
SwitchCasegetSwitchCaseWithID (unsigned ID)
 Retrieve the switch-case statement with the given ID.
void ClearSwitchCaseIDs ()
void ReadComments () override
 Loads comment ranges.
void getInputFiles (ModuleFile &F, SmallVectorImpl< serialization::InputFile > &Files)
 Return all input files for the given module file.

Static Public Member Functions

static std::string getOriginalSourceFile (const std::string &ASTFileName, FileManager &FileMgr, DiagnosticsEngine &Diags)
 Retrieve the name of the original source file name directly from the AST file, without actually loading the AST file.
static bool readASTFileControlBlock (StringRef Filename, FileManager &FileMgr, ASTReaderListener &Listener)
 Read the control block for the named AST file.
static bool isAcceptableASTFile (StringRef Filename, FileManager &FileMgr, const LangOptions &LangOpts, const TargetOptions &TargetOpts, const PreprocessorOptions &PPOpts)
 Determine whether the given AST file is acceptable to load into a translation unit with the given language and target options.
static std::string ReadString (const RecordData &Record, unsigned &Idx)
static VersionTuple ReadVersionTuple (const RecordData &Record, unsigned &Idx)
 Read a version tuple.

Public Attributes

llvm::DenseMap< IdentifierInfo
*, AmbiguousMacros
AmbiguousMacroDefs
SmallVector< uint64_t, 16 > PreloadedDeclIDs
SmallVector< std::pair
< llvm::BitstreamCursor,
serialization::ModuleFile * >, 8 > 
CommentsCursors
 Cursors for comments blocks.

Friends

class PCHValidator
 Types of AST files.
class ASTDeclReader
class ASTStmtReader
class ASTIdentifierIterator
class serialization::reader::ASTIdentifierLookupTrait
class TypeLocReader
class ASTWriter
class ASTUnit
class serialization::ReadMethodPoolVisitor

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

Definition at line 295 of file ASTReader.h.


Member Typedef Documentation

typedef llvm::TinyPtrVector<DefMacroDirective *> clang::ASTReader::AmbiguousMacros

Definition at line 1905 of file ASTReader.h.

Definition at line 346 of file ASTReader.h.

Definition at line 341 of file ASTReader.h.

Definition at line 345 of file ASTReader.h.

Definition at line 342 of file ASTReader.h.

Definition at line 343 of file ASTReader.h.

Definition at line 347 of file ASTReader.h.

typedef SmallVector<uint64_t, 64> clang::ASTReader::RecordData

Definition at line 305 of file ASTReader.h.

typedef SmallVectorImpl<uint64_t> clang::ASTReader::RecordDataImpl

Definition at line 306 of file ASTReader.h.


Member Enumeration Documentation

The result of reading the control block of an AST file, which can fail for various reasons.

Enumerator:
Success 

The control block was read successfully. Aside from failures, the AST file is safe to read into the current context.

Failure 

The AST file itself appears corrupted.

Missing 

The AST file was missing.

OutOfDate 

The AST file is out-of-date relative to its input files, and needs to be regenerated.

VersionMismatch 

The AST file was written by a different version of Clang.

ConfigurationMismatch 

The AST file was writtten with a different language/target configuration.

HadErrors 

The AST file has errors.

Definition at line 310 of file ASTReader.h.

Flags that indicate what kind of AST loading failures the client of the AST reader can directly handle.

When a client states that it can handle a particular kind of failure, the AST reader will not emit errors when producing that kind of failure.

Enumerator:
ARR_None 

The client can't handle any AST loading failures.

ARR_Missing 

The client can handle an AST file that cannot load because it is missing.

ARR_OutOfDate 

The client can handle an AST file that cannot load because it is out-of-date relative to its input files.

ARR_VersionMismatch 

The client can handle an AST file that cannot load because it was built with a different version of Clang.

ARR_ConfigurationMismatch 

The client can handle an AST file that cannot load because it's compiled configuration doesn't match that of the context it was loaded into.

Definition at line 1351 of file ASTReader.h.


Constructor & Destructor Documentation

ASTReader::ASTReader ( Preprocessor PP,
ASTContext Context,
StringRef  isysroot = "",
bool  DisableValidation = false,
bool  AllowASTWithCompilerErrors = false,
bool  AllowConfigurationMismatch = false,
bool  ValidateSystemInputs = false,
bool  UseGlobalIndex = true 
)

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

Parameters:
PPthe preprocessor associated with the context in which this precompiled header will be loaded.
Contextthe AST context that this precompiled header will be loaded into.
isysrootIf 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 "/".
DisableValidationIf true, the AST reader will suppress most of its regular consistency checking, allowing the use of precompiled headers that cannot be determined to be compatible.
AllowASTWithCompilerErrorsIf true, the AST reader will accept an AST file the was created out of an AST with compiler errors, otherwise it will reject it.
AllowConfigurationMismatchIf true, the AST reader will not check for configuration differences between the AST file and the invocation.
ValidateSystemInputsIf true, the AST reader will validate system input files in addition to user input files. This is only meaningful if DisableValidation is false.
UseGlobalIndexIf true, the AST reader will try to load and use the global module index.

Definition at line 8490 of file ASTReader.cpp.

References clang::SourceManager::setExternalSLocEntrySource().

Definition at line 8519 of file ASTReader.cpp.


Member Function Documentation

void clang::ASTReader::addInMemoryBuffer ( StringRef &  FileName,
std::unique_ptr< llvm::MemoryBuffer >  Buffer 
) [inline]

Add in-memory (virtual file) buffer.

Definition at line 1479 of file ASTReader.h.

References clang::serialization::ModuleManager::addInMemoryBuffer().

void clang::ASTReader::addListener ( std::unique_ptr< ASTReaderListener L) [inline]

Add a macro to resolve imported from a module.

Parameters:
IIThe name of the macro.
MThe module file.
GMacIDThe global macro ID that is associated with this identifier.

Definition at line 1575 of file ASTReader.cpp.

References Context.

void ASTReader::addPendingMacroFromPCH ( IdentifierInfo II,
ModuleFile M,
uint64_t  MacroDirectivesOffset 
)

Add a macro to deserialize its macro directive history from a PCH.

Parameters:
IIThe name of the macro.
MThe module file.
MacroDirectivesOffsetOffset of the serialized macro directive history.

Definition at line 1589 of file ASTReader.cpp.

Definition at line 8090 of file ASTReader.cpp.

void ASTReader::CompleteRedeclChain ( const Decl D) [override, virtual]

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

Reimplemented from clang::ExternalASTSource.

Definition at line 6060 of file ASTReader.cpp.

References clang::DeclContext::decls_begin(), clang::Decl::getDeclContext(), clang::DeclContext::getRedeclContext(), clang::IdentifierInfo::isOutOfDate(), clang::DeclContext::lookup(), and clang::serialization::needsAnonymousDeclarationNumber().

void ASTReader::completeVisibleDeclsMap ( const DeclContext DC) [override, virtual]

Load all external visible decls in the given DeclContext.

Reimplemented from clang::ExternalASTSource.

Definition at line 6648 of file ASTReader.cpp.

References Contexts, clang::DeclContext::hasExternalVisibleStorage(), clang::DeclContext::isFileContext(), and clang::DeclContext::isNamespace().

Report a diagnostic.

Definition at line 8062 of file ASTReader.cpp.

Report a diagnostic.

Definition at line 8066 of file ASTReader.cpp.

References clang::DiagnosticsEngine::Report().

void ASTReader::dump ( )

Dump information about the AST reader to standard error.

Definition at line 6852 of file ASTReader.cpp.

References dumpModuleIDMap().

Finalizes the AST reader's state before writing an AST file to disk.

This operation may undo temporary state in the AST that should not be emitted.

Definition at line 4044 of file ASTReader.cpp.

ExternalLoadResult ASTReader::FindExternalLexicalDecls ( const DeclContext DC,
bool(*)(Decl::Kind isKindWeWant,
SmallVectorImpl< Decl * > &  Decls 
) [override, virtual]

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

Parameters:
DCThe declaration context whose declarations will be read.
DeclsVector 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.
Returns:
true if there was an error while reading the declarations for this declaration context.

Reimplemented from clang::ExternalASTSource.

Definition at line 6344 of file ASTReader.cpp.

References clang::ELR_Success.

bool ASTReader::FindExternalVisibleDeclsByName ( const DeclContext DC,
DeclarationName  Name 
) [override, virtual]

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

Reimplemented from clang::ExternalASTSource.

Definition at line 6524 of file ASTReader.cpp.

References Contexts, clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationName::getCXXOverloadedOperator(), getDefinitiveModuleFileFor(), clang::DeclarationName::getNameKind(), clang::DeclContext::hasExternalVisibleStorage(), and clang::DeclContext::isNamespace().

void ASTReader::FindFileRegionDecls ( FileID  File,
unsigned  Offset,
unsigned  Length,
SmallVectorImpl< Decl * > &  Decls 
) [override, virtual]

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

Reimplemented from clang::ExternalASTSource.

Definition at line 6388 of file ASTReader.cpp.

References clang::SourceManager::getLocForStartOfFile(), and clang::SourceLocation::getLocWithOffset().

std::pair< unsigned, unsigned > ASTReader::findPreprocessedEntitiesInRange ( SourceRange  Range) [override, virtual]

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

Returns a pair of [Begin, End) indices of preallocated preprocessed entities that.

  • Range encompasses.

Implements clang::ExternalPreprocessingRecordSource.

Definition at line 5009 of file ASTReader.cpp.

References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::SourceManager::isBeforeInTranslationUnit(), clang::SourceRange::isInvalid(), and SourceMgr.

void ASTReader::FinishedDeserializing ( ) [override, virtual]

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

Reimplemented from clang::ExternalASTSource.

Definition at line 8455 of file ASTReader.cpp.

void clang::ASTReader::ForgetSema ( ) [inline, override, virtual]

Inform the semantic consumer that Sema is no longer available.

Reimplemented from clang::ExternalSemaSource.

Definition at line 1798 of file ASTReader.h.

IdentifierInfo * ASTReader::get ( const char *  NameStart,
const char *  NameEnd 
) [virtual]

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.

Definition at line 6943 of file ASTReader.cpp.

IdentifierInfo* clang::ASTReader::get ( StringRef  Name) [inline, override, virtual]

Return the IdentifierInfo for the specified named identifier.

Unlike the version in IdentifierTable, this returns a pointer instead of a reference. If the pointer is null then the IdentifierInfo cannot be found.

Implements clang::IdentifierInfoLookup.

Definition at line 1807 of file ASTReader.h.

Retrieve the AST context that this AST reader supplements.

Definition at line 2120 of file ASTReader.h.

Referenced by clang::ASTDeclReader::UpdateDecl().

CXXBaseSpecifier * ASTReader::GetExternalCXXBaseSpecifiers ( uint64_t  Offset) [override, virtual]

Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers.

The default implementation of this method is a no-op.

Reimplemented from clang::ExternalASTSource.

Definition at line 6107 of file ASTReader.cpp.

References clang::ASTContext::Allocate(), Context, clang::serialization::DECL_CXX_BASE_SPECIFIERS, clang::diag::Error, and Record.

Decl * ASTReader::GetExternalDecl ( uint32_t  ID) [override, virtual]

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

This method only needs to be implemented if the AST source ever passes back decl sets as VisibleDeclaration objects.

The default implementation of this method is a no-op.

Reimplemented from clang::ExternalASTSource.

Definition at line 6056 of file ASTReader.cpp.

Stmt * ASTReader::GetExternalDeclStmt ( uint64_t  Offset) [override, virtual]

Resolve the offset of a statement into a statement.

This operation will read a new statement from the external source each time it is called, and is meant to be used via a LazyOffsetPtr (which is used by Decls for the body of functions, etc).

Reimplemented from clang::ExternalASTSource.

Definition at line 6276 of file ASTReader.cpp.

Resolve a selector ID into a selector.

This operation only needs to be implemented if the AST source returns non-zero for GetNumKnownSelectors().

The default implementation of this method is a no-op.

Reimplemented from clang::ExternalASTSource.

Definition at line 7523 of file ASTReader.cpp.

References DecodeSelector().

Definition at line 1344 of file ASTReader.h.

Return global module index.

Definition at line 1458 of file ASTReader.h.

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

Definition at line 7452 of file ASTReader.cpp.

References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::ModuleFile::MacroRemap, and clang::serialization::NUM_PREDEF_MACRO_IDS.

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

Definition at line 1474 of file ASTReader.cpp.

References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::NUM_PREDEF_PP_ENTITY_IDS, and clang::serialization::ModuleFile::PreprocessedEntityRemap.

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

Definition at line 7533 of file ASTReader.cpp.

References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), clang::serialization::NUM_PREDEF_SELECTOR_IDS, and clang::serialization::ModuleFile::SelectorRemap.

Referenced by getLocalSelector().

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

Definition at line 7464 of file ASTReader.cpp.

References clang::ContinuousRangeMap< Int, V, InitialCapacity >::end(), clang::ContinuousRangeMap< Int, V, InitialCapacity >::find(), and clang::serialization::ModuleFile::SubmoduleRemap.

HeaderFileInfo ASTReader::GetHeaderFileInfo ( const FileEntry FE) [override, virtual]

Read the header file information for the given file entry.

Implements clang::ExternalHeaderFileInfoSource.

Definition at line 5075 of file ASTReader.cpp.

Definition at line 1883 of file ASTReader.h.

References DecodeIdentifierInfo().

IdentifierInfo* clang::ASTReader::GetIdentifierInfo ( ModuleFile M,
const RecordData Record,
unsigned Idx 
) [inline]
IdentifierIterator * ASTReader::getIdentifiers ( ) [override, virtual]

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

Reimplemented from clang::IdentifierInfoLookup.

Definition at line 7021 of file ASTReader.cpp.

References ASTIdentifierIterator, and loadGlobalIndex().

Retrieve the identifier table associated with the preprocessor.

Definition at line 8072 of file ASTReader.cpp.

References clang::Preprocessor::getIdentifierTable().

void ASTReader::getInputFiles ( ModuleFile F,
SmallVectorImpl< serialization::InputFile > &  Files 
)

Return all input files for the given module file.

Definition at line 8145 of file ASTReader.cpp.

References clang::serialization::ModuleFile::InputFilesLoaded.

Decl* clang::ASTReader::GetLocalDecl ( ModuleFile F,
uint32_t  LocalID 
) [inline]

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

Definition at line 1669 of file ASTReader.h.

References GetDecl(), and getGlobalDeclID().

Referenced by GetLocalDeclAs().

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

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

Returns:
The requested declaration, casted to the given return type.

Definition at line 1677 of file ASTReader.h.

References GetLocalDecl().

Definition at line 7410 of file ASTReader.cpp.

References DecodeIdentifierInfo(), and getGlobalIdentifierID().

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

Definition at line 7494 of file ASTReader.cpp.

References DecodeSelector(), and getGlobalSelectorID().

Referenced by ReadSelector().

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

Definition at line 5974 of file ASTReader.cpp.

Referenced by readType().

void ASTReader::getMemoryBufferSizes ( MemoryBufferSizes sizes) const [override, virtual]

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

Reimplemented from clang::ExternalASTSource.

Definition at line 6874 of file ASTReader.cpp.

References clang::ExternalASTSource::MemoryBufferSizes::malloc_bytes, and clang::ExternalASTSource::MemoryBufferSizes::mmap_bytes.

Module * ASTReader::getModule ( unsigned  ID) [override, virtual]

Retrieve the module that corresponds to the given module ID.

Note: overrides method in ExternalASTSource

Reimplemented from clang::ExternalASTSource.

Definition at line 7490 of file ASTReader.cpp.

References getSubmodule().

std::pair< SourceLocation, StringRef > ASTReader::getModuleImportLoc ( int  ID) [override, virtual]
ASTReader::ModuleMacroInfo * ASTReader::getModuleMacro ( const PendingMacroInfo &  PMInfo)

Retrieve the module manager.

Definition at line 1492 of file ASTReader.h.

uint32_t ASTReader::GetNumExternalSelectors ( ) [override, virtual]

Returns the number of selectors known to the external AST source.

The default implementation of this method is a no-op.

Reimplemented from clang::ExternalASTSource.

Definition at line 7527 of file ASTReader.cpp.

References getTotalNumSelectors().

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

Definition at line 1499 of file ASTReader.h.

References clang::serialization::ModuleManager::getPrimaryModule(), and clang::serialization::ModuleFile::OriginalSourceFileName.

Referenced by AddImplicitIncludePCH(), and createInvocationForMigration().

std::string ASTReader::getOriginalSourceFile ( const std::string &  ASTFileName,
FileManager FileMgr,
DiagnosticsEngine Diags 
) [static]

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

Definition at line 4114 of file ASTReader.cpp.

References clang::serialization::CONTROL_BLOCK_ID, clang::FileManager::getBufferForFile(), clang::serialization::ORIGINAL_FILE, Record, clang::DiagnosticsEngine::Report(), and SkipCursorToBlock().

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

Definition at line 6149 of file ASTReader.cpp.

References clang::Decl::getGlobalID(), and clang::Decl::isFromASTFile().

Referenced by getDefinitiveModuleFileFor(), getOwningModuleNameForDiagnostic(), and ReadLateParsedTemplates().

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.

Definition at line 8153 of file ASTReader.cpp.

References clang::Decl::getOwningModule(), getOwningModuleFile(), and clang::serialization::ModuleFile::ModuleName.

Retrieve the preprocessor.

Definition at line 1495 of file ASTReader.h.

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

Definition at line 2129 of file ASTReader.h.

Referenced by ReadMethodPool().

Returns the source location for the decl ID.

Definition at line 6157 of file ASTReader.cpp.

References clang::diag::Error, clang::Decl::getLocation(), and clang::serialization::NUM_PREDEF_DECL_IDS.

Definition at line 1343 of file ASTReader.h.

Referenced by areDefinedInSystemModules().

Retrieve the submodule that corresponds to a global submodule ID.

Definition at line 7476 of file ASTReader.cpp.

References clang::serialization::NUM_PREDEF_SUBMODULE_IDS.

Referenced by areDefinedInSystemModules(), and getModule().

const std::string& clang::ASTReader::getSuggestedPredefines ( ) [inline]

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

Definition at line 1527 of file ASTReader.h.

Retrieve the switch-case statement with the given ID.

Definition at line 8085 of file ASTReader.cpp.

Returns the number of C++ base specifiers found in the chain.

Definition at line 1598 of file ASTReader.h.

Returns the number of declarations found in the chain.

Definition at line 1571 of file ASTReader.h.

Returns the number of identifiers found in the chain.

Definition at line 1556 of file ASTReader.h.

Returns the number of macros found in the chain.

Definition at line 1561 of file ASTReader.h.

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

Definition at line 1587 of file ASTReader.h.

References clang::serialization::ModuleManager::begin(), and clang::serialization::ModuleManager::end().

Returns the number of selectors found in the chain.

Definition at line 1581 of file ASTReader.h.

Referenced by GetNumExternalSelectors().

Returns the number of source locations found in the chain.

Definition at line 1551 of file ASTReader.h.

Returns the number of submodules known.

Definition at line 1576 of file ASTReader.h.

Returns the number of types found in the chain.

Definition at line 1566 of file ASTReader.h.

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

Definition at line 5882 of file ASTReader.cpp.

References clang::ASTContext::ARCUnbridgedCastTy, clang::ASTContext::BoolTy, clang::ASTContext::BoundMemberTy, clang::ASTContext::BuiltinFnTy, clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::CharTy, Context, clang::ASTContext::DependentTy, clang::ASTContext::DoubleTy, clang::Qualifiers::FastMask, clang::Qualifiers::FastWidth, clang::ASTContext::FloatTy, clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoRRefDeductType(), clang::ASTContext::getVaListTagType(), clang::ASTContext::HalfTy, clang::ASTContext::Int128Ty, clang::ASTContext::IntTy, clang::QualType::isNull(), clang::ASTContext::LongDoubleTy, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::ASTContext::NullPtrTy, clang::serialization::NUM_PREDEF_TYPE_IDS, clang::ASTContext::ObjCBuiltinClassTy, clang::ASTContext::ObjCBuiltinIdTy, clang::ASTContext::ObjCBuiltinSelTy, clang::ASTContext::OCLEventTy, clang::ASTContext::OCLImage1dArrayTy, clang::ASTContext::OCLImage1dBufferTy, clang::ASTContext::OCLImage1dTy, clang::ASTContext::OCLImage2dArrayTy, clang::ASTContext::OCLImage2dTy, clang::ASTContext::OCLImage3dTy, clang::ASTContext::OCLSamplerTy, clang::ASTContext::OverloadTy, clang::serialization::PREDEF_TYPE_ARC_UNBRIDGED_CAST, clang::serialization::PREDEF_TYPE_AUTO_DEDUCT, clang::serialization::PREDEF_TYPE_AUTO_RREF_DEDUCT, clang::serialization::PREDEF_TYPE_BOOL_ID, clang::serialization::PREDEF_TYPE_BOUND_MEMBER, clang::serialization::PREDEF_TYPE_BUILTIN_FN, clang::serialization::PREDEF_TYPE_CHAR16_ID, clang::serialization::PREDEF_TYPE_CHAR32_ID, clang::serialization::PREDEF_TYPE_CHAR_S_ID, clang::serialization::PREDEF_TYPE_CHAR_U_ID, clang::serialization::PREDEF_TYPE_DEPENDENT_ID, clang::serialization::PREDEF_TYPE_DOUBLE_ID, clang::serialization::PREDEF_TYPE_EVENT_ID, clang::serialization::PREDEF_TYPE_FLOAT_ID, clang::serialization::PREDEF_TYPE_HALF_ID, clang::serialization::PREDEF_TYPE_IMAGE1D_ARR_ID, clang::serialization::PREDEF_TYPE_IMAGE1D_BUFF_ID, clang::serialization::PREDEF_TYPE_IMAGE1D_ID, clang::serialization::PREDEF_TYPE_IMAGE2D_ARR_ID, clang::serialization::PREDEF_TYPE_IMAGE2D_ID, clang::serialization::PREDEF_TYPE_IMAGE3D_ID, clang::serialization::PREDEF_TYPE_INT128_ID, clang::serialization::PREDEF_TYPE_INT_ID, clang::serialization::PREDEF_TYPE_LONG_ID, clang::serialization::PREDEF_TYPE_LONGDOUBLE_ID, clang::serialization::PREDEF_TYPE_LONGLONG_ID, clang::serialization::PREDEF_TYPE_NULL_ID, clang::serialization::PREDEF_TYPE_NULLPTR_ID, clang::serialization::PREDEF_TYPE_OBJC_CLASS, clang::serialization::PREDEF_TYPE_OBJC_ID, clang::serialization::PREDEF_TYPE_OBJC_SEL, clang::serialization::PREDEF_TYPE_OVERLOAD_ID, clang::serialization::PREDEF_TYPE_PSEUDO_OBJECT, clang::serialization::PREDEF_TYPE_SAMPLER_ID, clang::serialization::PREDEF_TYPE_SCHAR_ID, clang::serialization::PREDEF_TYPE_SHORT_ID, clang::serialization::PREDEF_TYPE_UCHAR_ID, clang::serialization::PREDEF_TYPE_UINT128_ID, clang::serialization::PREDEF_TYPE_UINT_ID, clang::serialization::PREDEF_TYPE_ULONG_ID, clang::serialization::PREDEF_TYPE_ULONGLONG_ID, clang::serialization::PREDEF_TYPE_UNKNOWN_ANY, clang::serialization::PREDEF_TYPE_USHORT_ID, clang::serialization::PREDEF_TYPE_VA_LIST_TAG, clang::serialization::PREDEF_TYPE_VOID_ID, clang::serialization::PREDEF_TYPE_WCHAR_ID, clang::ASTContext::PseudoObjectTy, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::ASTContext::UnknownAnyTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedInt128Ty, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortTy, clang::ASTContext::VoidTy, clang::ASTContext::WCharTy, and clang::QualType::withFastQualifiers().

TypeSourceInfo * ASTReader::GetTypeSourceInfo ( ModuleFile F,
const RecordData Record,
unsigned Idx 
)

Determine whether this AST reader has a global index.

Definition at line 1455 of file ASTReader.h.

void ASTReader::InitializeSema ( Sema S) [override, virtual]

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

Reimplemented from clang::ExternalSemaSource.

Definition at line 6891 of file ASTReader.cpp.

References clang::Sema::addExternalSource(), clang::NamedDecl::getDeclName(), and S.

void ASTReader::installPCHMacroDirectives ( IdentifierInfo II,
ModuleFile M,
uint64_t  Offset 
)
bool ASTReader::isAcceptableASTFile ( StringRef  Filename,
FileManager FileMgr,
const LangOptions LangOpts,
const TargetOptions TargetOpts,
const PreprocessorOptions PPOpts 
) [static]

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

Definition at line 4376 of file ASTReader.cpp.

Referenced by clang::FrontendAction::BeginSourceFile().

Returns true if global DeclID ID originated from module M.

Definition at line 6142 of file ASTReader.cpp.

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

Definition at line 3570 of file ASTReader.cpp.

References Context, and clang::ASTContext::getLangOpts().

Optional< bool > ASTReader::isPreprocessedEntityInFileID ( unsigned  Index,
FileID  FID 
) [override, virtual]

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

Optionally returns true or false if the preallocated preprocessed entity with index.

  • Index came from file
  • FID.

Reimplemented from clang::ExternalPreprocessingRecordSource.

Definition at line 5022 of file ASTReader.cpp.

References clang::serialization::PPEntityOffset::Begin, clang::SourceManager::getFileLoc(), clang::SourceManager::isInFileID(), clang::FileID::isInvalid(), clang::SourceLocation::isInvalid(), clang::serialization::ModuleFile::PreprocessedEntityOffsets, and SourceMgr.

Attempts to load the global index.

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

Definition at line 3548 of file ASTReader.cpp.

References Context, clang::ASTContext::getLangOpts(), and clang::GlobalModuleIndex::readIndex().

Referenced by getIdentifiers().

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

Definition at line 7314 of file ASTReader.cpp.

References ReadMethodPool().

void ASTReader::makeModuleVisible ( Module Mod,
Module::NameVisibilityKind  NameVisibility,
SourceLocation  ImportLoc,
bool  Complain 
)

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

Parameters:
ModThe module whose names should be made visible.
NameVisibilityThe level of visibility to give the names in the module. Visibility can only be increased over time.
ImportLocThe location at which the import occurs.
ComplainWhether to complain about conflicting module imports.

Definition at line 3483 of file ASTReader.cpp.

References clang::Module::Conflicts, Diag(), clang::Module::getExportedModules(), clang::Module::getFullModuleName(), clang::Module::isAvailable(), clang::SourceLocation::isValid(), clang::Module::MacrosVisible, clang::Module::MacroVisibilityLoc, clang::Module::NameVisibility, and Stack.

void ASTReader::makeNamesVisible ( const HiddenNames &  Names,
Module Owner,
bool  FromFinalization 
)

Make the names within this set of hidden names visible.

Definition at line 3458 of file ASTReader.cpp.

References clang::Decl::Hidden, clang::Module::MacrosVisible, moveMethodToBackOfGlobalList(), and clang::Module::NameVisibility.

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

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

Definition at line 6243 of file ASTReader.cpp.

References clang::serialization::ModuleFile::GlobalToLocalDeclIDs, and clang::serialization::NUM_PREDEF_DECL_IDS.

Note that this identifier is up-to-date.

Definition at line 1724 of file ASTReader.cpp.

References clang::IdentifierInfo::setOutOfDate().

void ASTReader::PrintStats ( ) [override, virtual]

Print some statistics about AST usage.

Reimplemented from clang::ExternalASTSource.

Definition at line 6736 of file ASTReader.cpp.

References dump().

llvm::APFloat ASTReader::ReadAPFloat ( const RecordData Record,
const llvm::fltSemantics &  Sem,
unsigned Idx 
)

Read a floating-point value.

Definition at line 8029 of file ASTReader.cpp.

References ReadAPInt().

llvm::APInt ASTReader::ReadAPInt ( const RecordData Record,
unsigned Idx 
)

Read an integral value.

Definition at line 8014 of file ASTReader.cpp.

Referenced by ReadAPFloat(), and ReadAPSInt().

llvm::APSInt ASTReader::ReadAPSInt ( const RecordData Record,
unsigned Idx 
)

Read a signed integral value.

Definition at line 8023 of file ASTReader.cpp.

References ReadAPInt().

Referenced by ReadTemplateArgument().

ASTReader::ASTReadResult ASTReader::ReadAST ( const std::string &  FileName,
ModuleKind  Type,
SourceLocation  ImportLoc,
unsigned  ClientLoadCapabilities 
)

Load the AST file designated by the given file name.

Parameters:
FileNameThe name of the AST file to load.
TypeThe kind of AST being loaded, e.g., PCH, module, main file, or preamble.
ImportLocthe location where the module file will be considered as imported from. For non-module AST types it should be invalid.
ClientLoadCapabilitiesThe set of client load-failure capabilities, represented as a bitset of the enumerators of LoadFailureCapabilities.

Definition at line 3585 of file ASTReader.cpp.

References Context, clang::serialization::ModuleFile::DirectImportLoc, clang::ASTContext::getLangOpts(), clang::serialization::ModuleFile::GlobalBitOffset, clang::serialization::ModuleFile::ImportLoc, clang::FileID::isInvalid(), clang::Module::Conflict::Message, clang::serialization::MK_ImplicitModule, clang::serialization::MK_MainFile, clang::serialization::MK_Preamble, clang::serialization::ModuleFile::OriginalSourceFileID, clang::Module::Conflict::Other, clang::serialization::ModuleFile::PreloadSLocEntries, clang::SourceManager::setMainFileID(), clang::SourceManager::setPreambleFileID(), clang::serialization::ModuleFile::SizeInBits, clang::serialization::ModuleFile::SLocEntryBaseID, SourceMgr, clang::format::Success, updateModuleTimestamp(), and clang::serialized_diags::VersionMismatch.

bool ASTReader::readASTFileControlBlock ( StringRef  Filename,
FileManager FileMgr,
ASTReaderListener Listener 
) [static]
void ASTReader::ReadAttributes ( ModuleFile F,
AttrVec Attrs,
const RecordData Record,
unsigned Idx 
)

Reads attributes from the current stream position.

Definition at line 2234 of file ASTReaderDecl.cpp.

Referenced by clang::ASTDeclReader::UpdateDecl().

bool ASTReader::ReadBlockAbbrevs ( llvm::BitstreamCursor &  Cursor,
unsigned  BlockID 
)

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.

Definition at line 1331 of file ASTReader.cpp.

References clang::diag::Error.

void ASTReader::ReadComments ( ) [override, virtual]
uint64_t ASTReader::readCXXBaseSpecifiers ( ModuleFile M,
const RecordData Record,
unsigned Idx 
)

Read a CXXBaseSpecifiers ID form the given record and return its global bit offset.

Definition at line 6095 of file ASTReader.cpp.

References clang::serialization::ModuleFile::CXXBaseSpecifiersOffsets, clang::diag::Error, and clang::serialization::ModuleFile::LocalNumCXXBaseSpecifiers.

std::pair< CXXCtorInitializer **, unsigned > ASTReader::ReadCXXCtorInitializers ( ModuleFile F,
const RecordData Record,
unsigned Idx 
)
CXXTemporary * ASTReader::ReadCXXTemporary ( ModuleFile F,
const RecordData Record,
unsigned Idx 
)

Definition at line 8055 of file ASTReader.cpp.

References clang::CXXTemporary::Create(), and Record.

Decl* clang::ASTReader::ReadDecl ( ModuleFile F,
const RecordData R,
unsigned I 
) [inline]

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

Definition at line 1699 of file ASTReader.h.

References GetDecl(), and ReadDeclID().

Referenced by clang::ASTDeclReader::UpdateDecl().

void ASTReader::ReadDeclarationNameInfo ( ModuleFile F,
DeclarationNameInfo NameInfo,
const RecordData Record,
unsigned Idx 
)
void ASTReader::ReadDeclarationNameLoc ( ModuleFile F,
DeclarationNameLoc DNLoc,
DeclarationName  Name,
const RecordData Record,
unsigned Idx 
)
template<typename T >
T* clang::ASTReader::ReadDeclAs ( ModuleFile F,
const RecordData R,
unsigned I 
) [inline]

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

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

Definition at line 1709 of file ASTReader.h.

References GetDecl(), and ReadDeclID().

Referenced by clang::ASTDeclReader::UpdateDecl().

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

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

Definition at line 6260 of file ASTReader.cpp.

References clang::diag::Error.

Referenced by ReadDecl(), ReadDeclAs(), and ReadUnresolvedSet().

void ASTReader::ReadDefinedMacros ( ) [override, virtual]

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

Implements clang::ExternalPreprocessorSource.

Definition at line 1596 of file ASTReader.cpp.

References clang::diag::Error, clang::serialization::PP_MACRO_FUNCTION_LIKE, clang::serialization::PP_MACRO_OBJECT_LIKE, clang::serialization::PP_TOKEN, and Record.

void ASTReader::ReadDelegatingConstructors ( SmallVectorImpl< CXXConstructorDecl * > &  Decls) [override, virtual]

Read the set of delegating constructors known to the external Sema source.

The external source should append its own delegating constructors to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7175 of file ASTReader.cpp.

References GetDecl().

void ASTReader::ReadDynamicClasses ( SmallVectorImpl< CXXRecordDecl * > &  Decls) [override, virtual]

Read the set of dynamic classes known to the external Sema source.

The external source should append its own dynamic classes to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7196 of file ASTReader.cpp.

References GetDecl().

Reads an expression.

Definition at line 2163 of file ASTReaderStmt.cpp.

Referenced by ReadCXXCtorInitializers(), and ReadTemplateArgument().

void ASTReader::ReadExtVectorDecls ( SmallVectorImpl< TypedefNameDecl * > &  Decls) [override, virtual]

Read the set of ext_vector type declarations known to the external Sema source.

The external source should append its own ext_vector type declarations to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7186 of file ASTReader.cpp.

References GetDecl().

void ASTReader::ReadKnownNamespaces ( SmallVectorImpl< NamespaceDecl * > &  Namespaces) [override, virtual]

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

Reimplemented from clang::ExternalSemaSource.

Definition at line 7133 of file ASTReader.cpp.

References GetDecl().

void ASTReader::ReadLateParsedTemplates ( llvm::DenseMap< const FunctionDecl *, LateParsedTemplate * > &  LPTMap) [override, virtual]

Read the set of late parsed template functions for this source.

The external source should insert its own late parsed template functions into the map. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same map entries repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7291 of file ASTReader.cpp.

References clang::LateParsedTemplate::D, GetDecl(), getOwningModuleFile(), and ReadToken().

void ASTReader::ReadLocallyScopedExternCDecls ( SmallVectorImpl< NamedDecl * > &  Decls) [override, virtual]

Read the set of locally-scoped external declarations known to the external Sema source.

The external source should append its own locally-scoped external declarations to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7219 of file ASTReader.cpp.

References GetDecl().

MacroInfo * ASTReader::ReadMacroRecord ( ModuleFile F,
uint64_t  Offset 
)
void ASTReader::ReadMethodPool ( Selector  Sel) [override, virtual]
void ASTReader::ReadPendingInstantiations ( SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &  Pending) [override, virtual]

Read the set of pending instantiations known to the external Sema source.

The external source should append its own pending instantiations to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same instantiations repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7279 of file ASTReader.cpp.

References GetDecl(), and clang::SourceLocation::getFromRawEncoding().

void ASTReader::ReadQualifierInfo ( ModuleFile F,
QualifierInfo Info,
const RecordData Record,
unsigned Idx 
)
void ASTReader::ReadReferencedSelectors ( SmallVectorImpl< std::pair< Selector, SourceLocation > > &  Sels) [override, virtual]

Read the set of referenced selectors known to the external Sema source.

The external source should append its own referenced selectors to the given vector of selectors. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same selectors repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7229 of file ASTReader.cpp.

References DecodeSelector(), and clang::SourceLocation::getFromRawEncoding().

Selector clang::ASTReader::ReadSelector ( ModuleFile M,
const RecordData Record,
unsigned Idx 
) [inline]

Definition at line 1954 of file ASTReader.h.

References getLocalSelector().

Referenced by ReadDeclarationName().

bool ASTReader::ReadSLocEntry ( int  ID) [override, virtual]
SourceLocation clang::ASTReader::ReadSourceLocation ( ModuleFile ModuleFile,
unsigned  Raw 
) const [inline]
SourceLocation clang::ASTReader::ReadSourceLocation ( ModuleFile ModuleFile,
const RecordDataImpl Record,
unsigned Idx 
) [inline]

Read a source location.

Definition at line 2025 of file ASTReader.h.

References ReadSourceLocation().

SourceRange ASTReader::ReadSourceRange ( ModuleFile F,
const RecordData Record,
unsigned Idx 
)

Read a source range.

Definition at line 8006 of file ASTReader.cpp.

References ReadSourceLocation().

Referenced by ReadComments(), ReadCXXBaseSpecifier(), and ReadNestedNameSpecifierLoc().

Reads a statement.

Definition at line 2149 of file ASTReaderStmt.cpp.

std::string ASTReader::ReadString ( const RecordData Record,
unsigned Idx 
) [static]

Definition at line 8036 of file ASTReader.cpp.

Reads a sub-expression operand during statement reading.

Definition at line 2167 of file ASTReaderStmt.cpp.

Reads a sub-statement operand during statement reading.

Definition at line 2065 of file ASTReader.h.

void ASTReader::ReadTemplateArgumentList ( SmallVectorImpl< TemplateArgument > &  TemplArgs,
ModuleFile F,
const RecordData Record,
unsigned Idx 
)

Read a template argument array.

Definition at line 7762 of file ASTReader.cpp.

References ReadTemplateArgument().

Referenced by clang::ASTDeclReader::UpdateDecl().

TemplateName ASTReader::ReadTemplateName ( ModuleFile F,
const RecordData Record,
unsigned Idx 
)

Read a template parameter list.

Definition at line 7742 of file ASTReader.cpp.

References clang::TemplateParameterList::Create(), and ReadSourceLocation().

Referenced by ReadQualifierInfo().

void ASTReader::ReadTentativeDefinitions ( SmallVectorImpl< VarDecl * > &  TentativeDefs) [override, virtual]

Read the set of tentative definitions known to the external Sema source.

The external source should append its own tentative definitions to the given vector of tentative definitions. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7154 of file ASTReader.cpp.

References GetDecl().

Token ASTReader::ReadToken ( ModuleFile M,
const RecordDataImpl Record,
unsigned Idx 
)
QualType clang::ASTReader::readType ( ModuleFile F,
const RecordData Record,
unsigned Idx 
) [inline]

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

Definition at line 1633 of file ASTReader.h.

References getLocalType().

Referenced by ReadDeclarationName(), ReadNestedNameSpecifier(), ReadTemplateArgument(), and clang::ASTDeclReader::UpdateDecl().

void ASTReader::ReadUndefinedButUsed ( llvm::DenseMap< NamedDecl *, SourceLocation > &  Undefined) [override, virtual]

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

Reimplemented from clang::ExternalSemaSource.

Definition at line 7144 of file ASTReader.cpp.

References GetDecl(), and clang::SourceLocation::getFromRawEncoding().

void ASTReader::ReadUnresolvedSet ( ModuleFile F,
LazyASTUnresolvedSet Set,
const RecordData Record,
unsigned Idx 
)
void ASTReader::ReadUnusedFileScopedDecls ( SmallVectorImpl< const DeclaratorDecl * > &  Decls) [override, virtual]

Read the set of unused file-scope declarations known to the external Sema source.

The external source should append its own unused, filed-scope to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7164 of file ASTReader.cpp.

References GetDecl().

void ASTReader::ReadUnusedLocalTypedefNameCandidates ( llvm::SmallSetVector< const TypedefNameDecl *, 4 > &  Decls) [override, virtual]

Read the set of potentially unused typedefs known to the source.

The external source should append its own potentially unused local typedefs to the given vector of declarations. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same declarations repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7206 of file ASTReader.cpp.

References GetDecl().

void ASTReader::ReadUsedVTables ( SmallVectorImpl< ExternalVTableUse > &  VTables) [override, virtual]

Read the set of used vtables known to the external Sema source.

The external source should append its own used vtables to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same vtables repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7267 of file ASTReader.cpp.

References clang::ExternalVTableUse::DefinitionRequired, GetDecl(), clang::SourceLocation::getFromRawEncoding(), clang::ExternalVTableUse::Location, and clang::ExternalVTableUse::Record.

VersionTuple ASTReader::ReadVersionTuple ( const RecordData Record,
unsigned Idx 
) [static]

Read a version tuple.

Definition at line 8043 of file ASTReader.cpp.

void ASTReader::ReadWeakUndeclaredIdentifiers ( SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &  WI) [override, virtual]

Read the set of weak, undeclared identifiers known to the external Sema source.

The external source should append its own weak, undeclared identifiers to the given vector. Note that this routine may be invoked multiple times; the external source should take care not to introduce the same identifiers repeatedly.

Reimplemented from clang::ExternalSemaSource.

Definition at line 7247 of file ASTReader.cpp.

References DecodeIdentifierInfo(), clang::SourceLocation::getFromRawEncoding(), clang::WeakInfo::setUsed(), and Used.

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

Definition at line 8078 of file ASTReader.cpp.

Reset reader for a reload try.

Definition at line 1461 of file ASTReader.h.

void ASTReader::resolvePendingMacro ( IdentifierInfo II,
const PendingMacroInfo &  PMInfo 
)
void ASTReader::setDeserializationListener ( ASTDeserializationListener Listener,
bool  TakeOwnership = false 
)

Set the AST deserialization listener.

Definition at line 602 of file ASTReader.cpp.

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

Set the globally-visible declarations associated with the given identifier.

If the AST reader is currently in a state where the given declaration IDs cannot safely be resolved, they are queued until it is safe to resolve them.

Parameters:
IIan IdentifierInfo that refers to one or more globally-visible declarations.
DeclIDsthe set of declaration IDs with the name II that are visible at global scope.
Declsif non-null, this vector will be populated with the set of deserialized declarations. These declarations will not be pushed into scope.

Definition at line 7344 of file ASTReader.cpp.

References GetDecl(), and PreloadedDeclIDs.

void clang::ASTReader::setListener ( std::unique_ptr< ASTReaderListener Listener) [inline]

Set the AST callbacks listener.

Definition at line 1412 of file ASTReader.h.

Referenced by clang::ASTReader::ListenerScope::ListenerScope(), and clang::ASTReader::ListenerScope::~ListenerScope().

void clang::ASTReader::StartedDeserializing ( ) [inline, override, virtual]

Notify ASTReader that we started deserialization of a decl or type so until FinishedDeserializing is called there may be decls that are initializing. Must be paired with FinishedDeserializing.

Reimplemented from clang::ExternalASTSource.

Definition at line 1769 of file ASTReader.h.

void ASTReader::StartTranslationUnit ( ASTConsumer Consumer) [override, virtual]

Function that will be invoked when we begin parsing a new translation unit involving this external AST source.

This function will provide all of the external definitions to the ASTConsumer.

Reimplemented from clang::ExternalASTSource.

Definition at line 6720 of file ASTReader.cpp.

std::unique_ptr<ASTReaderListener> clang::ASTReader::takeListener ( ) [inline]

Take the AST callbacks listener.

Definition at line 1407 of file ASTReader.h.

Referenced by clang::ASTReader::ListenerScope::ListenerScope(), and clang::ASTReader::ListenerScope::~ListenerScope().

void ASTReader::updateOutOfDateIdentifier ( IdentifierInfo II) [override, virtual]

Update an out-of-date identifier.

Implements clang::ExternalPreprocessorSource.

Definition at line 1699 of file ASTReader.cpp.

References clang::IdentifierInfo::getName().

Update the state of Sema after loading some additional modules.

Definition at line 6921 of file ASTReader.cpp.


Friends And Related Function Documentation

friend class ASTDeclReader [friend]

Definition at line 332 of file ASTReader.h.

friend class ASTIdentifierIterator [friend]

Definition at line 334 of file ASTReader.h.

Referenced by getIdentifiers().

friend class ASTStmtReader [friend]

Definition at line 333 of file ASTReader.h.

friend class ASTUnit [friend]

Definition at line 338 of file ASTReader.h.

friend class ASTWriter [friend]

Definition at line 337 of file ASTReader.h.

friend class PCHValidator [friend]

Types of AST files.

Definition at line 331 of file ASTReader.h.

Definition at line 335 of file ASTReader.h.

friend class serialization::ReadMethodPoolVisitor [friend]

Definition at line 339 of file ASTReader.h.

friend class TypeLocReader [friend]

Definition at line 336 of file ASTReader.h.


Member Data Documentation

Definition at line 1906 of file ASTReader.h.

SmallVector<std::pair<llvm::BitstreamCursor, serialization::ModuleFile *>, 8> clang::ASTReader::CommentsCursors

Cursors for comments blocks.

Definition at line 2146 of file ASTReader.h.

Referenced by ReadComments().

SmallVector<uint64_t, 16> clang::ASTReader::PreloadedDeclIDs

Definition at line 2124 of file ASTReader.h.

Referenced by SetGloballyVisibleDecls().


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