clang  6.0.0svn
Public Member Functions | List of all members
clang::ASTRecordWriter Class Reference

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

#include "clang/Serialization/ASTWriter.h"

Public Member Functions

 ASTRecordWriter (ASTWriter &Writer, ASTWriter::RecordDataImpl &Record)
 Construct a ASTRecordWriter that uses the default encoding scheme. More...
 
 ASTRecordWriter (ASTRecordWriter &Parent, ASTWriter::RecordDataImpl &Record)
 Construct a ASTRecordWriter that uses the same encoding scheme as another ASTRecordWriter. More...
 
 ASTRecordWriter (const ASTRecordWriter &)=delete
 Copying an ASTRecordWriter is almost certainly a bug. More...
 
ASTRecordWriteroperator= (const ASTRecordWriter &)=delete
 
ASTWriter::RecordDataImplgetRecordData () const
 Extract the underlying record storage. More...
 
uint64_t Emit (unsigned Code, unsigned Abbrev=0)
 Emit the record to the stream, followed by its substatements, and return its offset. More...
 
uint64_t EmitStmt (unsigned Code, unsigned Abbrev=0)
 Emit the record to the stream, preceded by its substatements. More...
 
void AddOffset (uint64_t BitOffset)
 Add a bit offset into the record. More...
 
void AddStmt (Stmt *S)
 Add the given statement or expression to the queue of statements to emit. More...
 
void AddFunctionDefinition (const FunctionDecl *FD)
 Add a definition for the given function to the queue of statements to emit. More...
 
void AddSourceLocation (SourceLocation Loc)
 Emit a source location. More...
 
void AddSourceRange (SourceRange Range)
 Emit a source range. More...
 
void AddAPInt (const llvm::APInt &Value)
 Emit an integral value. More...
 
void AddAPSInt (const llvm::APSInt &Value)
 Emit a signed integral value. More...
 
void AddAPFloat (const llvm::APFloat &Value)
 Emit a floating-point value. More...
 
void AddIdentifierRef (const IdentifierInfo *II)
 Emit a reference to an identifier. More...
 
void AddSelectorRef (Selector S)
 Emit a Selector (which is a smart pointer reference). More...
 
void AddCXXTemporary (const CXXTemporary *Temp)
 Emit a CXXTemporary. More...
 
void AddCXXBaseSpecifier (const CXXBaseSpecifier &Base)
 Emit a C++ base specifier. More...
 
void AddCXXBaseSpecifiers (ArrayRef< CXXBaseSpecifier > Bases)
 Emit a set of C++ base specifiers. More...
 
void AddTypeRef (QualType T)
 Emit a reference to a type. More...
 
void AddTypeSourceInfo (TypeSourceInfo *TInfo)
 Emits a reference to a declarator info. More...
 
void AddTypeLoc (TypeLoc TL)
 Emits a type with source-location information. More...
 
void AddTemplateArgumentLocInfo (TemplateArgument::ArgKind Kind, const TemplateArgumentLocInfo &Arg)
 Emits a template argument location info. More...
 
void AddTemplateArgumentLoc (const TemplateArgumentLoc &Arg)
 Emits a template argument location. More...
 
void AddASTTemplateArgumentListInfo (const ASTTemplateArgumentListInfo *ASTTemplArgList)
 Emits an AST template argument list info. More...
 
void AddDeclRef (const Decl *D)
 Emit a reference to a declaration. More...
 
void AddDeclarationName (DeclarationName Name)
 Emit a declaration name. More...
 
void AddDeclarationNameLoc (const DeclarationNameLoc &DNLoc, DeclarationName Name)
 
void AddDeclarationNameInfo (const DeclarationNameInfo &NameInfo)
 
void AddQualifierInfo (const QualifierInfo &Info)
 
void AddNestedNameSpecifier (NestedNameSpecifier *NNS)
 Emit a nested name specifier. More...
 
void AddNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS)
 Emit a nested name specifier with source-location information. More...
 
void AddTemplateName (TemplateName Name)
 Emit a template name. More...
 
void AddTemplateArgument (const TemplateArgument &Arg)
 Emit a template argument. More...
 
void AddTemplateParameterList (const TemplateParameterList *TemplateParams)
 Emit a template parameter list. More...
 
void AddTemplateArgumentList (const TemplateArgumentList *TemplateArgs)
 Emit a template argument list. More...
 
void AddUnresolvedSet (const ASTUnresolvedSet &Set)
 Emit a UnresolvedSet structure. More...
 
void AddCXXCtorInitializers (ArrayRef< CXXCtorInitializer *> CtorInits)
 Emit a CXXCtorInitializer array. More...
 
void AddCXXDefinitionData (const CXXRecordDecl *D)
 
void AddString (StringRef Str)
 Emit a string. More...
 
void AddPath (StringRef Path)
 Emit a path. More...
 
void AddVersionTuple (const VersionTuple &Version)
 Emit a version tuple. More...
 
void AddAttributes (ArrayRef< const Attr *> Attrs)
 Emit a list of attributes. More...
 
void push_back (uint64_t N)
 Minimal vector-like interface. More...
 
template<typename InputIterator >
void append (InputIterator begin, InputIterator end)
 
bool empty () const
 
size_t size () const
 
uint64_t & operator[] (size_t N)
 

Detailed Description

An object for streaming information to a record.

Definition at line 747 of file ASTWriter.h.

Constructor & Destructor Documentation

◆ ASTRecordWriter() [1/3]

clang::ASTRecordWriter::ASTRecordWriter ( ASTWriter Writer,
ASTWriter::RecordDataImpl Record 
)
inline

Construct a ASTRecordWriter that uses the default encoding scheme.

Definition at line 778 of file ASTWriter.h.

◆ ASTRecordWriter() [2/3]

clang::ASTRecordWriter::ASTRecordWriter ( ASTRecordWriter Parent,
ASTWriter::RecordDataImpl Record 
)
inline

Construct a ASTRecordWriter that uses the same encoding scheme as another ASTRecordWriter.

Definition at line 783 of file ASTWriter.h.

◆ ASTRecordWriter() [3/3]

clang::ASTRecordWriter::ASTRecordWriter ( const ASTRecordWriter )
delete

Copying an ASTRecordWriter is almost certainly a bug.

Member Function Documentation

◆ AddAPFloat()

void ASTRecordWriter::AddAPFloat ( const llvm::APFloat &  Value)

Emit a floating-point value.

Definition at line 5289 of file ASTWriter.cpp.

◆ AddAPInt()

void ASTRecordWriter::AddAPInt ( const llvm::APInt &  Value)

Emit an integral value.

Definition at line 5278 of file ASTWriter.cpp.

◆ AddAPSInt()

void ASTRecordWriter::AddAPSInt ( const llvm::APSInt &  Value)

Emit a signed integral value.

Definition at line 5284 of file ASTWriter.cpp.

◆ AddASTTemplateArgumentListInfo()

void ASTRecordWriter::AddASTTemplateArgumentListInfo ( const ASTTemplateArgumentListInfo ASTTemplArgList)

◆ AddAttributes()

void ASTRecordWriter::AddAttributes ( ArrayRef< const Attr *>  Attrs)

Emit a list of attributes.

Emit the list of attributes to the specified record.

Definition at line 4431 of file ASTWriter.cpp.

◆ AddCXXBaseSpecifier()

void ASTRecordWriter::AddCXXBaseSpecifier ( const CXXBaseSpecifier Base)

◆ AddCXXBaseSpecifiers()

void ASTRecordWriter::AddCXXBaseSpecifiers ( ArrayRef< CXXBaseSpecifier Bases)

Emit a set of C++ base specifiers.

Definition at line 5912 of file ASTWriter.cpp.

References EmitCXXBaseSpecifiers().

◆ AddCXXCtorInitializers()

void ASTRecordWriter::AddCXXCtorInitializers ( ArrayRef< CXXCtorInitializer *>  CtorInits)

Emit a CXXCtorInitializer array.

Definition at line 5952 of file ASTWriter.cpp.

References EmitCXXCtorInitializers().

◆ AddCXXDefinitionData()

void ASTRecordWriter::AddCXXDefinitionData ( const CXXRecordDecl D)

◆ AddCXXTemporary()

void ASTRecordWriter::AddCXXTemporary ( const CXXTemporary Temp)

◆ AddDeclarationName()

void ASTRecordWriter::AddDeclarationName ( DeclarationName  Name)

Emit a declaration name.

Definition at line 5550 of file ASTWriter.cpp.

◆ AddDeclarationNameInfo()

void ASTRecordWriter::AddDeclarationNameInfo ( const DeclarationNameInfo NameInfo)

◆ AddDeclarationNameLoc()

void ASTRecordWriter::AddDeclarationNameLoc ( const DeclarationNameLoc DNLoc,
DeclarationName  Name 
)

Definition at line 5609 of file ASTWriter.cpp.

◆ AddDeclRef()

void clang::ASTRecordWriter::AddDeclRef ( const Decl D)
inline

◆ AddFunctionDefinition()

void ASTRecordWriter::AddFunctionDefinition ( const FunctionDecl FD)

◆ AddIdentifierRef()

void clang::ASTRecordWriter::AddIdentifierRef ( const IdentifierInfo II)
inline

Emit a reference to an identifier.

Definition at line 866 of file ASTWriter.h.

References clang::ASTWriter::AddIdentifierRef().

◆ AddNestedNameSpecifier()

void ASTRecordWriter::AddNestedNameSpecifier ( NestedNameSpecifier NNS)

◆ AddNestedNameSpecifierLoc()

void ASTRecordWriter::AddNestedNameSpecifierLoc ( NestedNameSpecifierLoc  NNS)

◆ AddOffset()

void clang::ASTRecordWriter::AddOffset ( uint64_t  BitOffset)
inline

Add a bit offset into the record.

This will be converted into an offset relative to the current record when emitted.

Definition at line 826 of file ASTWriter.h.

◆ AddPath()

void clang::ASTRecordWriter::AddPath ( StringRef  Path)
inline

Emit a path.

Definition at line 950 of file ASTWriter.h.

References clang::ASTWriter::AddPath().

◆ AddQualifierInfo()

void ASTRecordWriter::AddQualifierInfo ( const QualifierInfo Info)

◆ AddSelectorRef()

void ASTRecordWriter::AddSelectorRef ( Selector  S)

Emit a Selector (which is a smart pointer reference).

Definition at line 5335 of file ASTWriter.cpp.

◆ AddSourceLocation()

void clang::ASTRecordWriter::AddSourceLocation ( SourceLocation  Loc)
inline

◆ AddSourceRange()

void clang::ASTRecordWriter::AddSourceRange ( SourceRange  Range)
inline

Emit a source range.

Definition at line 852 of file ASTWriter.h.

References clang::ASTWriter::AddSourceRange().

◆ AddStmt()

void clang::ASTRecordWriter::AddStmt ( Stmt S)
inline

Add the given statement or expression to the queue of statements to emit.

This routine should be used when emitting types and declarations that have expressions as part of their formulation. Once the type or declaration has been written, Emit() will write the corresponding statements just after the record.

Definition at line 838 of file ASTWriter.h.

Referenced by EmitCXXCtorInitializers().

◆ AddString()

void clang::ASTRecordWriter::AddString ( StringRef  Str)
inline

Emit a string.

Definition at line 945 of file ASTWriter.h.

References clang::ASTWriter::AddString().

◆ AddTemplateArgument()

void ASTRecordWriter::AddTemplateArgument ( const TemplateArgument Arg)

◆ AddTemplateArgumentList()

void ASTRecordWriter::AddTemplateArgumentList ( const TemplateArgumentList TemplateArgs)

Emit a template argument list.

Definition at line 5859 of file ASTWriter.cpp.

References clang::TemplateArgumentList::get(), and clang::TemplateArgumentList::size().

◆ AddTemplateArgumentLoc()

void ASTRecordWriter::AddTemplateArgumentLoc ( const TemplateArgumentLoc Arg)

◆ AddTemplateArgumentLocInfo()

void ASTRecordWriter::AddTemplateArgumentLocInfo ( TemplateArgument::ArgKind  Kind,
const TemplateArgumentLocInfo Arg 
)

◆ AddTemplateName()

void ASTRecordWriter::AddTemplateName ( TemplateName  Name)

Emit a template name.

Definition at line 5753 of file ASTWriter.cpp.

◆ AddTemplateParameterList()

void ASTRecordWriter::AddTemplateParameterList ( const TemplateParameterList TemplateParams)

◆ AddTypeLoc()

void ASTRecordWriter::AddTypeLoc ( TypeLoc  TL)

Emits a type with source-location information.

Definition at line 5412 of file ASTWriter.cpp.

References clang::ASTWriter::AddTypeRef(), clang::TypeLoc::getNextTypeLoc(), clang::TypeLoc::getType(), and clang::TypeLoc::isNull().

◆ AddTypeRef()

void clang::ASTRecordWriter::AddTypeRef ( QualType  T)
inline

Emit a reference to a type.

Definition at line 883 of file ASTWriter.h.

References clang::ASTWriter::AddTypeRef().

Referenced by clang::ASTTypeWriter::Visit().

◆ AddTypeSourceInfo()

void ASTRecordWriter::AddTypeSourceInfo ( TypeSourceInfo TInfo)

Emits a reference to a declarator info.

Definition at line 5403 of file ASTWriter.cpp.

References clang::ASTWriter::AddTypeRef(), and clang::TypeSourceInfo::getTypeLoc().

Referenced by EmitCXXCtorInitializers().

◆ AddUnresolvedSet()

void ASTRecordWriter::AddUnresolvedSet ( const ASTUnresolvedSet Set)

Emit a UnresolvedSet structure.

Definition at line 5878 of file ASTWriter.cpp.

References clang::ASTUnresolvedSet::size().

◆ AddVersionTuple()

void clang::ASTRecordWriter::AddVersionTuple ( const VersionTuple Version)
inline

Emit a version tuple.

Definition at line 955 of file ASTWriter.h.

References clang::ASTWriter::AddVersionTuple().

◆ append()

template<typename InputIterator >
void clang::ASTRecordWriter::append ( InputIterator  begin,
InputIterator  end 
)
inline

Definition at line 797 of file ASTWriter.h.

◆ Emit()

uint64_t clang::ASTRecordWriter::Emit ( unsigned  Code,
unsigned  Abbrev = 0 
)
inline

Emit the record to the stream, followed by its substatements, and return its offset.

Definition at line 808 of file ASTWriter.h.

Referenced by clang::ASTDeclWriter::Emit(), clang::ASTTypeWriter::Emit(), EmitCXXBaseSpecifiers(), and EmitCXXCtorInitializers().

◆ EmitStmt()

uint64_t clang::ASTRecordWriter::EmitStmt ( unsigned  Code,
unsigned  Abbrev = 0 
)
inline

Emit the record to the stream, preceded by its substatements.

Definition at line 817 of file ASTWriter.h.

Referenced by clang::ASTStmtWriter::Emit().

◆ empty()

bool clang::ASTRecordWriter::empty ( ) const
inline

Definition at line 800 of file ASTWriter.h.

◆ getRecordData()

ASTWriter::RecordDataImpl& clang::ASTRecordWriter::getRecordData ( ) const
inline

Extract the underlying record storage.

Definition at line 791 of file ASTWriter.h.

◆ operator=()

ASTRecordWriter& clang::ASTRecordWriter::operator= ( const ASTRecordWriter )
delete

◆ operator[]()

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

Definition at line 802 of file ASTWriter.h.

◆ push_back()

void clang::ASTRecordWriter::push_back ( uint64_t  N)
inline

◆ size()

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

Definition at line 801 of file ASTWriter.h.


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