clang 19.0.0git
Public Member Functions | List of all members
clang::ASTRecordWriter Class Reference

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

#include "clang/Serialization/ASTRecordWriter.h"

Inheritance diagram for clang::ASTRecordWriter:
Inheritance graph
[legend]

Public Member Functions

 ASTRecordWriter (ASTWriter &W, ASTWriter::RecordDataImpl &Record)
 Construct a ASTRecordWriter that uses the default encoding scheme.
 
 ASTRecordWriter (ASTRecordWriter &Parent, ASTWriter::RecordDataImpl &Record)
 Construct a ASTRecordWriter that uses the same encoding scheme as another ASTRecordWriter.
 
 ASTRecordWriter (const ASTRecordWriter &)=delete
 Copying an ASTRecordWriter is almost certainly a bug.
 
ASTRecordWriteroperator= (const ASTRecordWriter &)=delete
 
ASTWriter::RecordDataImplgetRecordData () const
 Extract the underlying record storage.
 
uint64_t Emit (unsigned Code, unsigned Abbrev=0)
 Emit the record to the stream, followed by its substatements, and return its offset.
 
uint64_t EmitStmt (unsigned Code, unsigned Abbrev=0)
 Emit the record to the stream, preceded by its substatements.
 
void AddOffset (uint64_t BitOffset)
 Add a bit offset into the record.
 
void AddStmt (Stmt *S)
 Add the given statement or expression to the queue of statements to emit.
 
void writeStmtRef (const Stmt *S)
 
void writeBTFTypeTagAttr (const BTFTypeTagAttr *A)
 Write an BTFTypeTagAttr object.
 
void AddFunctionDefinition (const FunctionDecl *FD)
 Add a definition for the given function to the queue of statements to emit.
 
void AddSourceLocation (SourceLocation Loc, LocSeq *Seq=nullptr)
 Emit a source location.
 
void writeSourceLocation (SourceLocation Loc)
 
void writeTypeCoupledDeclRefInfo (TypeCoupledDeclRefInfo Info)
 
void AddSourceRange (SourceRange Range, LocSeq *Seq=nullptr)
 Emit a source range.
 
void writeBool (bool Value)
 
void writeUInt32 (uint32_t Value)
 
void writeUInt64 (uint64_t Value)
 
void AddAPInt (const llvm::APInt &Value)
 Emit an integral value.
 
void AddAPSInt (const llvm::APSInt &Value)
 Emit a signed integral value.
 
void AddAPFloat (const llvm::APFloat &Value)
 Emit a floating-point value.
 
void AddAPValue (const APValue &Value)
 Emit an APvalue.
 
void AddIdentifierRef (const IdentifierInfo *II)
 Emit a reference to an identifier.
 
void writeIdentifier (const IdentifierInfo *II)
 
void AddSelectorRef (Selector S)
 Emit a Selector (which is a smart pointer reference).
 
void writeSelector (Selector sel)
 
void AddCXXTemporary (const CXXTemporary *Temp)
 Emit a CXXTemporary.
 
void AddCXXBaseSpecifier (const CXXBaseSpecifier &Base)
 Emit a C++ base specifier.
 
void AddCXXBaseSpecifiers (ArrayRef< CXXBaseSpecifier > Bases)
 Emit a set of C++ base specifiers.
 
void AddTypeRef (QualType T)
 Emit a reference to a type.
 
void writeQualType (QualType T)
 
void AddTypeSourceInfo (TypeSourceInfo *TInfo)
 Emits a reference to a declarator info.
 
void AddTypeLoc (TypeLoc TL, LocSeq *Seq=nullptr)
 Emits source location information for a type. Does not emit the type.
 
void AddTemplateArgumentLocInfo (TemplateArgument::ArgKind Kind, const TemplateArgumentLocInfo &Arg)
 Emits a template argument location info.
 
void AddTemplateArgumentLoc (const TemplateArgumentLoc &Arg)
 Emits a template argument location.
 
void AddASTTemplateArgumentListInfo (const ASTTemplateArgumentListInfo *ASTTemplArgList)
 Emits an AST template argument list info.
 
void AddConceptReference (const ConceptReference *CR)
 
void AddDeclRef (const Decl *D)
 Emit a reference to a declaration.
 
void writeDeclRef (const Decl *D)
 
void AddDeclarationName (DeclarationName Name)
 Emit a declaration name.
 
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.
 
void AddNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS)
 Emit a nested name specifier with source-location information.
 
void AddTemplateName (TemplateName Name)
 Emit a template name.
 
void AddTemplateArgument (const TemplateArgument &Arg)
 Emit a template argument.
 
void AddTemplateParameterList (const TemplateParameterList *TemplateParams)
 Emit a template parameter list.
 
void AddTemplateArgumentList (const TemplateArgumentList *TemplateArgs)
 Emit a template argument list.
 
void AddUnresolvedSet (const ASTUnresolvedSet &Set)
 Emit a UnresolvedSet structure.
 
void AddCXXCtorInitializers (ArrayRef< CXXCtorInitializer * > CtorInits)
 Emit a CXXCtorInitializer array.
 
void AddCXXDefinitionData (const CXXRecordDecl *D)
 
void AddVarDeclInit (const VarDecl *VD)
 Emit information about the initializer of a VarDecl.
 
void writeOMPTraitInfo (const OMPTraitInfo *TI)
 Write an OMPTraitInfo object.
 
void writeOMPClause (OMPClause *C)
 
void writeOMPChildren (OMPChildren *Data)
 Writes data related to the OpenMP directives.
 
void writeOpenACCClause (const OpenACCClause *C)
 Writes out a single OpenACC Clause.
 
void writeOpenACCClauseList (ArrayRef< const OpenACCClause * > Clauses)
 Writes out a list of OpenACC clauses.
 
void AddString (StringRef Str)
 Emit a string.
 
void AddPath (StringRef Path)
 Emit a path.
 
void AddVersionTuple (const VersionTuple &Version)
 Emit a version tuple.
 
void AddAttr (const Attr *A)
 
void AddAttributes (ArrayRef< const Attr * > Attrs)
 Emit a list of attributes.
 
void push_back (uint64_t N)
 Minimal vector-like interface.
 
template<typename InputIterator >
void append (InputIterator begin, InputIterator end)
 
bool empty () const
 
size_t size () const
 
uint64_t & operator[] (size_t N)
 
- Public Member Functions inherited from clang::serialization::DataStreamBasicWriter< ASTRecordWriter >
ASTRecordWriterfind (const char *propertyName)
 Implement property-find by ignoring it.
 
ASTRecordWriterwriteObject ()
 
void writeEnum (T value)
 
void writeArray (llvm::ArrayRef< T > array)
 
void writeOptional (std::optional< T > value)
 
void writeAPSInt (const llvm::APSInt &value)
 
void writeAPInt (const llvm::APInt &value)
 
void writeFixedPointSemantics (const llvm::FixedPointSemantics &sema)
 
void writeLValuePathSerializationHelper (APValue::LValuePathSerializationHelper lvaluePath)
 
void writeQualifiers (Qualifiers value)
 
void writeExceptionSpecInfo (const FunctionProtoType::ExceptionSpecInfo &esi)
 
void writeExtParameterInfo (FunctionProtoType::ExtParameterInfo epi)
 
void writeNestedNameSpecifier (NestedNameSpecifier *NNS)
 

Additional Inherited Members

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

Detailed Description

An object for streaming information to a record.

Definition at line 28 of file ASTRecordWriter.h.

Constructor & Destructor Documentation

◆ ASTRecordWriter() [1/3]

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

Construct a ASTRecordWriter that uses the default encoding scheme.

Definition at line 62 of file ASTRecordWriter.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 67 of file ASTRecordWriter.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 5790 of file ASTWriter.cpp.

References AddAPInt().

◆ AddAPInt()

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

Emit an integral value.

Definition at line 168 of file ASTRecordWriter.h.

References clang::serialization::DataStreamBasicWriter< ASTRecordWriter >::writeAPInt().

Referenced by AddAPFloat().

◆ AddAPSInt()

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

Emit a signed integral value.

Definition at line 173 of file ASTRecordWriter.h.

References clang::serialization::DataStreamBasicWriter< ASTRecordWriter >::writeAPSInt().

◆ AddAPValue()

void clang::ASTRecordWriter::AddAPValue ( const APValue Value)
inline

Emit an APvalue.

Definition at line 181 of file ASTRecordWriter.h.

Referenced by AddVarDeclInit().

◆ AddASTTemplateArgumentListInfo()

void ASTRecordWriter::AddASTTemplateArgumentListInfo ( const ASTTemplateArgumentListInfo ASTTemplArgList)

◆ AddAttr()

void ASTRecordWriter::AddAttr ( const Attr A)

◆ 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 4546 of file ASTWriter.cpp.

References AddAttr(), and push_back().

◆ AddConceptReference()

void ASTRecordWriter::AddConceptReference ( const ConceptReference CR)

◆ AddCXXBaseSpecifier()

void ASTRecordWriter::AddCXXBaseSpecifier ( const CXXBaseSpecifier Base)

Emit a C++ base specifier.

Definition at line 6240 of file ASTWriter.cpp.

References AddSourceLocation(), AddSourceRange(), and AddTypeSourceInfo().

Referenced by EmitCXXBaseSpecifiers().

◆ AddCXXBaseSpecifiers()

void ASTRecordWriter::AddCXXBaseSpecifiers ( ArrayRef< CXXBaseSpecifier Bases)

Emit a set of C++ base specifiers.

Definition at line 6264 of file ASTWriter.cpp.

References AddOffset(), and EmitCXXBaseSpecifiers().

Referenced by AddCXXDefinitionData().

◆ AddCXXCtorInitializers()

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

Emit a CXXCtorInitializer array.

Definition at line 6304 of file ASTWriter.cpp.

References AddOffset(), and EmitCXXCtorInitializers().

Referenced by AddFunctionDefinition().

◆ AddCXXDefinitionData()

void ASTRecordWriter::AddCXXDefinitionData ( const CXXRecordDecl D)

◆ AddCXXTemporary()

void ASTRecordWriter::AddCXXTemporary ( const CXXTemporary Temp)

Emit a CXXTemporary.

Definition at line 5859 of file ASTWriter.cpp.

References AddDeclRef(), and clang::CXXTemporary::getDestructor().

◆ AddDeclarationName()

void clang::ASTRecordWriter::AddDeclarationName ( DeclarationName  Name)
inline

Emit a declaration name.

Definition at line 243 of file ASTRecordWriter.h.

Referenced by AddDeclarationNameInfo().

◆ AddDeclarationNameInfo()

void ASTRecordWriter::AddDeclarationNameInfo ( const DeclarationNameInfo NameInfo)

◆ AddDeclarationNameLoc()

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

◆ 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 184 of file ASTRecordWriter.h.

References clang::ASTWriter::AddIdentifierRef().

Referenced by AddNestedNameSpecifierLoc(), and writeIdentifier().

◆ AddNestedNameSpecifier()

void clang::ASTRecordWriter::AddNestedNameSpecifier ( NestedNameSpecifier NNS)
inline

Emit a nested name specifier.

Definition at line 254 of file ASTRecordWriter.h.

References clang::serialization::DataStreamBasicWriter< ASTRecordWriter >::writeNestedNameSpecifier().

◆ 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 111 of file ASTRecordWriter.h.

Referenced by AddCXXBaseSpecifiers(), and AddCXXCtorInitializers().

◆ AddPath()

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

Emit a path.

Definition at line 308 of file ASTRecordWriter.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 5836 of file ASTWriter.cpp.

Referenced by writeSelector().

◆ AddSourceLocation()

void clang::ASTRecordWriter::AddSourceLocation ( SourceLocation  Loc,
LocSeq Seq = nullptr 
)
inline

◆ AddSourceRange()

void clang::ASTRecordWriter::AddSourceRange ( SourceRange  Range,
LocSeq Seq = nullptr 
)
inline

Emit a source range.

Definition at line 151 of file ASTRecordWriter.h.

References clang::ASTWriter::AddSourceRange(), and clang::Seq.

Referenced by AddCXXBaseSpecifier(), AddDeclarationNameLoc(), and AddNestedNameSpecifierLoc().

◆ 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 123 of file ASTRecordWriter.h.

Referenced by AddFunctionDefinition(), AddTemplateArgumentLocInfo(), AddTemplateParameterList(), EmitCXXCtorInitializers(), writeOMPChildren(), writeOpenACCClause(), and writeStmtRef().

◆ AddString()

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

Emit a string.

Definition at line 303 of file ASTRecordWriter.h.

References clang::ASTWriter::AddString().

◆ AddTemplateArgument()

void clang::ASTRecordWriter::AddTemplateArgument ( const TemplateArgument Arg)
inline

Emit a template argument.

Definition at line 267 of file ASTRecordWriter.h.

Referenced by AddTemplateArgumentList(), and AddTemplateArgumentLoc().

◆ AddTemplateArgumentList()

void ASTRecordWriter::AddTemplateArgumentList ( const TemplateArgumentList TemplateArgs)

Emit a template argument list.

Definition at line 6211 of file ASTWriter.cpp.

References AddTemplateArgument(), 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 clang::ASTRecordWriter::AddTemplateName ( TemplateName  Name)
inline

Emit a template name.

Definition at line 262 of file ASTRecordWriter.h.

◆ AddTemplateParameterList()

void ASTRecordWriter::AddTemplateParameterList ( const TemplateParameterList TemplateParams)

◆ AddTypeLoc()

void ASTRecordWriter::AddTypeLoc ( TypeLoc  TL,
LocSeq Seq = nullptr 
)

Emits source location information for a type. Does not emit the type.

Definition at line 5915 of file ASTWriter.cpp.

References clang::TypeLoc::getNextTypeLoc(), clang::TypeLoc::isNull(), and clang::Seq.

Referenced by AddNestedNameSpecifierLoc(), and AddTypeSourceInfo().

◆ AddTypeRef()

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

Emit a reference to a type.

Definition at line 207 of file ASTRecordWriter.h.

References clang::ASTWriter::AddTypeRef(), and clang::T.

Referenced by AddNestedNameSpecifierLoc(), AddTypeSourceInfo(), and writeQualType().

◆ AddTypeSourceInfo()

void ASTRecordWriter::AddTypeSourceInfo ( TypeSourceInfo TInfo)

◆ AddUnresolvedSet()

void ASTRecordWriter::AddUnresolvedSet ( const ASTUnresolvedSet Set)

Emit a UnresolvedSet structure.

Definition at line 6230 of file ASTWriter.cpp.

References AddDeclRef(), and clang::Set.

Referenced by AddCXXDefinitionData().

◆ AddVarDeclInit()

void ASTRecordWriter::AddVarDeclInit ( const VarDecl VD)

◆ AddVersionTuple()

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

Emit a version tuple.

Definition at line 313 of file ASTRecordWriter.h.

References clang::ASTWriter::AddVersionTuple().

◆ append()

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

Definition at line 82 of file ASTRecordWriter.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 93 of file ASTRecordWriter.h.

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

◆ 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 102 of file ASTRecordWriter.h.

◆ empty()

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

Definition at line 85 of file ASTRecordWriter.h.

◆ getRecordData()

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

Extract the underlying record storage.

Definition at line 76 of file ASTRecordWriter.h.

◆ operator=()

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

◆ operator[]()

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

Definition at line 87 of file ASTRecordWriter.h.

◆ push_back()

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

Minimal vector-like interface.

Definition at line 80 of file ASTRecordWriter.h.

Referenced by AddAttributes(), AddConceptReference(), AddVarDeclInit(), EmitCXXBaseSpecifiers(), and EmitCXXCtorInitializers().

◆ size()

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

Definition at line 86 of file ASTRecordWriter.h.

◆ writeBool()

void clang::ASTRecordWriter::writeBool ( bool  Value)
inline

◆ writeBTFTypeTagAttr()

void clang::ASTRecordWriter::writeBTFTypeTagAttr ( const BTFTypeTagAttr *  A)
inline

Write an BTFTypeTagAttr object.

Definition at line 131 of file ASTRecordWriter.h.

References AddAttr().

◆ writeDeclRef()

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

Definition at line 238 of file ASTRecordWriter.h.

References AddDeclRef().

Referenced by writeTypeCoupledDeclRefInfo().

◆ writeIdentifier()

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

Definition at line 187 of file ASTRecordWriter.h.

References AddIdentifierRef().

◆ writeOMPChildren()

void ASTRecordWriter::writeOMPChildren ( OMPChildren Data)

Writes data related to the OpenMP directives.

Definition at line 7620 of file ASTWriter.cpp.

References AddStmt(), clang::Data, writeBool(), writeOMPClause(), and writeUInt32().

◆ writeOMPClause()

void ASTRecordWriter::writeOMPClause ( OMPClause C)

Definition at line 6809 of file ASTWriter.cpp.

References clang::C.

Referenced by writeOMPChildren().

◆ writeOMPTraitInfo()

void ASTRecordWriter::writeOMPTraitInfo ( const OMPTraitInfo TI)

◆ writeOpenACCClause()

void ASTRecordWriter::writeOpenACCClause ( const OpenACCClause C)

◆ writeOpenACCClauseList()

void ASTRecordWriter::writeOpenACCClauseList ( ArrayRef< const OpenACCClause * >  Clauses)

Writes out a list of OpenACC clauses.

Definition at line 7715 of file ASTWriter.cpp.

References writeOpenACCClause().

◆ writeQualType()

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

Definition at line 210 of file ASTRecordWriter.h.

References AddTypeRef(), and clang::T.

◆ writeSelector()

void clang::ASTRecordWriter::writeSelector ( Selector  sel)
inline

Definition at line 193 of file ASTRecordWriter.h.

References AddSelectorRef().

◆ writeSourceLocation()

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

Definition at line 141 of file ASTRecordWriter.h.

References AddSourceLocation().

Referenced by writeOpenACCClause().

◆ writeStmtRef()

void clang::ASTRecordWriter::writeStmtRef ( const Stmt S)
inline

Definition at line 126 of file ASTRecordWriter.h.

References AddStmt().

Referenced by AddVarDeclInit().

◆ writeTypeCoupledDeclRefInfo()

void clang::ASTRecordWriter::writeTypeCoupledDeclRefInfo ( TypeCoupledDeclRefInfo  Info)
inline

◆ writeUInt32()

void clang::ASTRecordWriter::writeUInt32 ( uint32_t  Value)
inline

Definition at line 159 of file ASTRecordWriter.h.

Referenced by writeOMPChildren(), and writeOMPTraitInfo().

◆ writeUInt64()

void clang::ASTRecordWriter::writeUInt64 ( uint64_t  Value)
inline

Definition at line 163 of file ASTRecordWriter.h.


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