clang API Documentation

Classes | Public Types | Public Member Functions | Friends
clang::ASTWriter Class Reference

Writes an AST file containing the contents of a translation unit. More...

#include <ASTWriter.h>

Inheritance diagram for clang::ASTWriter:
Inheritance graph
[legend]
Collaboration diagram for clang::ASTWriter:
Collaboration graph
[legend]

List of all members.

Classes

struct  DeclIDInFileInfo
class  DeclOrType
 Stores a declaration or a type to be written to the AST file.
class  DeclUpdate
 An update to a Decl.
struct  MacroInfoToEmitData
struct  QueuedCXXBaseSpecifiers
 A set of C++ base specifiers that is queued to be written into the AST file.
struct  ReplacedDeclInfo

Public Types

typedef SmallVector< uint64_t, 64 > RecordData
typedef SmallVectorImpl< uint64_t > RecordDataImpl

Public Member Functions

 ASTWriter (llvm::BitstreamWriter &Stream)
 Create a new precompiled header writer that outputs to the given bitstream.
 ~ASTWriter ()
void WriteAST (Sema &SemaRef, const std::string &OutputFile, Module *WritingModule, StringRef isysroot, bool hasErrors=false)
 Write a precompiled header for the given semantic analysis.
void AddToken (const Token &Tok, RecordDataImpl &Record)
 Emit a token.
void AddSourceLocation (SourceLocation Loc, RecordDataImpl &Record)
 Emit a source location.
void AddSourceRange (SourceRange Range, RecordDataImpl &Record)
 Emit a source range.
void AddAPInt (const llvm::APInt &Value, RecordDataImpl &Record)
 Emit an integral value.
void AddAPSInt (const llvm::APSInt &Value, RecordDataImpl &Record)
 Emit a signed integral value.
void AddAPFloat (const llvm::APFloat &Value, RecordDataImpl &Record)
 Emit a floating-point value.
void AddIdentifierRef (const IdentifierInfo *II, RecordDataImpl &Record)
 Emit a reference to an identifier.
void AddSelectorRef (Selector, RecordDataImpl &Record)
 Emit a Selector (which is a smart pointer reference).
void AddCXXTemporary (const CXXTemporary *Temp, RecordDataImpl &Record)
 Emit a CXXTemporary.
void AddCXXBaseSpecifiersRef (CXXBaseSpecifier const *Bases, CXXBaseSpecifier const *BasesEnd, RecordDataImpl &Record)
 Emit a set of C++ base specifiers to the record.
serialization::SelectorID getSelectorRef (Selector Sel)
 Get the unique number used to refer to the given selector.
serialization::IdentID getIdentifierRef (const IdentifierInfo *II)
 Get the unique number used to refer to the given identifier.
serialization::MacroID getMacroRef (MacroInfo *MI, const IdentifierInfo *Name)
 Get the unique number used to refer to the given macro.
serialization::MacroID getMacroID (MacroInfo *MI)
 Determine the ID of an already-emitted macro.
uint64_t getMacroDirectivesOffset (const IdentifierInfo *Name)
void AddTypeRef (QualType T, RecordDataImpl &Record)
 Emit a reference to a type.
serialization::TypeID GetOrCreateTypeID (QualType T)
 Force a type to be emitted and get its ID.
serialization::TypeID getTypeID (QualType T) const
 Determine the type ID of an already-emitted type.
serialization::TypeIdx GetOrCreateTypeIdx (QualType T)
 Force a type to be emitted and get its index.
serialization::TypeIdx getTypeIdx (QualType T) const
 Determine the type index of an already-emitted type.
void AddTypeSourceInfo (TypeSourceInfo *TInfo, RecordDataImpl &Record)
 Emits a reference to a declarator info.
void AddTypeLoc (TypeLoc TL, RecordDataImpl &Record)
 Emits a type with source-location information.
void AddTemplateArgumentLocInfo (TemplateArgument::ArgKind Kind, const TemplateArgumentLocInfo &Arg, RecordDataImpl &Record)
 Emits a template argument location info.
void AddTemplateArgumentLoc (const TemplateArgumentLoc &Arg, RecordDataImpl &Record)
 Emits a template argument location.
void AddASTTemplateArgumentListInfo (const ASTTemplateArgumentListInfo *ASTTemplArgList, RecordDataImpl &Record)
 Emits an AST template argument list info.
void AddDeclRef (const Decl *D, RecordDataImpl &Record)
 Emit a reference to a declaration.
serialization::DeclID GetDeclRef (const Decl *D)
 Force a declaration to be emitted and get its ID.
serialization::DeclID getDeclID (const Decl *D)
 Determine the declaration ID of an already-emitted declaration.
void AddDeclarationName (DeclarationName Name, RecordDataImpl &Record)
 Emit a declaration name.
void AddDeclarationNameLoc (const DeclarationNameLoc &DNLoc, DeclarationName Name, RecordDataImpl &Record)
void AddDeclarationNameInfo (const DeclarationNameInfo &NameInfo, RecordDataImpl &Record)
unsigned getAnonymousDeclarationNumber (const NamedDecl *D)
void AddQualifierInfo (const QualifierInfo &Info, RecordDataImpl &Record)
void AddNestedNameSpecifier (NestedNameSpecifier *NNS, RecordDataImpl &Record)
 Emit a nested name specifier.
void AddNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS, RecordDataImpl &Record)
 Emit a nested name specifier with source-location information.
void AddTemplateName (TemplateName Name, RecordDataImpl &Record)
 Emit a template name.
void AddTemplateArgument (const TemplateArgument &Arg, RecordDataImpl &Record)
 Emit a template argument.
void AddTemplateParameterList (const TemplateParameterList *TemplateParams, RecordDataImpl &Record)
 Emit a template parameter list.
void AddTemplateArgumentList (const TemplateArgumentList *TemplateArgs, RecordDataImpl &Record)
 Emit a template argument list.
void AddUnresolvedSet (const ASTUnresolvedSet &Set, RecordDataImpl &Record)
 Emit a UnresolvedSet structure.
void AddCXXBaseSpecifier (const CXXBaseSpecifier &Base, RecordDataImpl &Record)
 Emit a C++ base specifier.
void AddCXXCtorInitializers (const CXXCtorInitializer *const *CtorInitializers, unsigned NumCtorInitializers, RecordDataImpl &Record)
 Emit a CXXCtorInitializer array.
void AddCXXDefinitionData (const CXXRecordDecl *D, RecordDataImpl &Record)
void AddString (StringRef Str, RecordDataImpl &Record)
 Add a string to the given record.
void AddVersionTuple (const VersionTuple &Version, RecordDataImpl &Record)
 Add a version tuple to the given record.
void AddUpdatedDeclContext (const DeclContext *DC)
 Mark a declaration context as needing an update.
void RewriteDecl (const Decl *D)
bool isRewritten (const Decl *D) const
serialization::SubmoduleID inferSubmoduleIDFromLocation (SourceLocation Loc)
 Infer the submodule ID that contains an entity at the given source location.
unsigned getExistingSubmoduleID (Module *Mod) const
 Retrieve a submodule ID for this module. Returns 0 If no ID has been associated with the module.
void SetIdentifierOffset (const IdentifierInfo *II, uint32_t Offset)
 Note that the identifier II occurs at the given offset within the identifier table.
void SetSelectorOffset (Selector Sel, uint32_t Offset)
 Note that the selector Sel occurs at the given offset within the method pool/selector table.
void AddStmt (Stmt *S)
 Add the given statement or expression to the queue of statements to emit.
void FlushStmts ()
 Flush all of the statements and expressions that have been added to the queue via AddStmt().
void FlushCXXBaseSpecifiers ()
 Flush all of the C++ base specifier sets that have been added via AddCXXBaseSpecifiersRef().
unsigned RecordSwitchCaseID (SwitchCase *S)
 Record an ID for the given switch-case statement.
unsigned getSwitchCaseID (SwitchCase *S)
 Retrieve the ID for the given switch-case statement.
void ClearSwitchCaseIDs ()
unsigned getTypeExtQualAbbrev () const
unsigned getTypeFunctionProtoAbbrev () const
unsigned getDeclParmVarAbbrev () const
unsigned getDeclRecordAbbrev () const
unsigned getDeclTypedefAbbrev () const
unsigned getDeclVarAbbrev () const
unsigned getDeclFieldAbbrev () const
unsigned getDeclEnumAbbrev () const
unsigned getDeclObjCIvarAbbrev () const
unsigned getDeclCXXMethodAbbrev () const
unsigned getDeclRefExprAbbrev () const
unsigned getCharacterLiteralAbbrev () const
unsigned getIntegerLiteralAbbrev () const
unsigned getExprImplicitCastAbbrev () const
bool hasChain () const
void ReaderInitialized (ASTReader *Reader) override
 The ASTReader was initialized.
void IdentifierRead (serialization::IdentID ID, IdentifierInfo *II) override
 An identifier was deserialized from the AST file.
void MacroRead (serialization::MacroID ID, MacroInfo *MI) override
 A macro was read from the AST file.
void TypeRead (serialization::TypeIdx Idx, QualType T) override
 A type was deserialized from the AST file. The ID here has the qualifier bits already removed, and T is guaranteed to be locally unqualified.
void SelectorRead (serialization::SelectorID ID, Selector Sel) override
 A selector was read from the AST file.
void MacroDefinitionRead (serialization::PreprocessedEntityID ID, MacroDefinition *MD) override
 A macro definition was read from the AST file.
void ModuleRead (serialization::SubmoduleID ID, Module *Mod) override
 A module definition was read from the AST file.
void CompletedTagDefinition (const TagDecl *D) override
 A new TagDecl definition was completed.
void AddedVisibleDecl (const DeclContext *DC, const Decl *D) override
 A new declaration with name has been added to a DeclContext.
void AddedCXXImplicitMember (const CXXRecordDecl *RD, const Decl *D) override
 An implicit member was added after the definition was completed.
void AddedCXXTemplateSpecialization (const ClassTemplateDecl *TD, const ClassTemplateSpecializationDecl *D) override
 A template specialization (or partial one) was added to the template declaration.
void AddedCXXTemplateSpecialization (const VarTemplateDecl *TD, const VarTemplateSpecializationDecl *D) override
 A template specialization (or partial one) was added to the template declaration.
void AddedCXXTemplateSpecialization (const FunctionTemplateDecl *TD, const FunctionDecl *D) override
 A template specialization (or partial one) was added to the template declaration.
void ResolvedExceptionSpec (const FunctionDecl *FD) override
 A function's exception specification has been evaluated or instantiated.
void DeducedReturnType (const FunctionDecl *FD, QualType ReturnType) override
 A function's return type has been deduced.
void CompletedImplicitDefinition (const FunctionDecl *D) override
 An implicit member got a definition.
void StaticDataMemberInstantiated (const VarDecl *D) override
 A static data member was implicitly instantiated.
void FunctionDefinitionInstantiated (const FunctionDecl *D) override
 A function template's definition was instantiated.
void AddedObjCCategoryToInterface (const ObjCCategoryDecl *CatD, const ObjCInterfaceDecl *IFD) override
 A new objc category class was added for an interface.
void AddedObjCPropertyInClassExtension (const ObjCPropertyDecl *Prop, const ObjCPropertyDecl *OrigProp, const ObjCCategoryDecl *ClassExt) override
 A objc class extension redeclared or introduced a property.
void DeclarationMarkedUsed (const Decl *D) override
 A declaration is marked used which was not previously marked used.
void DeclarationMarkedOpenMPThreadPrivate (const Decl *D) override
 A declaration is marked as OpenMP threadprivate which was not previously marked as threadprivate.

Friends

class ASTDeclWriter
class ASTStmtWriter

Detailed Description

Writes an AST file containing the contents of a translation unit.

The ASTWriter class produces a bitstream containing the serialized representation of a given abstract syntax tree and its supporting data structures. This bitstream can be de-serialized via an instance of the ASTReader class.

Definition at line 78 of file ASTWriter.h.


Member Typedef Documentation

typedef SmallVector<uint64_t, 64> clang::ASTWriter::RecordData

Definition at line 81 of file ASTWriter.h.

typedef SmallVectorImpl<uint64_t> clang::ASTWriter::RecordDataImpl

Definition at line 82 of file ASTWriter.h.


Constructor & Destructor Documentation

ASTWriter::ASTWriter ( llvm::BitstreamWriter &  Stream)

Create a new precompiled header writer that outputs to the given bitstream.

Definition at line 4108 of file ASTWriter.cpp.

Definition at line 4130 of file ASTWriter.cpp.


Member Function Documentation

void ASTWriter::AddAPFloat ( const llvm::APFloat &  Value,
RecordDataImpl Record 
)

Emit a floating-point value.

Definition at line 4855 of file ASTWriter.cpp.

References AddAPInt(), and Record.

void ASTWriter::AddAPInt ( const llvm::APInt &  Value,
RecordDataImpl Record 
)

Emit an integral value.

Definition at line 4844 of file ASTWriter.cpp.

Referenced by AddAPFloat(), and AddAPSInt().

void ASTWriter::AddAPSInt ( const llvm::APSInt &  Value,
RecordDataImpl Record 
)

Emit a signed integral value.

Definition at line 4850 of file ASTWriter.cpp.

References AddAPInt().

Referenced by AddTemplateArgument().

void ASTWriter::AddCXXBaseSpecifier ( const CXXBaseSpecifier Base,
RecordDataImpl Record 
)
void ASTWriter::AddCXXBaseSpecifiersRef ( CXXBaseSpecifier const *  Bases,
CXXBaseSpecifier const *  BasesEnd,
RecordDataImpl Record 
)

Emit a set of C++ base specifiers to the record.

Definition at line 4929 of file ASTWriter.cpp.

Referenced by AddCXXDefinitionData().

void ASTWriter::AddCXXCtorInitializers ( const CXXCtorInitializer *const *  CtorInitializers,
unsigned  NumCtorInitializers,
RecordDataImpl Record 
)
void ASTWriter::AddCXXDefinitionData ( const CXXRecordDecl D,
RecordDataImpl Record 
)
void ASTWriter::AddCXXTemporary ( const CXXTemporary Temp,
RecordDataImpl Record 
)

Emit a CXXTemporary.

Definition at line 4925 of file ASTWriter.cpp.

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

void ASTWriter::AddDeclarationNameInfo ( const DeclarationNameInfo NameInfo,
RecordDataImpl Record 
)
void ASTWriter::AddDeclRef ( const Decl D,
RecordDataImpl Record 
)
void ASTWriter::AddedCXXImplicitMember ( const CXXRecordDecl RD,
const Decl D 
) [override, virtual]

An implicit member was added after the definition was completed.

Reimplemented from clang::ASTMutationListener.

Definition at line 5758 of file ASTWriter.cpp.

References clang::TagDecl::isCompleteDefinition(), clang::Decl::isFromASTFile(), clang::Decl::isImplicit(), and clang::serialization::UPD_CXX_ADDED_IMPLICIT_MEMBER.

void ASTWriter::AddedCXXTemplateSpecialization ( const ClassTemplateDecl TD,
const ClassTemplateSpecializationDecl D 
) [override, virtual]

A template specialization (or partial one) was added to the template declaration.

Reimplemented from clang::ASTMutationListener.

Definition at line 5771 of file ASTWriter.cpp.

References clang::ClassTemplateDecl::getCanonicalDecl(), clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION.

void ASTWriter::AddedCXXTemplateSpecialization ( const VarTemplateDecl TD,
const VarTemplateSpecializationDecl D 
) [override, virtual]

A template specialization (or partial one) was added to the template declaration.

Reimplemented from clang::ASTMutationListener.

Definition at line 5783 of file ASTWriter.cpp.

References clang::VarTemplateDecl::getCanonicalDecl(), clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION.

void ASTWriter::AddedCXXTemplateSpecialization ( const FunctionTemplateDecl TD,
const FunctionDecl D 
) [override, virtual]

A template specialization (or partial one) was added to the template declaration.

Reimplemented from clang::ASTMutationListener.

Definition at line 5795 of file ASTWriter.cpp.

References clang::FunctionTemplateDecl::getCanonicalDecl(), clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION.

void ASTWriter::AddedObjCCategoryToInterface ( const ObjCCategoryDecl CatD,
const ObjCInterfaceDecl IFD 
) [override, virtual]

A new objc category class was added for an interface.

Reimplemented from clang::ASTMutationListener.

Definition at line 5855 of file ASTWriter.cpp.

References clang::ObjCInterfaceDecl::getDefinition(), and clang::Decl::isFromASTFile().

void ASTWriter::AddedObjCPropertyInClassExtension ( const ObjCPropertyDecl Prop,
const ObjCPropertyDecl OrigProp,
const ObjCCategoryDecl ClassExt 
) [override, virtual]

A objc class extension redeclared or introduced a property.

Parameters:
Propthe property in the class extension
OrigPropthe property from the original interface that was declared or null if the property was introduced.
ClassExtthe class extension.

Reimplemented from clang::ASTMutationListener.

Definition at line 5867 of file ASTWriter.cpp.

References clang::ObjCCategoryDecl::getClassInterface(), clang::Decl::isFromASTFile(), and RewriteDecl().

void ASTWriter::AddedVisibleDecl ( const DeclContext DC,
const Decl D 
) [override, virtual]

A new declaration with name has been added to a DeclContext.

Reimplemented from clang::ASTMutationListener.

Definition at line 5744 of file ASTWriter.cpp.

References AddUpdatedDeclContext(), clang::serialization::getDefinitiveDeclContext(), and clang::Decl::isFromASTFile().

void ASTWriter::AddIdentifierRef ( const IdentifierInfo II,
RecordDataImpl Record 
)

Emit a reference to an identifier.

Definition at line 4859 of file ASTWriter.cpp.

References getIdentifierRef().

Referenced by AddDeclarationName(), AddNestedNameSpecifier(), AddNestedNameSpecifierLoc(), and AddTemplateName().

void ASTWriter::AddQualifierInfo ( const QualifierInfo Info,
RecordDataImpl Record 
)
void ASTWriter::AddSelectorRef ( Selector  SelRef,
RecordDataImpl Record 
)

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

Definition at line 4902 of file ASTWriter.cpp.

References getSelectorRef().

Referenced by AddDeclarationName().

void ASTWriter::AddSourceRange ( SourceRange  Range,
RecordDataImpl Record 
)
void clang::ASTWriter::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, call FlushStmts() to write the corresponding statements just after the type or declaration.

Definition at line 727 of file ASTWriter.h.

Referenced by AddCXXCtorInitializers(), addExceptionSpec(), AddTemplateArgument(), and AddTemplateArgumentLocInfo().

void ASTWriter::AddString ( StringRef  Str,
RecordDataImpl Record 
)

Add a string to the given record.

Definition at line 4068 of file ASTWriter.cpp.

void ASTWriter::AddTemplateArgument ( const TemplateArgument Arg,
RecordDataImpl Record 
)
void ASTWriter::AddTemplateArgumentList ( const TemplateArgumentList TemplateArgs,
RecordDataImpl Record 
)

Emit a template argument list.

Definition at line 5455 of file ASTWriter.cpp.

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

Emit a template name.

Definition at line 5344 of file ASTWriter.cpp.

References AddDeclRef(), AddIdentifierRef(), AddNestedNameSpecifier(), AddTemplateArgument(), clang::OverloadedTemplateStorage::begin(), clang::TemplateName::DependentTemplate, clang::OverloadedTemplateStorage::end(), clang::SubstTemplateTemplateParmPackStorage::getArgumentPack(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateName::getAsOverloadedTemplate(), clang::TemplateName::getAsQualifiedTemplateName(), clang::TemplateName::getAsSubstTemplateTemplateParm(), clang::TemplateName::getAsSubstTemplateTemplateParmPack(), clang::TemplateName::getAsTemplateDecl(), clang::DependentTemplateName::getIdentifier(), clang::TemplateName::getKind(), clang::DependentTemplateName::getOperator(), clang::SubstTemplateTemplateParmStorage::getParameter(), clang::SubstTemplateTemplateParmPackStorage::getParameterPack(), clang::QualifiedTemplateName::getQualifier(), clang::DependentTemplateName::getQualifier(), clang::SubstTemplateTemplateParmStorage::getReplacement(), clang::QualifiedTemplateName::getTemplateDecl(), clang::QualifiedTemplateName::hasTemplateKeyword(), clang::DependentTemplateName::isIdentifier(), clang::TemplateName::OverloadedTemplate, clang::TemplateName::QualifiedTemplate, Record, clang::UncommonTemplateNameStorage::size(), clang::TemplateName::SubstTemplateTemplateParm, clang::TemplateName::SubstTemplateTemplateParmPack, and clang::TemplateName::Template.

Referenced by AddTemplateArgument().

void ASTWriter::AddTemplateParameterList ( const TemplateParameterList TemplateParams,
RecordDataImpl Record 
)
void ASTWriter::AddToken ( const Token Tok,
RecordDataImpl Record 
)
void ASTWriter::AddTypeLoc ( TypeLoc  TL,
RecordDataImpl Record 
)

Emits a type with source-location information.

Definition at line 4993 of file ASTWriter.cpp.

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

Referenced by AddNestedNameSpecifierLoc(), and AddTypeSourceInfo().

void ASTWriter::AddTypeRef ( QualType  T,
RecordDataImpl Record 
)

Emit a reference to a type.

Definition at line 5001 of file ASTWriter.cpp.

References GetOrCreateTypeID().

Referenced by AddDeclarationName(), addExceptionSpec(), AddNestedNameSpecifier(), AddTemplateArgument(), AddTypeLoc(), and AddTypeSourceInfo().

void ASTWriter::AddUnresolvedSet ( const ASTUnresolvedSet Set,
RecordDataImpl Record 
)

Mark a declaration context as needing an update.

Definition at line 3682 of file ASTWriter.cpp.

References getDeclForLocalLookup(), and visitLocalLookupResults().

Referenced by AddedVisibleDecl().

void ASTWriter::AddVersionTuple ( const VersionTuple Version,
RecordDataImpl Record 
)

Add a version tuple to the given record.

Definition at line 4073 of file ASTWriter.cpp.

References clang::VersionTuple::getMajor(), clang::VersionTuple::getMinor(), and clang::VersionTuple::getSubminor().

Definition at line 2050 of file ASTWriterStmt.cpp.

void ASTWriter::CompletedImplicitDefinition ( const FunctionDecl D) [override, virtual]

An implicit member got a definition.

Reimplemented from clang::ASTMutationListener.

Definition at line 5825 of file ASTWriter.cpp.

References clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_ADDED_FUNCTION_DEFINITION.

void ASTWriter::CompletedTagDefinition ( const TagDecl D) [override, virtual]
void ASTWriter::DeclarationMarkedOpenMPThreadPrivate ( const Decl D) [override, virtual]

A declaration is marked as OpenMP threadprivate which was not previously marked as threadprivate.

Parameters:
Dthe declaration marked OpenMP threadprivate.

Reimplemented from clang::ASTMutationListener.

Definition at line 5889 of file ASTWriter.cpp.

References clang::Decl::isFromASTFile(), and clang::serialization::UPD_DECL_MARKED_OPENMP_THREADPRIVATE.

void ASTWriter::DeclarationMarkedUsed ( const Decl D) [override, virtual]

A declaration is marked used which was not previously marked used.

Parameters:
Dthe declaration marked used

Reimplemented from clang::ASTMutationListener.

Definition at line 5881 of file ASTWriter.cpp.

References clang::Decl::isFromASTFile(), and clang::serialization::UPD_DECL_MARKED_USED.

void ASTWriter::DeducedReturnType ( const FunctionDecl FD,
QualType  ReturnType 
) [override, virtual]

A function's return type has been deduced.

Reimplemented from clang::ASTMutationListener.

Definition at line 5816 of file ASTWriter.cpp.

References clang::FunctionDecl::getCanonicalDecl(), clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_DEDUCED_RETURN_TYPE.

Flush all of the C++ base specifier sets that have been added via AddCXXBaseSpecifiersRef().

Definition at line 5498 of file ASTWriter.cpp.

References AddCXXBaseSpecifier(), clang::serialization::DECL_CXX_BASE_SPECIFIERS, FlushStmts(), and Record.

Flush all of the statements and expressions that have been added to the queue via AddStmt().

Flush all of the statements that have been added to the queue via AddStmt().

Definition at line 2128 of file ASTWriterStmt.cpp.

References Record, and clang::serialization::STMT_STOP.

Referenced by FlushCXXBaseSpecifiers().

void ASTWriter::FunctionDefinitionInstantiated ( const FunctionDecl D) [override, virtual]

A function template's definition was instantiated.

Reimplemented from clang::ASTMutationListener.

Definition at line 5834 of file ASTWriter.cpp.

References clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_ADDED_FUNCTION_DEFINITION.

Definition at line 764 of file ASTWriter.h.

Definition at line 761 of file ASTWriter.h.

Definition at line 759 of file ASTWriter.h.

Definition at line 758 of file ASTWriter.h.

DeclID ASTWriter::getDeclID ( const Decl D)

Determine the declaration ID of an already-emitted declaration.

Definition at line 5080 of file ASTWriter.cpp.

References clang::Decl::getGlobalID(), and clang::Decl::isFromASTFile().

Definition at line 760 of file ASTWriter.h.

Definition at line 754 of file ASTWriter.h.

Definition at line 755 of file ASTWriter.h.

DeclID ASTWriter::GetDeclRef ( const Decl D)

Force a declaration to be emitted and get its ID.

Definition at line 5051 of file ASTWriter.cpp.

References clang::Decl::getGlobalID(), and clang::Decl::isFromASTFile().

Referenced by AddDeclRef().

Definition at line 763 of file ASTWriter.h.

Definition at line 756 of file ASTWriter.h.

Definition at line 757 of file ASTWriter.h.

Retrieve a submodule ID for this module. Returns 0 If no ID has been associated with the module.

Definition at line 2335 of file ASTWriter.cpp.

Definition at line 766 of file ASTWriter.h.

Get the unique number used to refer to the given identifier.

Definition at line 4863 of file ASTWriter.cpp.

Referenced by AddIdentifierRef().

Definition at line 765 of file ASTWriter.h.

Definition at line 4897 of file ASTWriter.cpp.

Determine the ID of an already-emitted macro.

Definition at line 4889 of file ASTWriter.cpp.

References clang::MacroInfo::isBuiltinMacro().

Get the unique number used to refer to the given macro.

Definition at line 4873 of file ASTWriter.cpp.

References clang::MacroInfo::isBuiltinMacro().

Force a type to be emitted and get its ID.

Definition at line 5005 of file ASTWriter.cpp.

References GetOrCreateTypeIdx(), and clang::serialization::MakeTypeID().

Referenced by AddTypeRef().

Force a type to be emitted and get its index.

Definition at line 5017 of file ASTWriter.cpp.

References clang::QualType::getLocalFastQualifiers(), and clang::QualType::isNull().

Referenced by GetOrCreateTypeID().

Get the unique number used to refer to the given selector.

Definition at line 4906 of file ASTWriter.cpp.

References clang::Selector::getAsOpaquePtr().

Referenced by AddSelectorRef().

Retrieve the ID for the given switch-case statement.

Definition at line 2044 of file ASTWriterStmt.cpp.

References S.

Definition at line 747 of file ASTWriter.h.

Definition at line 750 of file ASTWriter.h.

Determine the type ID of an already-emitted type.

Definition at line 5011 of file ASTWriter.cpp.

References getTypeIdx(), and clang::serialization::MakeTypeID().

Determine the type index of an already-emitted type.

Definition at line 5037 of file ASTWriter.cpp.

References clang::QualType::getLocalFastQualifiers(), and clang::QualType::isNull().

Referenced by getTypeID().

bool clang::ASTWriter::hasChain ( ) const [inline]

Definition at line 768 of file ASTWriter.h.

void ASTWriter::IdentifierRead ( serialization::IdentID  ID,
IdentifierInfo II 
) [override, virtual]

An identifier was deserialized from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5684 of file ASTWriter.cpp.

bool clang::ASTWriter::isRewritten ( const Decl D) const [inline]

Definition at line 699 of file ASTWriter.h.

A macro definition was read from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5716 of file ASTWriter.cpp.

void ASTWriter::MacroRead ( serialization::MacroID  ID,
MacroInfo MI 
) [override, virtual]

A macro was read from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5691 of file ASTWriter.cpp.

void ASTWriter::ModuleRead ( serialization::SubmoduleID  ID,
Module Mod 
) [override, virtual]

A module definition was read from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5722 of file ASTWriter.cpp.

void ASTWriter::ReaderInitialized ( ASTReader Reader) [override, virtual]

Record an ID for the given switch-case statement.

Definition at line 2036 of file ASTWriterStmt.cpp.

References S.

void ASTWriter::ResolvedExceptionSpec ( const FunctionDecl FD) [override, virtual]

A function's exception specification has been evaluated or instantiated.

Reimplemented from clang::ASTMutationListener.

Definition at line 5807 of file ASTWriter.cpp.

References clang::FunctionDecl::getCanonicalDecl(), clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_RESOLVED_EXCEPTION_SPEC.

void clang::ASTWriter::RewriteDecl ( const Decl D) [inline]

Definition at line 695 of file ASTWriter.h.

Referenced by AddedObjCPropertyInClassExtension().

void ASTWriter::SelectorRead ( serialization::SelectorID  iD,
Selector  Sel 
) [override, virtual]

A selector was read from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5709 of file ASTWriter.cpp.

References S.

void ASTWriter::SetIdentifierOffset ( const IdentifierInfo II,
uint32_t  Offset 
)

Note that the identifier II occurs at the given offset within the identifier table.

Definition at line 4088 of file ASTWriter.cpp.

void ASTWriter::SetSelectorOffset ( Selector  Sel,
uint32_t  Offset 
)

Note that the selector Sel occurs at the given offset within the method pool/selector table.

Definition at line 4098 of file ASTWriter.cpp.

void ASTWriter::StaticDataMemberInstantiated ( const VarDecl D) [override, virtual]
void ASTWriter::TypeRead ( serialization::TypeIdx  Idx,
QualType  T 
) [override, virtual]

A type was deserialized from the AST file. The ID here has the qualifier bits already removed, and T is guaranteed to be locally unqualified.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5698 of file ASTWriter.cpp.

References clang::serialization::TypeIdx::getIndex().

void ASTWriter::WriteAST ( Sema SemaRef,
const std::string &  OutputFile,
Module WritingModule,
StringRef  isysroot,
bool  hasErrors = false 
)

Write a precompiled header for the given semantic analysis.

Parameters:
SemaRefa reference to the semantic analysis object that processed the AST to be written into the precompiled header.
WritingModuleThe module that we are writing. If null, we are writing a precompiled header.
isysrootif non-empty, write a relocatable file whose headers are relative to the given system root.

Definition at line 4134 of file ASTWriter.cpp.

References clang::Sema::Context, and clang::Sema::PP.

Referenced by clang::PCHGenerator::HandleTranslationUnit(), and serializeUnit().


Friends And Related Function Documentation

friend class ASTDeclWriter [friend]

Definition at line 84 of file ASTWriter.h.

friend class ASTStmtWriter [friend]

Definition at line 85 of file ASTWriter.h.


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