clang
10.0.0svn
|
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... | |
ASTRecordWriter & | operator= (const ASTRecordWriter &)=delete |
ASTWriter::RecordDataImpl & | getRecordData () 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 | AddAPValue (const APValue &Value) |
Emit an APvalue. 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 source location information for a type. Does not emit the type. 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 | AddAttr (const Attr *A) |
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) |
An object for streaming information to a record.
Definition at line 748 of file ASTWriter.h.
|
inline |
Construct a ASTRecordWriter that uses the default encoding scheme.
Definition at line 779 of file ASTWriter.h.
|
inline |
Construct a ASTRecordWriter that uses the same encoding scheme as another ASTRecordWriter.
Definition at line 784 of file ASTWriter.h.
|
delete |
Copying an ASTRecordWriter is almost certainly a bug.
void ASTRecordWriter::AddAPFloat | ( | const llvm::APFloat & | Value | ) |
Emit a floating-point value.
Definition at line 5448 of file ASTWriter.cpp.
void ASTRecordWriter::AddAPInt | ( | const llvm::APInt & | Value | ) |
Emit an integral value.
Definition at line 5437 of file ASTWriter.cpp.
void ASTRecordWriter::AddAPSInt | ( | const llvm::APSInt & | Value | ) |
Emit a signed integral value.
Definition at line 5443 of file ASTWriter.cpp.
void ASTRecordWriter::AddAPValue | ( | const APValue & | Value | ) |
Emit an APvalue.
Definition at line 5460 of file ASTWriter.cpp.
References clang::APValue::AddrLabelDiff, clang::APValue::Array, clang::APValue::ComplexFloat, clang::APValue::ComplexInt, clang::APValue::FixedPoint, clang::APValue::Float, clang::APValue::getComplexFloatImag(), clang::APValue::getComplexFloatReal(), clang::APValue::getComplexIntImag(), clang::APValue::getComplexIntReal(), clang::APValue::getFixedPoint(), clang::APValue::getFloat(), clang::APValue::getInt(), clang::APValue::getKind(), clang::APFixedPoint::getSemantics(), clang::APFixedPoint::getValue(), clang::APValue::Indeterminate, clang::APValue::Int, clang::APValue::LValue, clang::APValue::MemberPointer, clang::APValue::None, clang::APValue::Struct, clang::APValue::Union, clang::APValue::Vector, and WriteFixedPointSemantics().
void ASTRecordWriter::AddASTTemplateArgumentListInfo | ( | const ASTTemplateArgumentListInfo * | ASTTemplArgList | ) |
Emits an AST template argument list info.
Definition at line 6095 of file ASTWriter.cpp.
References clang::ASTWriter::AddSourceLocation(), clang::ASTTemplateArgumentListInfo::getTemplateArgs(), clang::ASTTemplateArgumentListInfo::LAngleLoc, clang::ASTTemplateArgumentListInfo::NumTemplateArgs, and clang::ASTTemplateArgumentListInfo::RAngleLoc.
void ASTRecordWriter::AddAttr | ( | const Attr * | A | ) |
Definition at line 4559 of file ASTWriter.cpp.
References clang::AttributeCommonInfo::getAttrName(), clang::Attr::getKind(), clang::AttributeCommonInfo::getParsedKind(), clang::AttributeCommonInfo::getRange(), clang::AttributeCommonInfo::getScopeLoc(), clang::AttributeCommonInfo::getScopeName(), and clang::AttributeCommonInfo::getSyntax().
Emit a list of attributes.
Emit the list of attributes to the specified record.
Definition at line 4577 of file ASTWriter.cpp.
void ASTRecordWriter::AddCXXBaseSpecifier | ( | const CXXBaseSpecifier & | Base | ) |
Emit a C++ base specifier.
Definition at line 6116 of file ASTWriter.cpp.
References clang::ASTWriter::AddSourceLocation(), clang::ASTWriter::AddSourceRange(), clang::CXXBaseSpecifier::getAccessSpecifierAsWritten(), clang::CXXBaseSpecifier::getEllipsisLoc(), clang::CXXBaseSpecifier::getInheritConstructors(), clang::CXXBaseSpecifier::getSourceRange(), clang::CXXBaseSpecifier::getTypeSourceInfo(), clang::CXXBaseSpecifier::isBaseOfClass(), clang::CXXBaseSpecifier::isPackExpansion(), and clang::CXXBaseSpecifier::isVirtual().
Referenced by EmitCXXBaseSpecifiers().
void ASTRecordWriter::AddCXXBaseSpecifiers | ( | ArrayRef< CXXBaseSpecifier > | Bases | ) |
Emit a set of C++ base specifiers.
Definition at line 6140 of file ASTWriter.cpp.
References clang::interp::AddOffset(), and EmitCXXBaseSpecifiers().
void ASTRecordWriter::AddCXXCtorInitializers | ( | ArrayRef< CXXCtorInitializer *> | CtorInits | ) |
Emit a CXXCtorInitializer array.
Definition at line 6180 of file ASTWriter.cpp.
References clang::interp::AddOffset(), and EmitCXXCtorInitializers().
void ASTRecordWriter::AddCXXDefinitionData | ( | const CXXRecordDecl * | D | ) |
Definition at line 6185 of file ASTWriter.cpp.
References clang::ASTWriter::AddDeclRef(), clang::ASTWriter::AddSourceLocation(), clang::LambdaCapture::capturesVariable(), clang::LambdaCapture::getCapturedVar(), clang::LambdaCapture::getCaptureKind(), clang::LambdaCapture::getEllipsisLoc(), clang::serialization::TypeIdx::getIndex(), clang::CXXRecordDecl::getLambdaContextDecl(), clang::LambdaCapture::getLocation(), clang::CXXRecordDecl::getODRHash(), clang::TagDecl::isDependentType(), clang::LambdaCapture::isImplicit(), clang::LambdaCapture::isPackExpansion(), clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_StarThis, clang::LCK_This, clang::LCK_VLAType, clang::serialization::NUM_PREDEF_DECL_IDS, clang::serialization::NUM_PREDEF_IDENT_IDS, clang::serialization::NUM_PREDEF_MACRO_IDS, clang::serialization::NUM_PREDEF_SELECTOR_IDS, clang::serialization::NUM_PREDEF_SUBMODULE_IDS, and clang::serialization::NUM_PREDEF_TYPE_IDS.
void ASTRecordWriter::AddCXXTemporary | ( | const CXXTemporary * | Temp | ) |
Emit a CXXTemporary.
Definition at line 5572 of file ASTWriter.cpp.
References clang::ASTWriter::AddDeclRef(), and clang::CXXTemporary::getDestructor().
void ASTRecordWriter::AddDeclarationName | ( | DeclarationName | Name | ) |
Emit a declaration name.
Definition at line 5765 of file ASTWriter.cpp.
void ASTRecordWriter::AddDeclarationNameInfo | ( | const DeclarationNameInfo & | NameInfo | ) |
Definition at line 5855 of file ASTWriter.cpp.
References clang::ASTWriter::AddSourceLocation(), clang::DeclarationNameInfo::getInfo(), clang::DeclarationNameInfo::getLoc(), and clang::DeclarationNameInfo::getName().
void ASTRecordWriter::AddDeclarationNameLoc | ( | const DeclarationNameLoc & | DNLoc, |
DeclarationName | Name | ||
) |
Definition at line 5824 of file ASTWriter.cpp.
|
inline |
Emit a reference to a declaration.
Definition at line 909 of file ASTWriter.h.
References clang::ASTWriter::AddDeclRef().
Referenced by addExceptionSpec(), clang::ASTDeclWriter::AddFirstDeclFromEachModule(), clang::ASTDeclWriter::AddObjCTypeParamList(), EmitCXXCtorInitializers(), and clang::ASTDeclWriter::VisitRedeclarable().
void ASTRecordWriter::AddFunctionDefinition | ( | const FunctionDecl * | FD | ) |
Add a definition for the given function to the queue of statements to emit.
Definition at line 2394 of file ASTWriterDecl.cpp.
References clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::FunctionDecl::getBody(), clang::GVA_Internal, clang::GVA_StrongExternal, clang::Decl::hasAttr(), clang::DeclContext::isDependentContext(), and clang::Module::ModuleInterfaceUnit.
|
inline |
Emit a reference to an identifier.
Definition at line 870 of file ASTWriter.h.
References clang::ASTWriter::AddIdentifierRef().
void ASTRecordWriter::AddNestedNameSpecifier | ( | NestedNameSpecifier * | NNS | ) |
Emit a nested name specifier.
Definition at line 5869 of file ASTWriter.cpp.
References clang::ASTWriter::AddDeclRef(), clang::ASTWriter::AddIdentifierRef(), clang::ASTWriter::AddTypeRef(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsRecordDecl(), clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
void ASTRecordWriter::AddNestedNameSpecifierLoc | ( | NestedNameSpecifierLoc | NNS | ) |
Emit a nested name specifier with source-location information.
Definition at line 5915 of file ASTWriter.cpp.
References clang::ASTWriter::AddDeclRef(), clang::ASTWriter::AddIdentifierRef(), clang::ASTWriter::AddSourceLocation(), clang::ASTWriter::AddSourceRange(), clang::ASTWriter::AddTypeRef(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsRecordDecl(), clang::SourceRange::getEnd(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifierLoc::getLocalSourceRange(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::NestedNameSpecifierLoc::getPrefix(), clang::TypeLoc::getType(), clang::NestedNameSpecifierLoc::getTypeLoc(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
|
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 827 of file ASTWriter.h.
|
inline |
void ASTRecordWriter::AddQualifierInfo | ( | const QualifierInfo & | Info | ) |
Definition at line 5862 of file ASTWriter.cpp.
References clang::QualifierInfo::NumTemplParamLists, clang::QualifierInfo::QualifierLoc, and clang::QualifierInfo::TemplParamLists.
void ASTRecordWriter::AddSelectorRef | ( | Selector | S | ) |
Emit a Selector (which is a smart pointer reference).
Definition at line 5549 of file ASTWriter.cpp.
|
inline |
Emit a source location.
Definition at line 848 of file ASTWriter.h.
References clang::ASTWriter::AddSourceLocation().
Referenced by clang::ASTDeclWriter::AddObjCTypeParamList(), clang::ASTStmtWriter::AddTemplateKWAndArgsInfo(), and EmitCXXCtorInitializers().
|
inline |
Emit a source range.
Definition at line 853 of file ASTWriter.h.
References clang::ASTWriter::AddSourceRange().
|
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 839 of file ASTWriter.h.
Referenced by addExceptionSpec(), addExplicitSpecifier(), and EmitCXXCtorInitializers().
|
inline |
Emit a string.
Definition at line 949 of file ASTWriter.h.
References clang::ASTWriter::AddString().
void ASTRecordWriter::AddTemplateArgument | ( | const TemplateArgument & | Arg | ) |
Emit a template argument.
Definition at line 6028 of file ASTWriter.cpp.
References clang::ASTWriter::AddDeclRef(), clang::ASTWriter::AddTypeRef(), clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgument::getAsDecl(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsIntegral(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getIntegralType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getNullPtrType(), clang::TemplateArgument::getNumTemplateExpansions(), clang::TemplateArgument::getParamTypeForDecl(), clang::TemplateArgument::Integral, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, P, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_elements(), clang::TemplateArgument::pack_size(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
void ASTRecordWriter::AddTemplateArgumentList | ( | const TemplateArgumentList * | TemplateArgs | ) |
Emit a template argument list.
Definition at line 6087 of file ASTWriter.cpp.
References clang::TemplateArgumentList::get(), and clang::TemplateArgumentList::size().
void ASTRecordWriter::AddTemplateArgumentLoc | ( | const TemplateArgumentLoc & | Arg | ) |
Emits a template argument location.
Definition at line 5604 of file ASTWriter.cpp.
References clang::TemplateArgument::Expression, clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgumentLocInfo::getAsExpr(), clang::TemplateArgument::getKind(), and clang::TemplateArgumentLoc::getLocInfo().
Referenced by clang::ASTStmtWriter::AddTemplateKWAndArgsInfo().
void ASTRecordWriter::AddTemplateArgumentLocInfo | ( | TemplateArgument::ArgKind | Kind, |
const TemplateArgumentLocInfo & | Arg | ||
) |
Emits a template argument location info.
Definition at line 5576 of file ASTWriter.cpp.
References clang::ASTWriter::AddSourceLocation(), clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgumentLocInfo::getAsExpr(), clang::TemplateArgumentLocInfo::getAsTypeSourceInfo(), clang::TemplateArgumentLocInfo::getTemplateEllipsisLoc(), clang::TemplateArgumentLocInfo::getTemplateNameLoc(), clang::TemplateArgumentLocInfo::getTemplateQualifierLoc(), clang::TemplateArgument::Integral, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
void ASTRecordWriter::AddTemplateName | ( | TemplateName | Name | ) |
Emit a template name.
Definition at line 5969 of file ASTWriter.cpp.
void ASTRecordWriter::AddTemplateParameterList | ( | const TemplateParameterList * | TemplateParams | ) |
Emit a template parameter list.
Definition at line 6068 of file ASTWriter.cpp.
References clang::ASTWriter::AddDeclRef(), clang::ASTWriter::AddSourceLocation(), clang::TemplateParameterList::getLAngleLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getTemplateLoc(), P, and clang::TemplateParameterList::size().
void ASTRecordWriter::AddTypeLoc | ( | TypeLoc | TL | ) |
Emits source location information for a type. Does not emit the type.
Definition at line 5627 of file ASTWriter.cpp.
References clang::TypeLoc::getNextTypeLoc(), and clang::TypeLoc::isNull().
|
inline |
Emit a reference to a type.
Definition at line 887 of file ASTWriter.h.
References clang::ASTWriter::AddTypeRef().
Referenced by addExceptionSpec(), and clang::ASTTypeWriter::Visit().
void ASTRecordWriter::AddTypeSourceInfo | ( | TypeSourceInfo * | TInfo | ) |
Emits a reference to a declarator info.
Definition at line 5617 of file ASTWriter.cpp.
References clang::ASTWriter::AddTypeRef(), clang::TypeSourceInfo::getType(), and clang::TypeSourceInfo::getTypeLoc().
Referenced by EmitCXXCtorInitializers().
void ASTRecordWriter::AddUnresolvedSet | ( | const ASTUnresolvedSet & | Set | ) |
Emit a UnresolvedSet structure.
Definition at line 6106 of file ASTWriter.cpp.
References clang::ASTWriter::AddDeclRef(), clang::ASTUnresolvedSet::begin(), clang::ASTUnresolvedSet::end(), and clang::ASTUnresolvedSet::size().
|
inline |
Emit a version tuple.
Definition at line 959 of file ASTWriter.h.
References clang::ASTWriter::AddVersionTuple().
|
inline |
Definition at line 798 of file ASTWriter.h.
Referenced by clang::ASTDeclWriter::AddTemplateSpecializations().
|
inline |
Emit the record to the stream, followed by its substatements, and return its offset.
Definition at line 809 of file ASTWriter.h.
References Offset.
Referenced by clang::ASTDeclWriter::Emit(), clang::ASTTypeWriter::Emit(), EmitCXXBaseSpecifiers(), EmitCXXCtorInitializers(), and clang::ASTDeclWriter::VisitRedeclarable().
|
inline |
Emit the record to the stream, preceded by its substatements.
Definition at line 818 of file ASTWriter.h.
Referenced by clang::ASTStmtWriter::Emit().
|
inline |
Definition at line 801 of file ASTWriter.h.
|
inline |
Extract the underlying record storage.
Definition at line 792 of file ASTWriter.h.
|
delete |
|
inline |
Definition at line 803 of file ASTWriter.h.
|
inline |
Minimal vector-like interface.
Definition at line 796 of file ASTWriter.h.
Referenced by addExceptionSpec(), addExplicitSpecifier(), clang::ASTDeclWriter::AddObjCTypeParamList(), clang::ASTDeclWriter::AddTemplateSpecializations(), EmitCXXBaseSpecifiers(), EmitCXXCtorInitializers(), clang::ASTTypeWriter::Visit(), and WriteFixedPointSemantics().
|
inline |
Definition at line 802 of file ASTWriter.h.
Referenced by clang::ASTDeclWriter::AddTemplateSpecializations().