clang  10.0.0svn
Public Member Functions | List of all members
clang::ASTRecordReader Class Reference

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

#include "clang/Serialization/ASTReader.h"

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...
 
const uint64_t & back () const
 The last element in this record. More...
 
const uint64_t & readInt ()
 Returns the current value in this record, and advances to the next value. More...
 
const 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 ()
 
void readExceptionSpec (SmallVectorImpl< QualType > &ExceptionStorage, FunctionProtoType::ExceptionSpecInfo &ESI)
 
uint64_t getGlobalBitOffset (uint32_t LocalOffset)
 Get the global offset corresponding to a local offset. More...
 
StmtreadStmt ()
 Reads a statement. More...
 
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 getTemplateArgumentLocInfo (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 ()
 
TypeSourceInfogetTypeSourceInfo ()
 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...
 
QualType readType ()
 Read a type from the current position in the record. More...
 
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...
 
template<typename T >
T * readDeclAs ()
 Reads a declaration from the given position in the record, advancing Idx. More...
 
IdentifierInfogetIdentifierInfo ()
 
Selector readSelector ()
 Read a selector from the Record, advancing Idx. More...
 
DeclarationName readDeclarationName ()
 Read a declaration name, advancing Idx. More...
 
void readDeclarationNameLoc (DeclarationNameLoc &DNLoc, DeclarationName Name)
 
void readDeclarationNameInfo (DeclarationNameInfo &NameInfo)
 
void readQualifierInfo (QualifierInfo &Info)
 
NestedNameSpecifierreadNestedNameSpecifier ()
 
NestedNameSpecifierLoc readNestedNameSpecifierLoc ()
 
TemplateName readTemplateName ()
 Read a template name, advancing Idx. More...
 
TemplateArgument readTemplateArgument (bool Canonicalize=false)
 Read a template argument, advancing Idx. More...
 
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 ()
 
SourceLocation readSourceLocation ()
 Read a source location, advancing Idx. More...
 
SourceRange readSourceRange ()
 Read a source range, advancing Idx. More...
 
APValue readAPValue ()
 
llvm::APInt readAPInt ()
 Read an integral value, advancing Idx. More...
 
llvm::APSInt readAPSInt ()
 Read a signed integral value, advancing Idx. More...
 
llvm::APFloat readAPFloat (const llvm::fltSemantics &Sem)
 Read a floating-point value, advancing Idx. 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...
 

Detailed Description

An object for streaming information from a record.

Definition at line 2366 of file ASTReader.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 2379 of file ASTReader.h.

Member Function Documentation

◆ back()

const uint64_t& clang::ASTRecordReader::back ( ) const
inline

The last element in this record.

Definition at line 2402 of file ASTReader.h.

◆ getContext()

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

Retrieve the AST context that this AST reader supplements.

Definition at line 2390 of file ASTReader.h.

References clang::ASTReader::getContext().

◆ getGlobalBitOffset()

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

Get the global offset corresponding to a local offset.

Definition at line 2452 of file ASTReader.h.

◆ getGlobalSubmoduleID()

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

Retrieve the global submodule ID its local ID number.

Definition at line 2416 of file ASTReader.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 2505 of file ASTReader.h.

References clang::ASTReader::getGlobalTypeID().

◆ getIdentifierInfo()

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

Definition at line 2537 of file ASTReader.h.

References clang::ASTReader::GetIdentifierInfo().

◆ getIdx()

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

The current position in this record.

Definition at line 2393 of file ASTReader.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 2472 of file ASTReader.h.

References clang::ASTReader::GetLocalDecl().

◆ getSubmodule()

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

Retrieve the submodule that corresponds to a global submodule ID.

Definition at line 2421 of file ASTReader.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 2672 of file ASTReader.h.

References clang::ASTReader::getSwitchCaseWithID().

◆ getTemplateArgumentLocInfo()

TemplateArgumentLocInfo clang::ASTRecordReader::getTemplateArgumentLocInfo ( TemplateArgument::ArgKind  Kind)
inline

Reads a TemplateArgumentLocInfo appropriate for the given TemplateArgument kind, advancing Idx.

Definition at line 2479 of file ASTReader.h.

References clang::ASTReader::GetTemplateArgumentLocInfo().

◆ getTypeSourceInfo()

TypeSourceInfo* clang::ASTRecordReader::getTypeSourceInfo ( )
inline

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

Definition at line 2495 of file ASTReader.h.

References clang::ASTReader::GetTypeSourceInfo().

◆ isModule()

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

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

Definition at line 2387 of file ASTReader.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 2399 of file ASTReader.h.

◆ peekInt()

const uint64_t& clang::ASTRecordReader::peekInt ( )
inline

Returns the current value in this record, without advancing.

Definition at line 2409 of file ASTReader.h.

◆ readAPFloat()

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

Read a floating-point value, advancing Idx.

Definition at line 2633 of file ASTReader.h.

References clang::ASTReader::ReadAPFloat().

◆ readAPInt()

llvm::APInt clang::ASTRecordReader::readAPInt ( )
inline

Read an integral value, advancing Idx.

Definition at line 2623 of file ASTReader.h.

References clang::ASTReader::ReadAPInt().

◆ readAPSInt()

llvm::APSInt clang::ASTRecordReader::readAPSInt ( )
inline

Read a signed integral value, advancing Idx.

Definition at line 2628 of file ASTReader.h.

References clang::ASTReader::ReadAPSInt().

◆ readAPValue()

APValue clang::ASTRecordReader::readAPValue ( )
inline

Definition at line 2620 of file ASTReader.h.

References clang::ASTReader::ReadAPValue().

◆ readASTTemplateArgumentListInfo()

const ASTTemplateArgumentListInfo* clang::ASTRecordReader::readASTTemplateArgumentListInfo ( )
inline

Definition at line 2490 of file ASTReader.h.

References clang::ASTReader::ReadASTTemplateArgumentListInfo().

◆ readAttr()

Attr* clang::ASTRecordReader::readAttr ( )
inline

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

Definition at line 2653 of file ASTReader.h.

References clang::ASTReader::ReadAttr().

Referenced by clang::ASTReader::ReadAttributes().

◆ readAttributes()

void clang::ASTRecordReader::readAttributes ( AttrVec Attrs)
inline

Reads attributes from the current stream position, advancing Idx.

Definition at line 2658 of file ASTReader.h.

References clang::ASTReader::ReadAttributes().

◆ readCXXBaseSpecifier()

CXXBaseSpecifier clang::ASTRecordReader::readCXXBaseSpecifier ( )
inline

Read a C++ base specifier, advancing Idx.

Definition at line 2597 of file ASTReader.h.

References clang::ASTReader::ReadCXXBaseSpecifier().

◆ readCXXCtorInitializers()

CXXCtorInitializer** clang::ASTRecordReader::readCXXCtorInitializers ( )
inline

Read a CXXCtorInitializer array, advancing Idx.

Definition at line 2602 of file ASTReader.h.

References clang::ASTReader::ReadCXXCtorInitializers().

◆ readCXXTemporary()

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

Definition at line 2606 of file ASTReader.h.

References clang::ASTReader::ReadCXXTemporary().

◆ 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 2523 of file ASTReader.h.

References clang::ASTReader::ReadDecl().

◆ readDeclarationName()

DeclarationName clang::ASTRecordReader::readDeclarationName ( )
inline

Read a declaration name, advancing Idx.

Definition at line 2547 of file ASTReader.h.

References clang::ASTReader::ReadDeclarationName().

◆ readDeclarationNameInfo()

void clang::ASTRecordReader::readDeclarationNameInfo ( DeclarationNameInfo NameInfo)
inline

Definition at line 2553 of file ASTReader.h.

References clang::ASTReader::ReadDeclarationNameInfo().

◆ readDeclarationNameLoc()

void clang::ASTRecordReader::readDeclarationNameLoc ( DeclarationNameLoc DNLoc,
DeclarationName  Name 
)
inline

Definition at line 2550 of file ASTReader.h.

References clang::ASTReader::ReadDeclarationNameLoc().

◆ 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 2533 of file ASTReader.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 2517 of file ASTReader.h.

References clang::ASTReader::ReadDeclID().

◆ readExceptionSpec()

void clang::ASTRecordReader::readExceptionSpec ( SmallVectorImpl< QualType > &  ExceptionStorage,
FunctionProtoType::ExceptionSpecInfo ESI 
)
inline

Definition at line 2446 of file ASTReader.h.

◆ readExplicitSpec()

ExplicitSpecifier clang::ASTRecordReader::readExplicitSpec ( )
inline

Definition at line 2438 of file ASTReader.h.

◆ readExpr()

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

Reads an expression.

Definition at line 2460 of file ASTReader.h.

References clang::ASTReader::ReadExpr().

◆ readInt()

const uint64_t& clang::ASTRecordReader::readInt ( )
inline

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

Definition at line 2406 of file ASTReader.h.

Referenced by clang::ASTReader::ReadAttributes().

◆ 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 2426 of file ASTReader.h.

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

◆ readNestedNameSpecifier()

NestedNameSpecifier* clang::ASTRecordReader::readNestedNameSpecifier ( )
inline

Definition at line 2561 of file ASTReader.h.

References clang::ASTReader::ReadNestedNameSpecifier().

◆ readNestedNameSpecifierLoc()

NestedNameSpecifierLoc clang::ASTRecordReader::readNestedNameSpecifierLoc ( )
inline

Definition at line 2565 of file ASTReader.h.

References clang::ASTReader::ReadNestedNameSpecifierLoc().

◆ readPath()

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

Read a path, advancing Idx.

Definition at line 2643 of file ASTReader.h.

References clang::ASTReader::ReadPath().

◆ readQualifierInfo()

void clang::ASTRecordReader::readQualifierInfo ( QualifierInfo Info)
inline

Definition at line 2557 of file ASTReader.h.

References clang::ASTReader::ReadQualifierInfo().

◆ 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 12194 of file ASTReader.cpp.

◆ readSelector()

Selector clang::ASTRecordReader::readSelector ( )
inline

Read a selector from the Record, advancing Idx.

Definition at line 2542 of file ASTReader.h.

References clang::ASTReader::ReadSelector().

◆ readSourceLocation()

SourceLocation clang::ASTRecordReader::readSourceLocation ( )
inline

Read a source location, advancing Idx.

Definition at line 2611 of file ASTReader.h.

References clang::ASTReader::ReadSourceLocation().

◆ readSourceRange()

SourceRange clang::ASTRecordReader::readSourceRange ( )
inline

Read a source range, advancing Idx.

Definition at line 2616 of file ASTReader.h.

References clang::ASTReader::ReadSourceRange().

◆ readStmt()

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

Reads a statement.

Definition at line 2457 of file ASTReader.h.

References clang::ASTReader::ReadStmt().

◆ readString()

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

Read a string, advancing Idx.

Definition at line 2638 of file ASTReader.h.

References clang::ASTReader::ReadString().

◆ readSubExpr()

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

Reads a sub-expression operand during statement reading.

Definition at line 2466 of file ASTReader.h.

References clang::ASTReader::ReadSubExpr().

◆ readSubStmt()

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

Reads a sub-statement operand during statement reading.

Definition at line 2463 of file ASTReader.h.

References clang::ASTReader::ReadSubStmt().

◆ readTemplateArgument()

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

Read a template argument, advancing Idx.

Definition at line 2575 of file ASTReader.h.

References clang::ASTReader::ReadTemplateArgument().

◆ readTemplateArgumentList()

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

Read a template argument array, advancing Idx.

Definition at line 2585 of file ASTReader.h.

References clang::ASTReader::ReadTemplateArgumentList().

◆ readTemplateArgumentLoc()

TemplateArgumentLoc clang::ASTRecordReader::readTemplateArgumentLoc ( )
inline

Reads a TemplateArgumentLoc, advancing Idx.

Definition at line 2485 of file ASTReader.h.

References clang::ASTReader::ReadTemplateArgumentLoc().

Referenced by clang::ASTStmtReader::ReadTemplateKWAndArgsInfo().

◆ readTemplateName()

TemplateName clang::ASTRecordReader::readTemplateName ( )
inline

Read a template name, advancing Idx.

Definition at line 2570 of file ASTReader.h.

References clang::ASTReader::ReadTemplateName().

◆ readTemplateParameterList()

TemplateParameterList* clang::ASTRecordReader::readTemplateParameterList ( )
inline

Read a template parameter list, advancing Idx.

Definition at line 2580 of file ASTReader.h.

References clang::ASTReader::ReadTemplateParameterList().

◆ readToken()

Token clang::ASTRecordReader::readToken ( )
inline

Reads a token out of a record, advancing Idx.

Definition at line 2663 of file ASTReader.h.

References clang::ASTReader::ReadToken().

◆ readType()

QualType clang::ASTRecordReader::readType ( )
inline

Read a type from the current position in the record.

Definition at line 2510 of file ASTReader.h.

References clang::ASTReader::readType().

◆ readTypeLoc()

void clang::ASTRecordReader::readTypeLoc ( TypeLoc  TL)
inline

Reads the location information for a type.

Definition at line 2500 of file ASTReader.h.

References clang::ASTReader::ReadTypeLoc().

◆ readUnresolvedSet()

void clang::ASTRecordReader::readUnresolvedSet ( LazyASTUnresolvedSet Set)
inline

Read a UnresolvedSet structure, advancing Idx.

Definition at line 2592 of file ASTReader.h.

References clang::ASTReader::ReadUnresolvedSet().

◆ readVersionTuple()

VersionTuple clang::ASTRecordReader::readVersionTuple ( )
inline

Read a version tuple, advancing Idx.

Definition at line 2648 of file ASTReader.h.

References clang::ASTReader::ReadVersionTuple().

◆ 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 2432 of file ASTReader.h.

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

◆ recordSwitchCaseID()

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

Definition at line 2667 of file ASTReader.h.

References clang::ASTReader::RecordSwitchCaseID().

◆ size()

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

The length of this record.

Definition at line 2396 of file ASTReader.h.

◆ skipInts()

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

Skips the specified number of values.

Definition at line 2412 of file ASTReader.h.


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