clang API Documentation
Writes an AST file containing the contents of a translation unit. More...
#include <ASTWriter.h>


Classes | |
| struct | DeclIDInFileInfo |
| class | DeclOrType |
| Stores a declaration or a type to be written to the AST file. | |
| 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, MemorizeStatCalls *StatCalls, const std::string &OutputFile, Module *WritingModule, StringRef isysroot, bool hasErrors=false) |
| Write a precompiled header for the given semantic analysis. | |
| 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. | |
| uint64_t | getMacroOffset (const IdentifierInfo *II) |
| Retrieve the offset of the macro definition for the given identifier. | |
| 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 | 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) |
| 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 UnresolvedSetImpl &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. | |
| 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 | getDeclParmVarAbbrev () const |
| unsigned | getDeclRefExprAbbrev () const |
| unsigned | getCharacterLiteralAbbrev () const |
| unsigned | getDeclRecordAbbrev () const |
| unsigned | getIntegerLiteralAbbrev () const |
| unsigned | getDeclTypedefAbbrev () const |
| unsigned | getDeclVarAbbrev () const |
| unsigned | getDeclFieldAbbrev () const |
| unsigned | getDeclEnumAbbrev () const |
| unsigned | getDeclObjCIvarAbbrev () const |
| bool | hasChain () const |
| void | ReaderInitialized (ASTReader *Reader) |
| The ASTReader was initialized. | |
| void | IdentifierRead (serialization::IdentID ID, IdentifierInfo *II) |
| An identifier was deserialized from the AST file. | |
| void | TypeRead (serialization::TypeIdx Idx, QualType T) |
| 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) |
| A selector was read from the AST file. | |
| void | MacroDefinitionRead (serialization::PreprocessedEntityID ID, MacroDefinition *MD) |
| A macro definition was read from the AST file. | |
| void | MacroVisible (IdentifierInfo *II) |
| A macro definition that had previously been deserialized (and removed via IdentifierRead) has now been made visible. | |
| void | ModuleRead (serialization::SubmoduleID ID, Module *Mod) |
| A module definition was read from the AST file. | |
| virtual void | CompletedTagDefinition (const TagDecl *D) |
| A new TagDecl definition was completed. | |
| virtual void | AddedVisibleDecl (const DeclContext *DC, const Decl *D) |
| A new declaration with name has been added to a DeclContext. | |
| virtual void | AddedCXXImplicitMember (const CXXRecordDecl *RD, const Decl *D) |
| An implicit member was added after the definition was completed. | |
| virtual void | AddedCXXTemplateSpecialization (const ClassTemplateDecl *TD, const ClassTemplateSpecializationDecl *D) |
| A template specialization (or partial one) was added to the template declaration. | |
| virtual void | AddedCXXTemplateSpecialization (const FunctionTemplateDecl *TD, const FunctionDecl *D) |
| A template specialization (or partial one) was added to the template declaration. | |
| virtual void | CompletedImplicitDefinition (const FunctionDecl *D) |
| An implicit member got a definition. | |
| virtual void | StaticDataMemberInstantiated (const VarDecl *D) |
| A static data member was implicitly instantiated. | |
| virtual void | AddedObjCCategoryToInterface (const ObjCCategoryDecl *CatD, const ObjCInterfaceDecl *IFD) |
| A new objc category class was added for an interface. | |
| virtual void | AddedObjCPropertyInClassExtension (const ObjCPropertyDecl *Prop, const ObjCPropertyDecl *OrigProp, const ObjCCategoryDecl *ClassExt) |
| A objc class extension redeclared or introduced a property. | |
Friends | |
| class | ASTDeclWriter |
| class | ASTStmtWriter |
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 72 of file ASTWriter.h.
| typedef SmallVector<uint64_t, 64> clang::ASTWriter::RecordData |
Definition at line 75 of file ASTWriter.h.
| typedef SmallVectorImpl<uint64_t> clang::ASTWriter::RecordDataImpl |
Definition at line 76 of file ASTWriter.h.
| ASTWriter::ASTWriter | ( | llvm::BitstreamWriter & | Stream | ) |
Create a new precompiled header writer that outputs to the given bitstream.
Definition at line 3122 of file ASTWriter.cpp.
| ASTWriter::~ASTWriter | ( | ) |
Definition at line 3145 of file ASTWriter.cpp.
| void ASTWriter::AddAPFloat | ( | const llvm::APFloat & | Value, |
| RecordDataImpl & | Record | ||
| ) |
| void ASTWriter::AddAPInt | ( | const llvm::APInt & | Value, |
| RecordDataImpl & | Record | ||
| ) |
Emit an integral value.
Definition at line 3656 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 3662 of file ASTWriter.cpp.
References AddAPInt().
Referenced by AddTemplateArgument().
| void ASTWriter::AddCXXBaseSpecifier | ( | const CXXBaseSpecifier & | Base, |
| RecordDataImpl & | Record | ||
| ) |
Emit a C++ base specifier.
Definition at line 4211 of file ASTWriter.cpp.
References AddSourceLocation(), AddSourceRange(), AddTypeSourceInfo(), 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 FlushCXXBaseSpecifiers().
| void ASTWriter::AddCXXBaseSpecifiersRef | ( | CXXBaseSpecifier const * | Bases, |
| CXXBaseSpecifier const * | BasesEnd, | ||
| RecordDataImpl & | Record | ||
| ) |
Emit a set of C++ base specifiers to the record.
Definition at line 3710 of file ASTWriter.cpp.
Referenced by AddCXXDefinitionData().
| void ASTWriter::AddCXXCtorInitializers | ( | const CXXCtorInitializer *const * | CtorInitializers, |
| unsigned | NumCtorInitializers, | ||
| RecordDataImpl & | Record | ||
| ) |
Emit a CXXCtorInitializer array.
Definition at line 4253 of file ASTWriter.cpp.
References AddDeclRef(), AddSourceLocation(), AddStmt(), AddTypeSourceInfo(), clang::serialization::CTOR_INITIALIZER_BASE, clang::serialization::CTOR_INITIALIZER_DELEGATING, clang::serialization::CTOR_INITIALIZER_INDIRECT_MEMBER, clang::serialization::CTOR_INITIALIZER_MEMBER, clang::CXXCtorInitializer::getArrayIndex(), clang::CXXCtorInitializer::getIndirectMember(), clang::CXXCtorInitializer::getInit(), clang::CXXCtorInitializer::getLParenLoc(), clang::CXXCtorInitializer::getMember(), clang::CXXCtorInitializer::getMemberLocation(), clang::CXXCtorInitializer::getNumArrayIndices(), clang::CXXCtorInitializer::getRParenLoc(), clang::CXXCtorInitializer::getSourceOrder(), clang::CXXCtorInitializer::getTypeSourceInfo(), clang::CXXCtorInitializer::isBaseInitializer(), clang::CXXCtorInitializer::isBaseVirtual(), clang::CXXCtorInitializer::isDelegatingInitializer(), clang::CXXCtorInitializer::isMemberInitializer(), and clang::CXXCtorInitializer::isWritten().
| void ASTWriter::AddCXXDefinitionData | ( | const CXXRecordDecl * | D, |
| RecordDataImpl & | Record | ||
| ) |
Definition at line 4291 of file ASTWriter.cpp.
References AddCXXBaseSpecifiersRef(), AddDeclRef(), AddSourceLocation(), AddUnresolvedSet(), clang::LambdaExpr::Capture::capturesVariable(), clang::LambdaExpr::Capture::getCapturedVar(), clang::LambdaExpr::Capture::getCaptureKind(), clang::LambdaExpr::Capture::getEllipsisLoc(), clang::LambdaExpr::Capture::getLocation(), clang::LambdaExpr::Capture::isImplicit(), and clang::LambdaExpr::Capture::isPackExpansion().
| void ASTWriter::AddCXXTemporary | ( | const CXXTemporary * | Temp, |
| RecordDataImpl & | Record | ||
| ) |
Emit a CXXTemporary.
Definition at line 3706 of file ASTWriter.cpp.
References AddDeclRef(), and clang::CXXTemporary::getDestructor().
| void ASTWriter::AddDeclarationName | ( | DeclarationName | Name, |
| RecordDataImpl & | Record | ||
| ) |
Emit a declaration name.
Definition at line 3910 of file ASTWriter.cpp.
References AddIdentifierRef(), AddSelectorRef(), AddTypeRef(), clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationName::CXXUsingDirective, clang::DeclarationName::getAsIdentifierInfo(), clang::DeclarationName::getCXXLiteralIdentifier(), clang::DeclarationName::getCXXNameType(), clang::DeclarationName::getCXXOverloadedOperator(), clang::DeclarationName::getNameKind(), clang::DeclarationName::getObjCSelector(), clang::DeclarationName::Identifier, clang::DeclarationName::ObjCMultiArgSelector, clang::DeclarationName::ObjCOneArgSelector, and clang::DeclarationName::ObjCZeroArgSelector.
Referenced by AddDeclarationNameInfo().
| void ASTWriter::AddDeclarationNameInfo | ( | const DeclarationNameInfo & | NameInfo, |
| RecordDataImpl & | Record | ||
| ) |
Definition at line 3977 of file ASTWriter.cpp.
References AddDeclarationName(), AddDeclarationNameLoc(), AddSourceLocation(), clang::DeclarationNameInfo::getInfo(), clang::DeclarationNameInfo::getLoc(), and clang::DeclarationNameInfo::getName().
| void ASTWriter::AddDeclarationNameLoc | ( | const DeclarationNameLoc & | DNLoc, |
| DeclarationName | Name, | ||
| RecordDataImpl & | Record | ||
| ) |
Definition at line 3944 of file ASTWriter.cpp.
References AddSourceLocation(), AddTypeSourceInfo(), clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationNameLoc::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationNameLoc::CXXOperatorName, clang::DeclarationName::CXXUsingDirective, clang::SourceLocation::getFromRawEncoding(), clang::DeclarationName::getNameKind(), clang::DeclarationName::Identifier, clang::DeclarationNameLoc::NamedType, clang::DeclarationName::ObjCMultiArgSelector, clang::DeclarationName::ObjCOneArgSelector, and clang::DeclarationName::ObjCZeroArgSelector.
Referenced by AddDeclarationNameInfo().
| void ASTWriter::AddDeclRef | ( | const Decl * | D, |
| RecordDataImpl & | Record | ||
| ) |
Emit a reference to a declaration.
Definition at line 3819 of file ASTWriter.cpp.
References GetDeclRef().
Referenced by AddCXXCtorInitializers(), AddCXXDefinitionData(), AddCXXTemporary(), AddLazyVectorDecls(), AddNestedNameSpecifier(), AddNestedNameSpecifierLoc(), AddTemplateArgument(), AddTemplateName(), AddTemplateParameterList(), and AddUnresolvedSet().
| void ASTWriter::AddedCXXImplicitMember | ( | const CXXRecordDecl * | RD, |
| const Decl * | D | ||
| ) | [virtual] |
An implicit member was added after the definition was completed.
Reimplemented from clang::ASTMutationListener.
Definition at line 4465 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 | ||
| ) | [virtual] |
A template specialization (or partial one) was added to the template declaration.
Reimplemented from clang::ASTMutationListener.
Definition at line 4480 of file ASTWriter.cpp.
References clang::ClassTemplateDecl::getCanonicalDecl(), clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION.
| void ASTWriter::AddedCXXTemplateSpecialization | ( | const FunctionTemplateDecl * | TD, |
| const FunctionDecl * | D | ||
| ) | [virtual] |
A template specialization (or partial one) was added to the template declaration.
Reimplemented from clang::ASTMutationListener.
Definition at line 4493 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 | ||
| ) | [virtual] |
A new objc category class was added for an interface.
Reimplemented from clang::ASTMutationListener.
Definition at line 4529 of file ASTWriter.cpp.
References clang::ObjCInterfaceDecl::getDefinition(), and clang::Decl::isFromASTFile().
| void ASTWriter::AddedObjCPropertyInClassExtension | ( | const ObjCPropertyDecl * | Prop, |
| const ObjCPropertyDecl * | OrigProp, | ||
| const ObjCCategoryDecl * | ClassExt | ||
| ) | [virtual] |
A objc class extension redeclared or introduced a property.
| Prop | the property in the class extension |
| OrigProp | the property from the original interface that was declared or null if the property was introduced. |
| ClassExt | the class extension. |
Reimplemented from clang::ASTMutationListener.
Definition at line 4541 of file ASTWriter.cpp.
References clang::ObjCCategoryDecl::getClassInterface(), clang::Decl::isFromASTFile(), and RewriteDecl().
| void ASTWriter::AddedVisibleDecl | ( | const DeclContext * | DC, |
| const Decl * | D | ||
| ) | [virtual] |
A new declaration with name has been added to a DeclContext.
Reimplemented from clang::ASTMutationListener.
Definition at line 4452 of file ASTWriter.cpp.
References AddUpdatedDeclContext(), and clang::Decl::isFromASTFile().
| void ASTWriter::AddIdentifierRef | ( | const IdentifierInfo * | II, |
| RecordDataImpl & | Record | ||
| ) |
Emit a reference to an identifier.
Definition at line 3671 of file ASTWriter.cpp.
References getIdentifierRef().
Referenced by AddDeclarationName(), AddNestedNameSpecifier(), AddNestedNameSpecifierLoc(), and AddTemplateName().
| void ASTWriter::AddNestedNameSpecifier | ( | NestedNameSpecifier * | NNS, |
| RecordDataImpl & | Record | ||
| ) |
Emit a nested name specifier.
Definition at line 3992 of file ASTWriter.cpp.
References AddDeclRef(), AddIdentifierRef(), AddTypeRef(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
Referenced by AddTemplateName().
| void ASTWriter::AddNestedNameSpecifierLoc | ( | NestedNameSpecifierLoc | NNS, |
| RecordDataImpl & | Record | ||
| ) |
Emit a nested name specifier with source-location information.
Definition at line 4035 of file ASTWriter.cpp.
References AddDeclRef(), AddIdentifierRef(), AddSourceLocation(), AddSourceRange(), AddTypeLoc(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::SourceRange::getEnd(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifierLoc::getLocalSourceRange(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::NestedNameSpecifierLoc::getPrefix(), clang::NestedNameSpecifierLoc::getTypeLoc(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
Referenced by AddQualifierInfo(), and AddTemplateArgumentLocInfo().
| void ASTWriter::AddQualifierInfo | ( | const QualifierInfo & | Info, |
| RecordDataImpl & | Record | ||
| ) |
Definition at line 3984 of file ASTWriter.cpp.
References AddNestedNameSpecifierLoc(), AddTemplateParameterList(), clang::QualifierInfo::NumTemplParamLists, clang::QualifierInfo::QualifierLoc, and clang::QualifierInfo::TemplParamLists.
| void ASTWriter::AddSelectorRef | ( | Selector | SelRef, |
| RecordDataImpl & | Record | ||
| ) |
Emit a Selector (which is a smart pointer reference).
Definition at line 3685 of file ASTWriter.cpp.
References getSelectorRef().
Referenced by AddDeclarationName().
| void ASTWriter::AddSourceLocation | ( | SourceLocation | Loc, |
| RecordDataImpl & | Record | ||
| ) |
Emit a source location.
Definition at line 3647 of file ASTWriter.cpp.
References clang::SourceLocation::getRawEncoding().
Referenced by AddCXXBaseSpecifier(), AddCXXCtorInitializers(), AddCXXDefinitionData(), AddDeclarationNameInfo(), AddDeclarationNameLoc(), AddNestedNameSpecifierLoc(), AddSourceRange(), AddTemplateArgumentLocInfo(), clang::ASTStmtWriter::AddTemplateKWAndArgsInfo(), AddTemplateParameterList(), and StaticDataMemberInstantiated().
| void ASTWriter::AddSourceRange | ( | SourceRange | Range, |
| RecordDataImpl & | Record | ||
| ) |
Emit a source range.
Definition at line 3651 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 647 of file ASTWriter.h.
Referenced by AddCXXCtorInitializers(), AddTemplateArgument(), and AddTemplateArgumentLocInfo().
| void ASTWriter::AddString | ( | StringRef | Str, |
| RecordDataImpl & | Record | ||
| ) |
Add a string to the given record.
Definition at line 3082 of file ASTWriter.cpp.
| void ASTWriter::AddTemplateArgument | ( | const TemplateArgument & | Arg, |
| RecordDataImpl & | Record | ||
| ) |
Emit a template argument.
Definition at line 4138 of file ASTWriter.cpp.
References AddAPSInt(), AddDeclRef(), AddStmt(), AddTemplateName(), 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::getNumTemplateExpansions(), clang::TemplateArgument::Integral, clang::TemplateArgument::Null, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_end(), clang::TemplateArgument::pack_size(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
Referenced by AddTemplateArgumentList(), AddTemplateArgumentLoc(), and AddTemplateName().
| void ASTWriter::AddTemplateArgumentList | ( | const TemplateArgumentList * | TemplateArgs, |
| RecordDataImpl & | Record | ||
| ) |
Emit a template argument list.
Definition at line 4192 of file ASTWriter.cpp.
References AddTemplateArgument(), clang::TemplateArgumentList::get(), and clang::TemplateArgumentList::size().
| void ASTWriter::AddTemplateArgumentLoc | ( | const TemplateArgumentLoc & | Arg, |
| RecordDataImpl & | Record | ||
| ) |
Emits a template argument location.
Definition at line 3747 of file ASTWriter.cpp.
References AddTemplateArgument(), AddTemplateArgumentLocInfo(), 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 ASTWriter::AddTemplateArgumentLocInfo | ( | TemplateArgument::ArgKind | Kind, |
| const TemplateArgumentLocInfo & | Arg, | ||
| RecordDataImpl & | Record | ||
| ) |
Emits a template argument location info.
Definition at line 3720 of file ASTWriter.cpp.
References AddNestedNameSpecifierLoc(), AddSourceLocation(), AddStmt(), AddTypeSourceInfo(), 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::Pack, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
Referenced by AddTemplateArgumentLoc().
| void ASTWriter::AddTemplateName | ( | TemplateName | Name, |
| RecordDataImpl & | Record | ||
| ) |
Emit a template name.
Definition at line 4084 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, clang::UncommonTemplateNameStorage::size(), clang::TemplateName::SubstTemplateTemplateParm, clang::TemplateName::SubstTemplateTemplateParmPack, and clang::TemplateName::Template.
Referenced by AddTemplateArgument().
| void ASTWriter::AddTemplateParameterList | ( | const TemplateParameterList * | TemplateParams, |
| RecordDataImpl & | Record | ||
| ) |
Emit a template parameter list.
Definition at line 4177 of file ASTWriter.cpp.
References AddDeclRef(), AddSourceLocation(), clang::TemplateParameterList::begin(), clang::TemplateParameterList::end(), clang::TemplateParameterList::getLAngleLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getTemplateLoc(), P, and clang::TemplateParameterList::size().
Referenced by AddQualifierInfo().
| void ASTWriter::AddTypeLoc | ( | TypeLoc | TL, |
| RecordDataImpl & | Record | ||
| ) |
Emits a type with source-location information.
Definition at line 3772 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 3780 of file ASTWriter.cpp.
References GetOrCreateTypeID().
Referenced by AddDeclarationName(), AddNestedNameSpecifier(), AddTemplateArgument(), AddTypeLoc(), and AddTypeSourceInfo().
| void ASTWriter::AddTypeSourceInfo | ( | TypeSourceInfo * | TInfo, |
| RecordDataImpl & | Record | ||
| ) |
Emits a reference to a declarator info.
Definition at line 3762 of file ASTWriter.cpp.
References AddTypeLoc(), AddTypeRef(), and clang::TypeSourceInfo::getTypeLoc().
Referenced by AddCXXBaseSpecifier(), AddCXXCtorInitializers(), AddDeclarationNameLoc(), and AddTemplateArgumentLocInfo().
| void ASTWriter::AddUnresolvedSet | ( | const UnresolvedSetImpl & | Set, |
| RecordDataImpl & | Record | ||
| ) |
Emit a UnresolvedSet structure.
Definition at line 4202 of file ASTWriter.cpp.
References AddDeclRef(), clang::UnresolvedSetImpl::begin(), clang::UnresolvedSetImpl::end(), and clang::UnresolvedSetImpl::size().
Referenced by AddCXXDefinitionData().
| void clang::ASTWriter::AddUpdatedDeclContext | ( | const DeclContext * | DC | ) | [inline] |
Mark a declaration context as needing an update.
Definition at line 615 of file ASTWriter.h.
Referenced by AddedVisibleDecl().
| void ASTWriter::AddVersionTuple | ( | const VersionTuple & | Version, |
| RecordDataImpl & | Record | ||
| ) |
Add a version tuple to the given record.
Definition at line 3087 of file ASTWriter.cpp.
References clang::VersionTuple::getMajor(), clang::VersionTuple::getMinor(), and clang::VersionTuple::getSubminor().
| void ASTWriter::ClearSwitchCaseIDs | ( | ) |
Definition at line 1567 of file ASTWriterStmt.cpp.
| void ASTWriter::CompletedImplicitDefinition | ( | const FunctionDecl * | D | ) | [virtual] |
An implicit member got a definition.
Reimplemented from clang::ASTMutationListener.
Definition at line 4506 of file ASTWriter.cpp.
References clang::Decl::isFromASTFile(), and RewriteDecl().
| void ASTWriter::CompletedTagDefinition | ( | const TagDecl * | D | ) | [virtual] |
A new TagDecl definition was completed.
Reimplemented from clang::ASTMutationListener.
Definition at line 4439 of file ASTWriter.cpp.
References clang::TagDecl::isCompleteDefinition(), and RewriteDecl().
| void ASTWriter::FlushCXXBaseSpecifiers | ( | ) |
Flush all of the C++ base specifier sets that have been added via AddCXXBaseSpecifiersRef().
Definition at line 4224 of file ASTWriter.cpp.
References AddCXXBaseSpecifier(), clang::serialization::DECL_CXX_BASE_SPECIFIERS, FlushStmts(), and Index.
| 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 1645 of file ASTWriterStmt.cpp.
References clang::serialization::STMT_STOP.
Referenced by FlushCXXBaseSpecifiers().
| unsigned clang::ASTWriter::getCharacterLiteralAbbrev | ( | ) | const [inline] |
Definition at line 669 of file ASTWriter.h.
| unsigned clang::ASTWriter::getDeclEnumAbbrev | ( | ) | const [inline] |
Definition at line 675 of file ASTWriter.h.
| unsigned clang::ASTWriter::getDeclFieldAbbrev | ( | ) | const [inline] |
Definition at line 674 of file ASTWriter.h.
Determine the declaration ID of an already-emitted declaration.
Definition at line 3847 of file ASTWriter.cpp.
References clang::Decl::getGlobalID(), and clang::Decl::isFromASTFile().
| unsigned clang::ASTWriter::getDeclObjCIvarAbbrev | ( | ) | const [inline] |
Definition at line 676 of file ASTWriter.h.
| unsigned clang::ASTWriter::getDeclParmVarAbbrev | ( | ) | const [inline] |
Definition at line 667 of file ASTWriter.h.
| unsigned clang::ASTWriter::getDeclRecordAbbrev | ( | ) | const [inline] |
Definition at line 670 of file ASTWriter.h.
Force a declaration to be emitted and get its ID.
Definition at line 3823 of file ASTWriter.cpp.
References clang::Decl::getGlobalID(), and clang::Decl::isFromASTFile().
Referenced by AddDeclRef().
| unsigned clang::ASTWriter::getDeclRefExprAbbrev | ( | ) | const [inline] |
Definition at line 668 of file ASTWriter.h.
| unsigned clang::ASTWriter::getDeclTypedefAbbrev | ( | ) | const [inline] |
Definition at line 672 of file ASTWriter.h.
| unsigned clang::ASTWriter::getDeclVarAbbrev | ( | ) | const [inline] |
Definition at line 673 of file ASTWriter.h.
| IdentID ASTWriter::getIdentifierRef | ( | const IdentifierInfo * | II | ) |
Get the unique number used to refer to the given identifier.
Definition at line 3675 of file ASTWriter.cpp.
Referenced by AddIdentifierRef().
| unsigned clang::ASTWriter::getIntegerLiteralAbbrev | ( | ) | const [inline] |
Definition at line 671 of file ASTWriter.h.
| uint64_t clang::ASTWriter::getMacroOffset | ( | const IdentifierInfo * | II | ) | [inline] |
Retrieve the offset of the macro definition for the given identifier.
The identifier must refer to a macro.
Definition at line 516 of file ASTWriter.h.
Force a type to be emitted and get its ID.
Definition at line 3784 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 3794 of file ASTWriter.cpp.
References clang::QualType::getLocalFastQualifiers(), and clang::QualType::isNull().
Referenced by GetOrCreateTypeID().
| SelectorID ASTWriter::getSelectorRef | ( | Selector | Sel | ) |
Get the unique number used to refer to the given selector.
Definition at line 3689 of file ASTWriter.cpp.
References clang::Selector::getAsOpaquePtr(), and clang::ASTReader::LoadSelector().
Referenced by AddSelectorRef().
| unsigned ASTWriter::getSwitchCaseID | ( | SwitchCase * | S | ) |
Retrieve the ID for the given switch-case statement.
Definition at line 1561 of file ASTWriterStmt.cpp.
References S.
Determine the type ID of an already-emitted type.
Definition at line 3789 of file ASTWriter.cpp.
References getTypeIdx(), and clang::serialization::MakeTypeID().
Determine the type index of an already-emitted type.
Definition at line 3809 of file ASTWriter.cpp.
References clang::QualType::getLocalFastQualifiers(), and clang::QualType::isNull().
Referenced by getTypeID().
| bool clang::ASTWriter::hasChain | ( | ) | const [inline] |
Definition at line 678 of file ASTWriter.h.
| void ASTWriter::IdentifierRead | ( | serialization::IdentID | ID, |
| IdentifierInfo * | II | ||
| ) | [virtual] |
An identifier was deserialized from the AST file.
Reimplemented from clang::ASTDeserializationListener.
Definition at line 4403 of file ASTWriter.cpp.
References clang::IdentifierInfo::hasMacroDefinition().
| serialization::SubmoduleID ASTWriter::inferSubmoduleIDFromLocation | ( | SourceLocation | Loc | ) |
Infer the submodule ID that contains an entity at the given source location.
Definition at line 2048 of file ASTWriter.cpp.
References clang::Preprocessor::getHeaderSearchInfo(), clang::HeaderSearch::getModuleMap(), clang::Preprocessor::getSourceManager(), clang::ModuleMap::inferModuleFromLocation(), clang::SourceLocation::isInvalid(), and clang::Module::isSubModuleOf().
| bool clang::ASTWriter::isRewritten | ( | const Decl * | D | ) | const [inline] |
Definition at line 623 of file ASTWriter.h.
| void ASTWriter::MacroDefinitionRead | ( | serialization::PreprocessedEntityID | , |
| MacroDefinition * | MD | ||
| ) | [virtual] |
A macro definition was read from the AST file.
Reimplemented from clang::ASTDeserializationListener.
Definition at line 4424 of file ASTWriter.cpp.
| void ASTWriter::MacroVisible | ( | IdentifierInfo * | II | ) | [virtual] |
A macro definition that had previously been deserialized (and removed via IdentifierRead) has now been made visible.
Reimplemented from clang::ASTDeserializationListener.
Definition at line 4430 of file ASTWriter.cpp.
| void ASTWriter::ModuleRead | ( | serialization::SubmoduleID | ID, |
| Module * | Mod | ||
| ) | [virtual] |
A module definition was read from the AST file.
Reimplemented from clang::ASTDeserializationListener.
Definition at line 4434 of file ASTWriter.cpp.
| void ASTWriter::ReaderInitialized | ( | ASTReader * | Reader | ) | [virtual] |
The ASTReader was initialized.
Reimplemented from clang::ASTDeserializationListener.
Definition at line 4379 of file ASTWriter.cpp.
References clang::ASTReader::getTotalNumDecls(), clang::ASTReader::getTotalNumIdentifiers(), clang::ASTReader::getTotalNumSelectors(), clang::ASTReader::getTotalNumSubmodules(), clang::ASTReader::getTotalNumTypes(), clang::serialization::NUM_PREDEF_DECL_IDS, clang::serialization::NUM_PREDEF_IDENT_IDS, clang::serialization::NUM_PREDEF_SELECTOR_IDS, clang::serialization::NUM_PREDEF_SUBMODULE_IDS, and clang::serialization::NUM_PREDEF_TYPE_IDS.
| unsigned ASTWriter::RecordSwitchCaseID | ( | SwitchCase * | S | ) |
Record an ID for the given switch-case statement.
Definition at line 1553 of file ASTWriterStmt.cpp.
References S.
| void clang::ASTWriter::RewriteDecl | ( | const Decl * | D | ) | [inline] |
Definition at line 619 of file ASTWriter.h.
Referenced by AddedObjCPropertyInClassExtension(), CompletedImplicitDefinition(), and CompletedTagDefinition().
| void ASTWriter::SelectorRead | ( | serialization::SelectorID | iD, |
| Selector | Sel | ||
| ) | [virtual] |
A selector was read from the AST file.
Reimplemented from clang::ASTDeserializationListener.
Definition at line 4420 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 3102 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 3112 of file ASTWriter.cpp.
| void ASTWriter::StaticDataMemberInstantiated | ( | const VarDecl * | D | ) | [virtual] |
A static data member was implicitly instantiated.
Reimplemented from clang::ASTMutationListener.
Definition at line 4516 of file ASTWriter.cpp.
References AddSourceLocation(), clang::VarDecl::getMemberSpecializationInfo(), clang::MemberSpecializationInfo::getPointOfInstantiation(), clang::Decl::isFromASTFile(), and clang::serialization::UPD_CXX_INSTANTIATED_STATIC_DATA_MEMBER.
| void ASTWriter::TypeRead | ( | serialization::TypeIdx | Idx, |
| QualType | T | ||
| ) | [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 4409 of file ASTWriter.cpp.
References clang::serialization::TypeIdx::getIndex().
| void ASTWriter::WriteAST | ( | Sema & | SemaRef, |
| MemorizeStatCalls * | StatCalls, | ||
| const std::string & | OutputFile, | ||
| Module * | WritingModule, | ||
| StringRef | isysroot, | ||
| bool | hasErrors = false |
||
| ) |
Write a precompiled header for the given semantic analysis.
| SemaRef | a reference to the semantic analysis object that processed the AST to be written into the precompiled header. |
| StatCalls | the object that cached all of the stat() calls made while searching for source files and headers. |
| WritingModule | The module that we are writing. If null, we are writing a precompiled header. |
| isysroot | if non-empty, write a relocatable file whose headers are relative to the given system root. |
Definition at line 3151 of file ASTWriter.cpp.
References clang::Sema::Context, and clang::Sema::PP.
Referenced by clang::PCHGenerator::HandleTranslationUnit(), and clang::ASTUnit::serialize().
friend class ASTDeclWriter [friend] |
Definition at line 78 of file ASTWriter.h.
friend class ASTStmtWriter [friend] |
Definition at line 79 of file ASTWriter.h.