clang  12.0.0git
Public Member Functions | List of all members
clang::ASTRecordReader Class Reference

An object for streaming information from a record. More...

#include "clang/Serialization/ASTRecordReader.h"

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

Public Member Functions

 ASTRecordReader (ASTReader &Reader, ModuleFile &F)
 Construct an ASTRecordReader that uses the default encoding scheme. More...
 
Expected< unsigned > readRecord (llvm::BitstreamCursor &Cursor, unsigned AbbrevID)
 Reads a record with id AbbrevID from Cursor, resetting the internal state. More...
 
bool isModule () const
 Is this a module file for a module (rather than a PCH or similar). More...
 
ASTContextgetContext ()
 Retrieve the AST context that this AST reader supplements. More...
 
unsigned getIdx () const
 The current position in this record. More...
 
size_t size () const
 The length of this record. More...
 
const uint64_t & operator[] (size_t N)
 An arbitrary index in this record. More...
 
uint64_t back ()
 Returns the last value in this record. More...
 
uint64_t readInt ()
 Returns the current value in this record, and advances to the next value. More...
 
ArrayRef< uint64_t > readIntArray (unsigned Len)
 
uint64_t peekInt ()
 Returns the current value in this record, without advancing. More...
 
void skipInts (unsigned N)
 Skips the specified number of values. More...
 
serialization::SubmoduleID getGlobalSubmoduleID (unsigned LocalID)
 Retrieve the global submodule ID its local ID number. More...
 
ModulegetSubmodule (serialization::SubmoduleID GlobalID)
 Retrieve the submodule that corresponds to a global submodule ID. More...
 
bool readLexicalDeclContextStorage (uint64_t Offset, DeclContext *DC)
 Read the record that describes the lexical contents of a DC. More...
 
bool readVisibleDeclContextStorage (uint64_t Offset, serialization::DeclID ID)
 Read the record that describes the visible contents of a DC. More...
 
ExplicitSpecifier readExplicitSpec ()
 
uint64_t getGlobalBitOffset (uint64_t LocalOffset)
 Read information about an exception specification (inherited). More...
 
StmtreadStmt ()
 Reads a statement. More...
 
StmtreadStmtRef ()
 
ExprreadExpr ()
 Reads an expression. More...
 
StmtreadSubStmt ()
 Reads a sub-statement operand during statement reading. More...
 
ExprreadSubExpr ()
 Reads a sub-expression operand during statement reading. More...
 
template<typename T >
T * GetLocalDeclAs (uint32_t LocalID)
 Reads a declaration with the given local ID in the given module. More...
 
TemplateArgumentLocInfo readTemplateArgumentLocInfo (TemplateArgument::ArgKind Kind)
 Reads a TemplateArgumentLocInfo appropriate for the given TemplateArgument kind, advancing Idx. More...
 
TemplateArgumentLoc readTemplateArgumentLoc ()
 Reads a TemplateArgumentLoc, advancing Idx. More...
 
const ASTTemplateArgumentListInforeadASTTemplateArgumentListInfo ()
 
TypeSourceInforeadTypeSourceInfo ()
 Reads a declarator info from the given record, advancing Idx. More...
 
void readTypeLoc (TypeLoc TL)
 Reads the location information for a type. More...
 
serialization::TypeID getGlobalTypeID (unsigned LocalID) const
 Map a local type ID within a given AST file to a global type ID. More...
 
Qualifiers readQualifiers ()
 
QualType readType ()
 Read a type from the current position in the record. More...
 
QualType readQualType ()
 
serialization::DeclID readDeclID ()
 Reads a declaration ID from the given position in this record. More...
 
DeclreadDecl ()
 Reads a declaration from the given position in a record in the given module, advancing Idx. More...
 
DeclreadDeclRef ()
 
template<typename T >
T * readDeclAs ()
 Reads a declaration from the given position in the record, advancing Idx. More...
 
IdentifierInforeadIdentifier ()
 
Selector readSelector ()
 Read a selector from the Record, advancing Idx. More...
 
DeclarationNameLoc readDeclarationNameLoc (DeclarationName Name)
 Read a declaration name, advancing Idx. More...
 
DeclarationNameInfo readDeclarationNameInfo ()
 
void readQualifierInfo (QualifierInfo &Info)
 
NestedNameSpecifierLoc readNestedNameSpecifierLoc ()
 Return a nested name specifier, advancing Idx. More...
 
TemplateArgument readTemplateArgument (bool Canonicalize)
 
TemplateParameterListreadTemplateParameterList ()
 Read a template parameter list, advancing Idx. More...
 
void readTemplateArgumentList (SmallVectorImpl< TemplateArgument > &TemplArgs, bool Canonicalize=false)
 Read a template argument array, advancing Idx. More...
 
void readUnresolvedSet (LazyASTUnresolvedSet &Set)
 Read a UnresolvedSet structure, advancing Idx. More...
 
CXXBaseSpecifier readCXXBaseSpecifier ()
 Read a C++ base specifier, advancing Idx. More...
 
CXXCtorInitializer ** readCXXCtorInitializers ()
 Read a CXXCtorInitializer array, advancing Idx. More...
 
CXXTemporaryreadCXXTemporary ()
 
OMPTraitInforeadOMPTraitInfo ()
 Read an OMPTraitInfo object, advancing Idx. More...
 
OMPClausereadOMPClause ()
 Read an OpenMP clause, advancing Idx. More...
 
SourceLocation readSourceLocation ()
 Read a source location, advancing Idx. More...
 
SourceRange readSourceRange ()
 Read a source range, advancing Idx. More...
 
APValue readAPValue ()
 Read an arbitrary constant value, advancing Idx. More...
 
llvm::APFloat readAPFloat (const llvm::fltSemantics &Sem)
 Read an integral value, advancing Idx. More...
 
bool readBool ()
 Read a boolean value, advancing Idx. More...
 
uint32_t readUInt32 ()
 Read a 32-bit unsigned value; required to satisfy BasicReader. More...
 
uint64_t readUInt64 ()
 Read a 64-bit unsigned value; required to satisfy BasicReader. More...
 
std::string readString ()
 Read a string, advancing Idx. More...
 
std::string readPath ()
 Read a path, advancing Idx. More...
 
VersionTuple readVersionTuple ()
 Read a version tuple, advancing Idx. More...
 
AttrreadAttr ()
 Reads one attribute from the current stream position, advancing Idx. More...
 
void readAttributes (AttrVec &Attrs)
 Reads attributes from the current stream position, advancing Idx. More...
 
Token readToken ()
 Reads a token out of a record, advancing Idx. More...
 
void recordSwitchCaseID (SwitchCase *SC, unsigned ID)
 
SwitchCasegetSwitchCaseWithID (unsigned ID)
 Retrieve the switch-case statement with the given ID. More...
 
- Public Member Functions inherited from clang::serialization::DataStreamBasicReader< ASTRecordReader >
ASTRecordReaderfind (const char *propertyName)
 Implement property-find by ignoring it. More...
 
readEnum ()
 
ASTRecordReaderreadObject ()
 
llvm::ArrayRef< T > readArray (llvm::SmallVectorImpl< T > &buffer)
 
llvm::Optional< T > readOptional (Args &&...args)
 
llvm::APSInt readAPSInt ()
 
llvm::APInt readAPInt ()
 
Qualifiers readQualifiers ()
 
FunctionProtoType::ExceptionSpecInfo readExceptionSpecInfo (llvm::SmallVectorImpl< QualType > &buffer)
 
FunctionProtoType::ExtParameterInfo readExtParameterInfo ()
 
NestedNameSpecifierreadNestedNameSpecifier ()
 

Additional Inherited Members

- Protected Member Functions inherited from clang::serialization::DataStreamBasicReader< ASTRecordReader >
 DataStreamBasicReader (ASTContext &ctx)
 

Detailed Description

An object for streaming information from a record.

Definition at line 29 of file ASTRecordReader.h.

Constructor & Destructor Documentation

◆ ASTRecordReader()

clang::ASTRecordReader::ASTRecordReader ( ASTReader Reader,
ModuleFile F 
)
inline

Construct an ASTRecordReader that uses the default encoding scheme.

Definition at line 43 of file ASTRecordReader.h.

References readRecord().

Member Function Documentation

◆ back()

uint64_t clang::ASTRecordReader::back ( )
inline

Returns the last value in this record.

Definition at line 67 of file ASTRecordReader.h.

◆ getContext()

ASTContext& clang::ASTRecordReader::getContext ( )
inline

Retrieve the AST context that this AST reader supplements.

Definition at line 55 of file ASTRecordReader.h.

References clang::ASTReader::getContext().

Referenced by readConstraintSatisfaction(), readSubstitutionDiagnostic(), and readTemplateArgument().

◆ getGlobalBitOffset()

uint64_t clang::ASTRecordReader::getGlobalBitOffset ( uint64_t  LocalOffset)
inline

Read information about an exception specification (inherited).

Get the global offset corresponding to a local offset.

Definition at line 122 of file ASTRecordReader.h.

◆ getGlobalSubmoduleID()

serialization::SubmoduleID clang::ASTRecordReader::getGlobalSubmoduleID ( unsigned  LocalID)
inline

Retrieve the global submodule ID its local ID number.

Definition at line 87 of file ASTRecordReader.h.

References clang::ASTReader::getGlobalSubmoduleID().

◆ getGlobalTypeID()

serialization::TypeID clang::ASTRecordReader::getGlobalTypeID ( unsigned  LocalID) const
inline

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

Definition at line 166 of file ASTRecordReader.h.

References clang::ASTReader::getGlobalTypeID().

◆ getIdx()

unsigned clang::ASTRecordReader::getIdx ( ) const
inline

The current position in this record.

Definition at line 58 of file ASTRecordReader.h.

◆ GetLocalDeclAs()

template<typename T >
T* clang::ASTRecordReader::GetLocalDeclAs ( 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 143 of file ASTRecordReader.h.

References clang::ASTReader::GetLocalDecl(), readASTTemplateArgumentListInfo(), readTemplateArgumentLoc(), readTemplateArgumentLocInfo(), readTypeLoc(), and readTypeSourceInfo().

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

◆ getSubmodule()

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

Retrieve the submodule that corresponds to a global submodule ID.

Definition at line 92 of file ASTRecordReader.h.

References clang::ASTReader::getSubmodule().

◆ getSwitchCaseWithID()

SwitchCase* clang::ASTRecordReader::getSwitchCaseWithID ( unsigned  ID)
inline

Retrieve the switch-case statement with the given ID.

Definition at line 335 of file ASTRecordReader.h.

References clang::ASTReader::getSwitchCaseWithID().

◆ isModule()

bool clang::ASTRecordReader::isModule ( ) const
inline

Is this a module file for a module (rather than a PCH or similar).

Definition at line 52 of file ASTRecordReader.h.

References clang::serialization::ModuleFile::isModule().

◆ operator[]()

const uint64_t& clang::ASTRecordReader::operator[] ( size_t  N)
inline

An arbitrary index in this record.

Definition at line 64 of file ASTRecordReader.h.

◆ peekInt()

uint64_t clang::ASTRecordReader::peekInt ( )
inline

Returns the current value in this record, without advancing.

Definition at line 80 of file ASTRecordReader.h.

◆ readAPFloat()

llvm::APFloat ASTRecordReader::readAPFloat ( const llvm::fltSemantics &  Sem)

Read an integral value, advancing Idx.

Read a floating-point value.

Read a signed integral value, advancing Idx. Read a floating-point value, advancing Idx.

Definition at line 9010 of file ASTReader.cpp.

Referenced by readSourceRange().

◆ readAPValue()

APValue ASTRecordReader::readAPValue ( )

◆ readASTTemplateArgumentListInfo()

const ASTTemplateArgumentListInfo * ASTRecordReader::readASTTemplateArgumentListInfo ( )

◆ readAttr()

Attr * ASTRecordReader::readAttr ( )

Reads one attribute from the current stream position, advancing Idx.

Definition at line 2780 of file ASTReaderDecl.cpp.

References V.

Referenced by readVersionTuple().

◆ readAttributes()

void ASTRecordReader::readAttributes ( AttrVec Attrs)

Reads attributes from the current stream position, advancing Idx.

Reads attributes from the current stream position.

Definition at line 2811 of file ASTReaderDecl.cpp.

Referenced by readVersionTuple().

◆ readBool()

bool clang::ASTRecordReader::readBool ( )
inline

Read a boolean value, advancing Idx.

Definition at line 292 of file ASTRecordReader.h.

References readInt().

◆ readCXXBaseSpecifier()

CXXBaseSpecifier ASTRecordReader::readCXXBaseSpecifier ( )

Read a C++ base specifier, advancing Idx.

Definition at line 8801 of file ASTReader.cpp.

References clang::Result, and clang::CXXBaseSpecifier::setInheritConstructors().

Referenced by readTemplateArgument().

◆ readCXXCtorInitializers()

CXXCtorInitializer ** ASTRecordReader::readCXXCtorInitializers ( )

Read a CXXCtorInitializer array, advancing Idx.

Definition at line 8816 of file ASTReader.cpp.

Referenced by clang::ASTReader::GetExternalCXXCtorInitializers(), and readTemplateArgument().

◆ readCXXTemporary()

CXXTemporary* clang::ASTRecordReader::readCXXTemporary ( )
inline

◆ readDecl()

Decl* clang::ASTRecordReader::readDecl ( )
inline

Reads a declaration from the given position in a record in the given module, advancing Idx.

Definition at line 191 of file ASTRecordReader.h.

References clang::ASTReader::ReadDecl().

Referenced by readDeclRef().

◆ readDeclarationNameInfo()

DeclarationNameInfo ASTRecordReader::readDeclarationNameInfo ( )

◆ readDeclarationNameLoc()

DeclarationNameLoc ASTRecordReader::readDeclarationNameLoc ( DeclarationName  Name)

Read a declaration name, advancing Idx.

Definition at line 8708 of file ASTReader.cpp.

Referenced by readSelector().

◆ readDeclAs()

template<typename T >
T* clang::ASTRecordReader::readDeclAs ( )
inline

Reads a declaration from the given position in the record, advancing Idx.

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

Definition at line 204 of file ASTRecordReader.h.

References clang::ASTReader::ReadDeclAs().

◆ readDeclID()

serialization::DeclID clang::ASTRecordReader::readDeclID ( )
inline

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

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

Definition at line 185 of file ASTRecordReader.h.

References clang::ASTReader::ReadDeclID().

◆ readDeclRef()

Decl* clang::ASTRecordReader::readDeclRef ( )
inline

Definition at line 194 of file ASTRecordReader.h.

References readDecl().

◆ readExplicitSpec()

ExplicitSpecifier clang::ASTRecordReader::readExplicitSpec ( )
inline

Definition at line 109 of file ASTRecordReader.h.

References readExpr(), and readInt().

◆ readExpr()

Expr* clang::ASTRecordReader::readExpr ( )
inline

◆ readIdentifier()

IdentifierInfo* clang::ASTRecordReader::readIdentifier ( )
inline

◆ readInt()

uint64_t clang::ASTRecordReader::readInt ( )
inline

Returns the current value in this record, and advances to the next value.

Definition at line 71 of file ASTRecordReader.h.

Referenced by readAPFloatSemantics(), readBool(), readConstraintSatisfaction(), readExplicitSpec(), readQualifiers(), readUInt32(), readUInt64(), and clang::ASTDeclReader::VisitOMPCapturedExprDecl().

◆ readIntArray()

ArrayRef<uint64_t> clang::ASTRecordReader::readIntArray ( unsigned  Len)
inline

Definition at line 73 of file ASTRecordReader.h.

◆ readLexicalDeclContextStorage()

bool clang::ASTRecordReader::readLexicalDeclContextStorage ( uint64_t  Offset,
DeclContext DC 
)
inline

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

Definition at line 97 of file ASTRecordReader.h.

References clang::serialization::ModuleFile::DeclsCursor.

◆ readNestedNameSpecifierLoc()

NestedNameSpecifierLoc ASTRecordReader::readNestedNameSpecifierLoc ( )

Return a nested name specifier, advancing Idx.

Definition at line 8881 of file ASTReader.cpp.

◆ readOMPClause()

OMPClause * ASTRecordReader::readOMPClause ( )

Read an OpenMP clause, advancing Idx.

Definition at line 11738 of file ASTReader.cpp.

References OMPClauseReader.

Referenced by readCXXTemporary().

◆ readOMPTraitInfo()

OMPTraitInfo * ASTRecordReader::readOMPTraitInfo ( )

◆ readPath()

std::string clang::ASTRecordReader::readPath ( )
inline

Read a path, advancing Idx.

Definition at line 310 of file ASTRecordReader.h.

References clang::ASTReader::ReadPath().

◆ readQualifierInfo()

void ASTRecordReader::readQualifierInfo ( QualifierInfo Info)

◆ readQualifiers()

Qualifiers clang::ASTRecordReader::readQualifiers ( )
inline

Definition at line 170 of file ASTRecordReader.h.

References clang::Qualifiers::fromOpaqueValue(), and readInt().

◆ readQualType()

QualType clang::ASTRecordReader::readQualType ( )
inline

Definition at line 178 of file ASTRecordReader.h.

References readType().

◆ readRecord()

Expected< unsigned > ASTRecordReader::readRecord ( llvm::BitstreamCursor &  Cursor,
unsigned  AbbrevID 
)

Reads a record with id AbbrevID from Cursor, resetting the internal state.

Definition at line 11707 of file ASTReader.cpp.

Referenced by ASTRecordReader(), and clang::ASTReader::GetExternalCXXCtorInitializers().

◆ readSelector()

Selector clang::ASTRecordReader::readSelector ( )
inline

Read a selector from the Record, advancing Idx.

Definition at line 213 of file ASTRecordReader.h.

References readDeclarationNameLoc(), and clang::ASTReader::ReadSelector().

◆ readSourceLocation()

SourceLocation clang::ASTRecordReader::readSourceLocation ( )
inline

◆ readSourceRange()

SourceRange clang::ASTRecordReader::readSourceRange ( )
inline

Read a source range, advancing Idx.

Definition at line 275 of file ASTRecordReader.h.

References readAPFloat(), readAPValue(), and clang::ASTReader::ReadSourceRange().

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

◆ readStmt()

Stmt* clang::ASTRecordReader::readStmt ( )
inline

Reads a statement.

Definition at line 127 of file ASTRecordReader.h.

References clang::ASTReader::ReadStmt().

Referenced by readStmtRef().

◆ readStmtRef()

Stmt* clang::ASTRecordReader::readStmtRef ( )
inline

Definition at line 128 of file ASTRecordReader.h.

References readStmt().

◆ readString()

std::string clang::ASTRecordReader::readString ( )
inline

◆ readSubExpr()

Expr* clang::ASTRecordReader::readSubExpr ( )
inline

Reads a sub-expression operand during statement reading.

Definition at line 137 of file ASTRecordReader.h.

References clang::ASTReader::ReadSubExpr().

◆ readSubStmt()

Stmt* clang::ASTRecordReader::readSubStmt ( )
inline

Reads a sub-statement operand during statement reading.

Definition at line 134 of file ASTRecordReader.h.

References clang::ASTReader::ReadSubStmt().

◆ readTemplateArgument()

TemplateArgument clang::ASTRecordReader::readTemplateArgument ( bool  Canonicalize)
inline

◆ readTemplateArgumentList()

void ASTRecordReader::readTemplateArgumentList ( SmallVectorImpl< TemplateArgument > &  TemplArgs,
bool  Canonicalize = false 
)

Read a template argument array, advancing Idx.

Definition at line 8780 of file ASTReader.cpp.

Referenced by readTemplateArgument().

◆ readTemplateArgumentLoc()

TemplateArgumentLoc ASTRecordReader::readTemplateArgumentLoc ( )

◆ readTemplateArgumentLocInfo()

TemplateArgumentLocInfo ASTRecordReader::readTemplateArgumentLocInfo ( TemplateArgument::ArgKind  Kind)

◆ readTemplateParameterList()

TemplateParameterList * ASTRecordReader::readTemplateParameterList ( )

Read a template parameter list, advancing Idx.

Definition at line 8761 of file ASTReader.cpp.

References clang::TemplateParameterList::Create().

Referenced by readTemplateArgument().

◆ readToken()

Token clang::ASTRecordReader::readToken ( )
inline

Reads a token out of a record, advancing Idx.

Definition at line 326 of file ASTRecordReader.h.

References clang::ASTReader::ReadToken().

◆ readType()

QualType clang::ASTRecordReader::readType ( )
inline

Read a type from the current position in the record.

Definition at line 175 of file ASTRecordReader.h.

References clang::ASTReader::readType().

Referenced by readQualType().

◆ readTypeLoc()

void ASTRecordReader::readTypeLoc ( TypeLoc  TL)

Reads the location information for a type.

Definition at line 6786 of file ASTReader.cpp.

References clang::TypeLoc::getNextTypeLoc(), clang::TypeLoc::isNull(), and clang::TypeLocVisitor< ImplClass, RetTy >::Visit().

Referenced by GetLocalDeclAs().

◆ readTypeSourceInfo()

TypeSourceInfo * ASTRecordReader::readTypeSourceInfo ( )

Reads a declarator info from the given record, advancing Idx.

Definition at line 6792 of file ASTReader.cpp.

References clang::TypeSourceInfo::getTypeLoc(), and clang::QualType::isNull().

Referenced by GetLocalDeclAs(), and clang::ASTDeclReader::VisitOMPCapturedExprDecl().

◆ readUInt32()

uint32_t clang::ASTRecordReader::readUInt32 ( )
inline

Read a 32-bit unsigned value; required to satisfy BasicReader.

Definition at line 295 of file ASTRecordReader.h.

References readInt().

◆ readUInt64()

uint64_t clang::ASTRecordReader::readUInt64 ( )
inline

Read a 64-bit unsigned value; required to satisfy BasicReader.

Definition at line 300 of file ASTRecordReader.h.

References readInt().

◆ readUnresolvedSet()

void ASTRecordReader::readUnresolvedSet ( LazyASTUnresolvedSet Set)

Read a UnresolvedSet structure, advancing Idx.

Read a UnresolvedSet structure.

Definition at line 8790 of file ASTReader.cpp.

References clang::LazyASTUnresolvedSet::addLazyDecl(), and clang::LazyASTUnresolvedSet::reserve().

Referenced by readTemplateArgument().

◆ readVersionTuple()

VersionTuple clang::ASTRecordReader::readVersionTuple ( )
inline

Read a version tuple, advancing Idx.

Definition at line 315 of file ASTRecordReader.h.

References readAttr(), readAttributes(), and clang::ASTReader::ReadVersionTuple().

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

◆ readVisibleDeclContextStorage()

bool clang::ASTRecordReader::readVisibleDeclContextStorage ( uint64_t  Offset,
serialization::DeclID  ID 
)
inline

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

Definition at line 103 of file ASTRecordReader.h.

References clang::serialization::ModuleFile::DeclsCursor.

◆ recordSwitchCaseID()

void clang::ASTRecordReader::recordSwitchCaseID ( SwitchCase SC,
unsigned  ID 
)
inline

Definition at line 330 of file ASTRecordReader.h.

References clang::ASTReader::RecordSwitchCaseID().

◆ size()

size_t clang::ASTRecordReader::size ( ) const
inline

The length of this record.

Definition at line 61 of file ASTRecordReader.h.

◆ skipInts()

void clang::ASTRecordReader::skipInts ( unsigned  N)
inline

Skips the specified number of values.

Definition at line 83 of file ASTRecordReader.h.


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