clang  6.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...
 
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...
 
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 >
TGetLocalDeclAs (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...
 
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 >
TreadDeclAs ()
 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...
 
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...
 
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 2323 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 2336 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 2358 of file ASTReader.h.

◆ getContext()

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

Retrieve the AST context that this AST reader supplements.

Definition at line 2346 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 2400 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 2372 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 2448 of file ASTReader.h.

References clang::ASTReader::getGlobalTypeID().

◆ getIdentifierInfo()

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

Definition at line 2480 of file ASTReader.h.

References clang::ASTReader::GetIdentifierInfo().

◆ getIdx()

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

The current position in this record.

Definition at line 2349 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 2420 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 2377 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 2608 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 2427 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 2443 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 2343 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 2355 of file ASTReader.h.

◆ peekInt()

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

Returns the current value in this record, without advancing.

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

References clang::ASTReader::ReadAPFloat().

◆ readAPInt()

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

Read an integral value, advancing Idx.

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

References clang::ASTReader::ReadAPSInt().

◆ readASTTemplateArgumentListInfo()

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

Definition at line 2438 of file ASTReader.h.

References clang::ASTReader::ReadASTTemplateArgumentListInfo().

◆ readAttributes()

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

Reads attributes from the current stream position, advancing Idx.

Definition at line 2594 of file ASTReader.h.

References clang::ASTReader::ReadAttributes().

◆ readCXXBaseSpecifier()

CXXBaseSpecifier clang::ASTRecordReader::readCXXBaseSpecifier ( )
inline

Read a C++ base specifier, advancing Idx.

Definition at line 2540 of file ASTReader.h.

References clang::ASTReader::ReadCXXBaseSpecifier().

◆ readCXXCtorInitializers()

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

Read a CXXCtorInitializer array, advancing Idx.

Definition at line 2545 of file ASTReader.h.

References clang::ASTReader::ReadCXXCtorInitializers().

◆ readCXXTemporary()

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

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

References clang::ASTReader::ReadDecl().

◆ readDeclarationName()

DeclarationName clang::ASTRecordReader::readDeclarationName ( )
inline

Read a declaration name, advancing Idx.

Definition at line 2490 of file ASTReader.h.

References clang::ASTReader::ReadDeclarationName().

◆ readDeclarationNameInfo()

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

Definition at line 2496 of file ASTReader.h.

References clang::ASTReader::ReadDeclarationNameInfo().

◆ readDeclarationNameLoc()

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

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

References clang::ASTReader::ReadDeclAs(), and clang::T.

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

References clang::ASTReader::ReadDeclID().

◆ readExceptionSpec()

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

Definition at line 2394 of file ASTReader.h.

◆ readExpr()

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

Reads an expression.

Definition at line 2408 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 2362 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 2382 of file ASTReader.h.

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

◆ readNestedNameSpecifier()

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

Definition at line 2504 of file ASTReader.h.

References clang::ASTReader::ReadNestedNameSpecifier().

◆ readNestedNameSpecifierLoc()

NestedNameSpecifierLoc clang::ASTRecordReader::readNestedNameSpecifierLoc ( )
inline

Definition at line 2508 of file ASTReader.h.

References clang::ASTReader::ReadNestedNameSpecifierLoc().

◆ readPath()

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

Read a path, advancing Idx.

Definition at line 2584 of file ASTReader.h.

References clang::ASTReader::ReadPath().

◆ readQualifierInfo()

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

Definition at line 2500 of file ASTReader.h.

References clang::ASTReader::ReadQualifierInfo().

◆ readRecord()

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

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

Definition at line 10609 of file ASTReader.cpp.

◆ readSelector()

Selector clang::ASTRecordReader::readSelector ( )
inline

Read a selector from the Record, advancing Idx.

Definition at line 2485 of file ASTReader.h.

References clang::ASTReader::ReadSelector().

◆ readSourceLocation()

SourceLocation clang::ASTRecordReader::readSourceLocation ( )
inline

Read a source location, advancing Idx.

Definition at line 2554 of file ASTReader.h.

References clang::ASTReader::ReadSourceLocation().

◆ readSourceRange()

SourceRange clang::ASTRecordReader::readSourceRange ( )
inline

Read a source range, advancing Idx.

Definition at line 2559 of file ASTReader.h.

References clang::ASTReader::ReadSourceRange().

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

◆ readStmt()

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

Reads a statement.

Definition at line 2405 of file ASTReader.h.

References clang::ASTReader::ReadStmt().

◆ readString()

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

Read a string, advancing Idx.

Definition at line 2579 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 2414 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 2411 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 2518 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 2528 of file ASTReader.h.

References clang::ASTReader::ReadTemplateArgumentList().

◆ readTemplateArgumentLoc()

TemplateArgumentLoc clang::ASTRecordReader::readTemplateArgumentLoc ( )
inline

Reads a TemplateArgumentLoc, advancing Idx.

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

References clang::ASTReader::ReadTemplateName().

◆ readTemplateParameterList()

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

Read a template parameter list, advancing Idx.

Definition at line 2523 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 2599 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 2453 of file ASTReader.h.

References clang::ASTReader::readType().

◆ readUnresolvedSet()

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

Read a UnresolvedSet structure, advancing Idx.

Definition at line 2535 of file ASTReader.h.

References clang::ASTReader::ReadUnresolvedSet().

◆ readVersionTuple()

VersionTuple clang::ASTRecordReader::readVersionTuple ( )
inline

Read a version tuple, advancing Idx.

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

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

◆ recordSwitchCaseID()

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

Definition at line 2603 of file ASTReader.h.

References clang::ASTReader::RecordSwitchCaseID().

◆ size()

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

The length of this record.

Definition at line 2352 of file ASTReader.h.

◆ skipInts()

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

Skips the specified number of values.

Definition at line 2368 of file ASTReader.h.


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