clang  3.7.0
Classes | Public Types | Public Member Functions | Friends | List of all members
clang::ASTWriter Class Reference

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

#include <ASTWriter.h>

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

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. More...
 
 ~ASTWriter () override
 
const LangOptionsgetLangOpts () const
 
void WriteAST (Sema &SemaRef, const std::string &OutputFile, Module *WritingModule, StringRef isysroot, bool hasErrors=false)
 Write a precompiled header for the given semantic analysis. More...
 
void AddToken (const Token &Tok, RecordDataImpl &Record)
 Emit a token. More...
 
void AddSourceLocation (SourceLocation Loc, RecordDataImpl &Record)
 Emit a source location. More...
 
void AddSourceRange (SourceRange Range, RecordDataImpl &Record)
 Emit a source range. More...
 
void AddAPInt (const llvm::APInt &Value, RecordDataImpl &Record)
 Emit an integral value. More...
 
void AddAPSInt (const llvm::APSInt &Value, RecordDataImpl &Record)
 Emit a signed integral value. More...
 
void AddAPFloat (const llvm::APFloat &Value, RecordDataImpl &Record)
 Emit a floating-point value. More...
 
void AddIdentifierRef (const IdentifierInfo *II, RecordDataImpl &Record)
 Emit a reference to an identifier. More...
 
void AddSelectorRef (Selector, RecordDataImpl &Record)
 Emit a Selector (which is a smart pointer reference). More...
 
void AddCXXTemporary (const CXXTemporary *Temp, RecordDataImpl &Record)
 Emit a CXXTemporary. More...
 
void AddCXXBaseSpecifiersRef (CXXBaseSpecifier const *Bases, CXXBaseSpecifier const *BasesEnd, RecordDataImpl &Record)
 Emit a set of C++ base specifiers to the record. More...
 
serialization::SelectorID getSelectorRef (Selector Sel)
 Get the unique number used to refer to the given selector. More...
 
serialization::IdentID getIdentifierRef (const IdentifierInfo *II)
 Get the unique number used to refer to the given identifier. More...
 
serialization::MacroID getMacroRef (MacroInfo *MI, const IdentifierInfo *Name)
 Get the unique number used to refer to the given macro. More...
 
serialization::MacroID getMacroID (MacroInfo *MI)
 Determine the ID of an already-emitted macro. More...
 
uint64_t getMacroDirectivesOffset (const IdentifierInfo *Name)
 
void AddTypeRef (QualType T, RecordDataImpl &Record)
 Emit a reference to a type. More...
 
serialization::TypeID GetOrCreateTypeID (QualType T)
 Force a type to be emitted and get its ID. More...
 
serialization::TypeID getTypeID (QualType T) const
 Determine the type ID of an already-emitted type. More...
 
void AddTypeSourceInfo (TypeSourceInfo *TInfo, RecordDataImpl &Record)
 Emits a reference to a declarator info. More...
 
void AddTypeLoc (TypeLoc TL, RecordDataImpl &Record)
 Emits a type with source-location information. More...
 
void AddTemplateArgumentLocInfo (TemplateArgument::ArgKind Kind, const TemplateArgumentLocInfo &Arg, RecordDataImpl &Record)
 Emits a template argument location info. More...
 
void AddTemplateArgumentLoc (const TemplateArgumentLoc &Arg, RecordDataImpl &Record)
 Emits a template argument location. More...
 
void AddASTTemplateArgumentListInfo (const ASTTemplateArgumentListInfo *ASTTemplArgList, RecordDataImpl &Record)
 Emits an AST template argument list info. More...
 
void AddDeclRef (const Decl *D, RecordDataImpl &Record)
 Emit a reference to a declaration. More...
 
serialization::DeclID GetDeclRef (const Decl *D)
 Force a declaration to be emitted and get its ID. More...
 
serialization::DeclID getDeclID (const Decl *D)
 Determine the declaration ID of an already-emitted declaration. More...
 
void AddDeclarationName (DeclarationName Name, RecordDataImpl &Record)
 Emit a declaration name. More...
 
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. More...
 
void AddNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS, RecordDataImpl &Record)
 Emit a nested name specifier with source-location information. More...
 
void AddTemplateName (TemplateName Name, RecordDataImpl &Record)
 Emit a template name. More...
 
void AddTemplateArgument (const TemplateArgument &Arg, RecordDataImpl &Record)
 Emit a template argument. More...
 
void AddTemplateParameterList (const TemplateParameterList *TemplateParams, RecordDataImpl &Record)
 Emit a template parameter list. More...
 
void AddTemplateArgumentList (const TemplateArgumentList *TemplateArgs, RecordDataImpl &Record)
 Emit a template argument list. More...
 
void AddUnresolvedSet (const ASTUnresolvedSet &Set, RecordDataImpl &Record)
 Emit a UnresolvedSet structure. More...
 
void AddCXXBaseSpecifier (const CXXBaseSpecifier &Base, RecordDataImpl &Record)
 Emit a C++ base specifier. More...
 
void AddCXXCtorInitializersRef (ArrayRef< CXXCtorInitializer * > Inits, RecordDataImpl &Record)
 Emit the ID for a CXXCtorInitializer array and register the array for later serialization. More...
 
void AddCXXCtorInitializers (const CXXCtorInitializer *const *CtorInitializers, unsigned NumCtorInitializers, RecordDataImpl &Record)
 Emit a CXXCtorInitializer array. More...
 
void AddCXXDefinitionData (const CXXRecordDecl *D, RecordDataImpl &Record)
 
void AddString (StringRef Str, RecordDataImpl &Record)
 Add a string to the given record. More...
 
bool PreparePathForOutput (SmallVectorImpl< char > &Path)
 Convert a path from this build process into one that is appropriate for emission in the module file. More...
 
void AddPath (StringRef Path, RecordDataImpl &Record)
 Add a path to the given record. More...
 
void EmitRecordWithPath (unsigned Abbrev, RecordDataImpl &Record, StringRef Path)
 Emit the current record with the given path as a blob. More...
 
void AddVersionTuple (const VersionTuple &Version, RecordDataImpl &Record)
 Add a version tuple to the given record. More...
 
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. More...
 
unsigned getExistingSubmoduleID (Module *Mod) const
 Retrieve a submodule ID for this module. Returns 0 If no ID has been associated with the module. More...
 
void SetIdentifierOffset (const IdentifierInfo *II, uint32_t Offset)
 Note that the identifier II occurs at the given offset within the identifier table. More...
 
void SetSelectorOffset (Selector Sel, uint32_t Offset)
 Note that the selector Sel occurs at the given offset within the method pool/selector table. More...
 
void AddStmt (Stmt *S)
 Add the given statement or expression to the queue of statements to emit. More...
 
void FlushStmts ()
 Flush all of the statements and expressions that have been added to the queue via AddStmt(). More...
 
void FlushCXXBaseSpecifiers ()
 Flush all of the C++ base specifier sets that have been added via AddCXXBaseSpecifiersRef(). More...
 
void FlushCXXCtorInitializers ()
 Flush all of the C++ constructor initializer lists that have been added via AddCXXCtorInitializersRef(). More...
 
void FlushPendingAfterDecl ()
 Flush all pending records that are tacked onto the end of decl and decl update records. More...
 
unsigned RecordSwitchCaseID (SwitchCase *S)
 Record an ID for the given switch-case statement. More...
 
unsigned getSwitchCaseID (SwitchCase *S)
 Retrieve the ID for the given switch-case statement. More...
 
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. More...
 
void IdentifierRead (serialization::IdentID ID, IdentifierInfo *II) override
 An identifier was deserialized from the AST file. More...
 
void MacroRead (serialization::MacroID ID, MacroInfo *MI) override
 A macro was read from the AST file. More...
 
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. More...
 
void SelectorRead (serialization::SelectorID ID, Selector Sel) override
 A selector was read from the AST file. More...
 
void MacroDefinitionRead (serialization::PreprocessedEntityID ID, MacroDefinitionRecord *MD) override
 A macro definition was read from the AST file. More...
 
void ModuleRead (serialization::SubmoduleID ID, Module *Mod) override
 A module definition was read from the AST file. More...
 
void CompletedTagDefinition (const TagDecl *D) override
 A new TagDecl definition was completed. More...
 
void AddedVisibleDecl (const DeclContext *DC, const Decl *D) override
 A new declaration with name has been added to a DeclContext. More...
 
void AddedCXXImplicitMember (const CXXRecordDecl *RD, const Decl *D) override
 An implicit member was added after the definition was completed. More...
 
void AddedCXXTemplateSpecialization (const ClassTemplateDecl *TD, const ClassTemplateSpecializationDecl *D) override
 A template specialization (or partial one) was added to the template declaration. More...
 
void AddedCXXTemplateSpecialization (const VarTemplateDecl *TD, const VarTemplateSpecializationDecl *D) override
 A template specialization (or partial one) was added to the template declaration. More...
 
void AddedCXXTemplateSpecialization (const FunctionTemplateDecl *TD, const FunctionDecl *D) override
 A template specialization (or partial one) was added to the template declaration. More...
 
void ResolvedExceptionSpec (const FunctionDecl *FD) override
 A function's exception specification has been evaluated or instantiated. More...
 
void DeducedReturnType (const FunctionDecl *FD, QualType ReturnType) override
 A function's return type has been deduced. More...
 
void ResolvedOperatorDelete (const CXXDestructorDecl *DD, const FunctionDecl *Delete) override
 A virtual destructor's operator delete has been resolved. More...
 
void CompletedImplicitDefinition (const FunctionDecl *D) override
 An implicit member got a definition. More...
 
void StaticDataMemberInstantiated (const VarDecl *D) override
 A static data member was implicitly instantiated. More...
 
void FunctionDefinitionInstantiated (const FunctionDecl *D) override
 A function template's definition was instantiated. More...
 
void AddedObjCCategoryToInterface (const ObjCCategoryDecl *CatD, const ObjCInterfaceDecl *IFD) override
 A new objc category class was added for an interface. More...
 
void AddedObjCPropertyInClassExtension (const ObjCPropertyDecl *Prop, const ObjCPropertyDecl *OrigProp, const ObjCCategoryDecl *ClassExt) override
 A objc class extension redeclared or introduced a property. More...
 
void DeclarationMarkedUsed (const Decl *D) override
 A declaration is marked used which was not previously marked used. More...
 
void DeclarationMarkedOpenMPThreadPrivate (const Decl *D) override
 A declaration is marked as OpenMP threadprivate which was not previously marked as threadprivate. More...
 
void RedefinedHiddenDefinition (const NamedDecl *D, Module *M) override
 A definition has been made visible by being redefined locally. More...
 
void AddedAttributeToRecord (const Attr *Attr, const RecordDecl *Record) override
 An attribute was added to a RecordDecl. More...
 
- Public Member Functions inherited from clang::ASTDeserializationListener
virtual ~ASTDeserializationListener ()
 
virtual void DeclRead (serialization::DeclID ID, const Decl *D)
 A decl was deserialized from the AST file. More...
 
- Public Member Functions inherited from clang::ASTMutationListener
virtual ~ASTMutationListener ()
 

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 82 of file ASTWriter.h.

Member Typedef Documentation

Definition at line 85 of file ASTWriter.h.

Definition at line 86 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 4031 of file ASTWriter.cpp.

ASTWriter::~ASTWriter ( )
override

Definition at line 4054 of file ASTWriter.cpp.

Member Function Documentation

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

Emit a floating-point value.

Definition at line 4752 of file ASTWriter.cpp.

References AddAPInt().

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

Emit an integral value.

Definition at line 4741 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 4747 of file ASTWriter.cpp.

References AddAPInt().

Referenced by AddTemplateArgument().

void ASTWriter::AddASTTemplateArgumentListInfo ( const ASTTemplateArgumentListInfo ASTTemplArgList,
RecordDataImpl Record 
)
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 4833 of file ASTWriter.cpp.

Referenced by AddCXXDefinitionData().

void ASTWriter::AddCXXCtorInitializers ( const CXXCtorInitializer *const *  CtorInitializers,
unsigned  NumCtorInitializers,
RecordDataImpl Record 
)
void ASTWriter::AddCXXCtorInitializersRef ( ArrayRef< CXXCtorInitializer * >  Inits,
RecordDataImpl Record 
)

Emit the ID for a CXXCtorInitializer array and register the array for later serialization.

Definition at line 4825 of file ASTWriter.cpp.

void ASTWriter::AddCXXDefinitionData ( const CXXRecordDecl D,
RecordDataImpl Record 
)
void ASTWriter::AddCXXTemporary ( const CXXTemporary Temp,
RecordDataImpl Record 
)

Emit a CXXTemporary.

Definition at line 4821 of file ASTWriter.cpp.

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

void ASTWriter::AddDeclarationName ( DeclarationName  Name,
RecordDataImpl Record 
)
void ASTWriter::AddDeclarationNameInfo ( const DeclarationNameInfo NameInfo,
RecordDataImpl Record 
)
void ASTWriter::AddDeclarationNameLoc ( const DeclarationNameLoc DNLoc,
DeclarationName  Name,
RecordDataImpl Record 
)
void ASTWriter::AddDeclRef ( const Decl D,
RecordDataImpl Record 
)
void ASTWriter::AddedAttributeToRecord ( const Attr Attr,
const RecordDecl Record 
)
overridevirtual

An attribute was added to a RecordDecl.

Parameters
AttrThe attribute that was added to the Record
RecordThe RecordDecl that got a new attribute

Reimplemented from clang::ASTMutationListener.

Definition at line 5847 of file ASTWriter.cpp.

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

void ASTWriter::AddedCXXImplicitMember ( const CXXRecordDecl RD,
const Decl D 
)
overridevirtual

An implicit member was added after the definition was completed.

Reimplemented from clang::ASTMutationListener.

Definition at line 5688 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 
)
overridevirtual

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

Reimplemented from clang::ASTMutationListener.

Definition at line 5701 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 
)
overridevirtual

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

Reimplemented from clang::ASTMutationListener.

Definition at line 5713 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 
)
overridevirtual

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

Reimplemented from clang::ASTMutationListener.

Definition at line 5725 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 
)
overridevirtual

A new objc category class was added for an interface.

Reimplemented from clang::ASTMutationListener.

Definition at line 5799 of file ASTWriter.cpp.

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

void ASTWriter::AddedObjCPropertyInClassExtension ( const ObjCPropertyDecl Prop,
const ObjCPropertyDecl OrigProp,
const ObjCCategoryDecl ClassExt 
)
overridevirtual

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

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

void ASTWriter::AddedVisibleDecl ( const DeclContext DC,
const Decl D 
)
overridevirtual

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

Reimplemented from clang::ASTMutationListener.

Definition at line 5674 of file ASTWriter.cpp.

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

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

Emit a reference to an identifier.

Definition at line 4756 of file ASTWriter.cpp.

References getIdentifierRef().

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

void ASTWriter::AddNestedNameSpecifier ( NestedNameSpecifier NNS,
RecordDataImpl Record 
)
void ASTWriter::AddNestedNameSpecifierLoc ( NestedNameSpecifierLoc  NNS,
RecordDataImpl Record 
)
void ASTWriter::AddPath ( StringRef  Path,
RecordDataImpl Record 
)

Add a path to the given record.

Definition at line 3983 of file ASTWriter.cpp.

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

References getSelectorRef().

Referenced by AddDeclarationName().

void ASTWriter::AddSourceLocation ( SourceLocation  Loc,
RecordDataImpl Record 
)
void ASTWriter::AddSourceRange ( SourceRange  Range,
RecordDataImpl Record 
)

Emit a source range.

Definition at line 4736 of file ASTWriter.cpp.

References AddSourceLocation(), clang::SourceRange::getBegin(), and clang::SourceRange::getEnd().

Referenced by AddCXXBaseSpecifier(), and AddNestedNameSpecifierLoc().

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 779 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 3960 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 5350 of file ASTWriter.cpp.

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

void ASTWriter::AddTemplateArgumentLoc ( const TemplateArgumentLoc Arg,
RecordDataImpl Record 
)
void ASTWriter::AddTemplateArgumentLocInfo ( TemplateArgument::ArgKind  Kind,
const TemplateArgumentLocInfo Arg,
RecordDataImpl Record 
)
void ASTWriter::AddTemplateName ( TemplateName  Name,
RecordDataImpl Record 
)
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 4897 of file ASTWriter.cpp.

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

Referenced by AddNestedNameSpecifierLoc(), and AddTypeSourceInfo().

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

Emit a reference to a type.

Definition at line 4905 of file ASTWriter.cpp.

References GetOrCreateTypeID().

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

void ASTWriter::AddTypeSourceInfo ( TypeSourceInfo TInfo,
RecordDataImpl Record 
)
void ASTWriter::AddUnresolvedSet ( const ASTUnresolvedSet Set,
RecordDataImpl Record 
)
void ASTWriter::AddVersionTuple ( const VersionTuple Version,
RecordDataImpl Record 
)

Add a version tuple to the given record.

Definition at line 3996 of file ASTWriter.cpp.

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

void ASTWriter::ClearSwitchCaseIDs ( )

Definition at line 2146 of file ASTWriterStmt.cpp.

void ASTWriter::CompletedImplicitDefinition ( const FunctionDecl D)
overridevirtual

An implicit member got a definition.

Reimplemented from clang::ASTMutationListener.

Definition at line 5770 of file ASTWriter.cpp.

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

void ASTWriter::CompletedTagDefinition ( const TagDecl D)
overridevirtual
void ASTWriter::DeclarationMarkedOpenMPThreadPrivate ( const Decl D)
overridevirtual

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

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

void ASTWriter::DeclarationMarkedUsed ( const Decl D)
overridevirtual

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

Parameters
Dthe declaration marked used

Reimplemented from clang::ASTMutationListener.

Definition at line 5825 of file ASTWriter.cpp.

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

void ASTWriter::DeducedReturnType ( const FunctionDecl FD,
QualType  ReturnType 
)
overridevirtual

A function's return type has been deduced.

Reimplemented from clang::ASTMutationListener.

Definition at line 5751 of file ASTWriter.cpp.

References clang::serialization::UPD_CXX_DEDUCED_RETURN_TYPE.

void ASTWriter::EmitRecordWithPath ( unsigned  Abbrev,
RecordDataImpl Record,
StringRef  Path 
)

Emit the current record with the given path as a blob.

Definition at line 3989 of file ASTWriter.cpp.

void ASTWriter::FlushCXXBaseSpecifiers ( )

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

Definition at line 5393 of file ASTWriter.cpp.

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

Referenced by FlushPendingAfterDecl().

void ASTWriter::FlushCXXCtorInitializers ( )

Flush all of the C++ constructor initializer lists that have been added via AddCXXCtorInitializersRef().

Definition at line 5463 of file ASTWriter.cpp.

References AddCXXCtorInitializers(), clang::serialization::DECL_CXX_CTOR_INITIALIZERS, and FlushStmts().

Referenced by FlushPendingAfterDecl().

void clang::ASTWriter::FlushPendingAfterDecl ( )
inline

Flush all pending records that are tacked onto the end of decl and decl update records.

Definition at line 797 of file ASTWriter.h.

References FlushCXXBaseSpecifiers(), FlushCXXCtorInitializers(), and FlushStmts().

void ASTWriter::FlushStmts ( )

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 2224 of file ASTWriterStmt.cpp.

References clang::serialization::STMT_STOP.

Referenced by FlushCXXBaseSpecifiers(), FlushCXXCtorInitializers(), and FlushPendingAfterDecl().

void ASTWriter::FunctionDefinitionInstantiated ( const FunctionDecl D)
overridevirtual

A function template's definition was instantiated.

Reimplemented from clang::ASTMutationListener.

Definition at line 5779 of file ASTWriter.cpp.

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

unsigned ASTWriter::getAnonymousDeclarationNumber ( const NamedDecl D)
unsigned clang::ASTWriter::getCharacterLiteralAbbrev ( ) const
inline

Definition at line 828 of file ASTWriter.h.

unsigned clang::ASTWriter::getDeclCXXMethodAbbrev ( ) const
inline

Definition at line 825 of file ASTWriter.h.

unsigned clang::ASTWriter::getDeclEnumAbbrev ( ) const
inline

Definition at line 823 of file ASTWriter.h.

unsigned clang::ASTWriter::getDeclFieldAbbrev ( ) const
inline

Definition at line 822 of file ASTWriter.h.

DeclID ASTWriter::getDeclID ( const Decl D)

Determine the declaration ID of an already-emitted declaration.

Definition at line 4978 of file ASTWriter.cpp.

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

unsigned clang::ASTWriter::getDeclObjCIvarAbbrev ( ) const
inline

Definition at line 824 of file ASTWriter.h.

unsigned clang::ASTWriter::getDeclParmVarAbbrev ( ) const
inline

Definition at line 818 of file ASTWriter.h.

unsigned clang::ASTWriter::getDeclRecordAbbrev ( ) const
inline

Definition at line 819 of file ASTWriter.h.

DeclID ASTWriter::GetDeclRef ( const Decl D)

Force a declaration to be emitted and get its ID.

Definition at line 4949 of file ASTWriter.cpp.

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

Referenced by AddDeclRef().

unsigned clang::ASTWriter::getDeclRefExprAbbrev ( ) const
inline

Definition at line 827 of file ASTWriter.h.

unsigned clang::ASTWriter::getDeclTypedefAbbrev ( ) const
inline

Definition at line 820 of file ASTWriter.h.

unsigned clang::ASTWriter::getDeclVarAbbrev ( ) const
inline

Definition at line 821 of file ASTWriter.h.

unsigned ASTWriter::getExistingSubmoduleID ( Module Mod) const

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

Definition at line 2302 of file ASTWriter.cpp.

unsigned clang::ASTWriter::getExprImplicitCastAbbrev ( ) const
inline

Definition at line 830 of file ASTWriter.h.

IdentID ASTWriter::getIdentifierRef ( const IdentifierInfo II)

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

Definition at line 4760 of file ASTWriter.cpp.

Referenced by AddIdentifierRef().

unsigned clang::ASTWriter::getIntegerLiteralAbbrev ( ) const
inline

Definition at line 829 of file ASTWriter.h.

const LangOptions & ASTWriter::getLangOpts ( ) const

Definition at line 4058 of file ASTWriter.cpp.

References clang::ASTContext::getLangOpts().

uint64_t ASTWriter::getMacroDirectivesOffset ( const IdentifierInfo Name)

Definition at line 4794 of file ASTWriter.cpp.

MacroID ASTWriter::getMacroID ( MacroInfo MI)

Determine the ID of an already-emitted macro.

Definition at line 4786 of file ASTWriter.cpp.

References clang::MacroInfo::isBuiltinMacro().

MacroID ASTWriter::getMacroRef ( MacroInfo MI,
const IdentifierInfo Name 
)

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

Definition at line 4770 of file ASTWriter.cpp.

References clang::MacroInfo::isBuiltinMacro().

TypeID ASTWriter::GetOrCreateTypeID ( QualType  T)

Force a type to be emitted and get its ID.

Definition at line 4909 of file ASTWriter.cpp.

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

Referenced by AddTypeRef().

SelectorID ASTWriter::getSelectorRef ( Selector  Sel)

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

Definition at line 4802 of file ASTWriter.cpp.

References clang::Selector::getAsOpaquePtr().

Referenced by AddSelectorRef().

unsigned ASTWriter::getSwitchCaseID ( SwitchCase S)

Retrieve the ID for the given switch-case statement.

Definition at line 2140 of file ASTWriterStmt.cpp.

References S.

unsigned clang::ASTWriter::getTypeExtQualAbbrev ( ) const
inline

Definition at line 811 of file ASTWriter.h.

unsigned clang::ASTWriter::getTypeFunctionProtoAbbrev ( ) const
inline

Definition at line 814 of file ASTWriter.h.

TypeID ASTWriter::getTypeID ( QualType  T) const

Determine the type ID of an already-emitted type.

Definition at line 4932 of file ASTWriter.cpp.

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

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

Definition at line 832 of file ASTWriter.h.

void ASTWriter::IdentifierRead ( serialization::IdentID  ID,
IdentifierInfo II 
)
overridevirtual

An identifier was deserialized from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5614 of file ASTWriter.cpp.

serialization::SubmoduleID ASTWriter::inferSubmoduleIDFromLocation ( SourceLocation  Loc)
bool clang::ASTWriter::isRewritten ( const Decl D) const
inline

Definition at line 751 of file ASTWriter.h.

void ASTWriter::MacroDefinitionRead ( serialization::PreprocessedEntityID  ,
MacroDefinitionRecord MD 
)
overridevirtual

A macro definition was read from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5646 of file ASTWriter.cpp.

void ASTWriter::MacroRead ( serialization::MacroID  ID,
MacroInfo MI 
)
overridevirtual

A macro was read from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5621 of file ASTWriter.cpp.

void ASTWriter::ModuleRead ( serialization::SubmoduleID  ID,
Module Mod 
)
overridevirtual

A module definition was read from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5652 of file ASTWriter.cpp.

bool ASTWriter::PreparePathForOutput ( SmallVectorImpl< char > &  Path)

Convert a path from this build process into one that is appropriate for emission in the module file.

Definition at line 3965 of file ASTWriter.cpp.

References adjustFilenameForRelocatableAST(), cleanPathForOutput(), clang::SourceManager::getFileManager(), and clang::ASTContext::getSourceManager().

void ASTWriter::ReaderInitialized ( ASTReader Reader)
overridevirtual
unsigned ASTWriter::RecordSwitchCaseID ( SwitchCase S)

Record an ID for the given switch-case statement.

Definition at line 2132 of file ASTWriterStmt.cpp.

References S.

void ASTWriter::RedefinedHiddenDefinition ( const NamedDecl D,
Module M 
)
overridevirtual

A definition has been made visible by being redefined locally.

Parameters
DThe definition that was previously not visible.
MThe containing module in which the definition was made visible, if any.

Reimplemented from clang::ASTMutationListener.

Definition at line 5841 of file ASTWriter.cpp.

References clang::NamedDecl::isHidden(), and clang::serialization::UPD_DECL_EXPORTED.

void ASTWriter::ResolvedExceptionSpec ( const FunctionDecl FD)
overridevirtual

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

Reimplemented from clang::ASTMutationListener.

Definition at line 5737 of file ASTWriter.cpp.

References clang::isUnresolvedExceptionSpec(), and clang::serialization::UPD_CXX_RESOLVED_EXCEPTION_SPEC.

void ASTWriter::ResolvedOperatorDelete ( const CXXDestructorDecl DD,
const FunctionDecl Delete 
)
overridevirtual

A virtual destructor's operator delete has been resolved.

Reimplemented from clang::ASTMutationListener.

Definition at line 5760 of file ASTWriter.cpp.

References clang::serialization::UPD_CXX_RESOLVED_DTOR_DELETE.

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

Definition at line 747 of file ASTWriter.h.

Referenced by AddedObjCPropertyInClassExtension().

void ASTWriter::SelectorRead ( serialization::SelectorID  iD,
Selector  Sel 
)
overridevirtual

A selector was read from the AST file.

Reimplemented from clang::ASTDeserializationListener.

Definition at line 5639 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 4011 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 4021 of file ASTWriter.cpp.

void ASTWriter::StaticDataMemberInstantiated ( const VarDecl D)
overridevirtual
void ASTWriter::TypeRead ( serialization::TypeIdx  Idx,
QualType  T 
)
overridevirtual

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 5628 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. If we're writing a module, its build directory will be used in preference to this if both are available.

Definition at line 4063 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 88 of file ASTWriter.h.

friend class ASTStmtWriter
friend

Definition at line 89 of file ASTWriter.h.


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