diff options
Diffstat (limited to 'include/clang/Serialization/ASTWriter.h')
-rw-r--r-- | include/clang/Serialization/ASTWriter.h | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index ad6ecdd351..20e9935c0c 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -11,8 +11,8 @@ // containing a serialized representation of a translation unit. // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_FRONTEND_AST_WRITER_H -#define LLVM_CLANG_FRONTEND_AST_WRITER_H +#ifndef LLVM_CLANG_SERIALIZATION_ASTWRITER_H +#define LLVM_CLANG_SERIALIZATION_ASTWRITER_H #include "clang/AST/ASTMutationListener.h" #include "clang/AST/Decl.h" @@ -283,6 +283,10 @@ private: llvm::DenseMap<const MacroDefinition *, serialization::PreprocessedEntityID> MacroDefinitions; + /// \brief Cache of indices of anonymous declarations within their lexical + /// contexts. + llvm::DenseMap<const Decl *, unsigned> AnonymousDeclarationNumbers; + /// An update to a Decl. class DeclUpdate { /// A DeclUpdateKind. @@ -466,7 +470,12 @@ private: void WritePragmaDiagnosticMappings(const DiagnosticsEngine &Diag, bool isModule); void WriteCXXBaseSpecifiersOffsets(); + + unsigned TypeExtQualAbbrev; + unsigned TypeFunctionProtoAbbrev; + void WriteTypeAbbrevs(); void WriteType(QualType T); + uint32_t GenerateNameLookupTable(const DeclContext *DC, llvm::SmallVectorImpl<char> &LookupTable); uint64_t WriteDeclContextLexicalBlock(ASTContext &Context, DeclContext *DC); @@ -494,17 +503,20 @@ private: unsigned DeclContextLexicalAbbrev; unsigned DeclContextVisibleLookupAbbrev; unsigned UpdateVisibleAbbrev; - unsigned DeclRefExprAbbrev; - unsigned CharacterLiteralAbbrev; unsigned DeclRecordAbbrev; - unsigned IntegerLiteralAbbrev; unsigned DeclTypedefAbbrev; unsigned DeclVarAbbrev; unsigned DeclFieldAbbrev; unsigned DeclEnumAbbrev; unsigned DeclObjCIvarAbbrev; + unsigned DeclCXXMethodAbbrev; + + unsigned DeclRefExprAbbrev; + unsigned CharacterLiteralAbbrev; + unsigned IntegerLiteralAbbrev; + unsigned ExprImplicitCastAbbrev; - void WriteDeclsBlockAbbrevs(); + void WriteDeclAbbrevs(); void WriteDecl(ASTContext &Context, Decl *D); void AddFunctionDefinition(const FunctionDecl *FD, RecordData &Record); @@ -631,6 +643,7 @@ public: DeclarationName Name, RecordDataImpl &Record); void AddDeclarationNameInfo(const DeclarationNameInfo &NameInfo, RecordDataImpl &Record); + unsigned getAnonymousDeclarationNumber(const NamedDecl *D); void AddQualifierInfo(const QualifierInfo &Info, RecordDataImpl &Record); @@ -731,16 +744,26 @@ public: void ClearSwitchCaseIDs(); + unsigned getTypeExtQualAbbrev() const { + return TypeExtQualAbbrev; + } + unsigned getTypeFunctionProtoAbbrev() const { + return TypeFunctionProtoAbbrev; + } + unsigned getDeclParmVarAbbrev() const { return DeclParmVarAbbrev; } - unsigned getDeclRefExprAbbrev() const { return DeclRefExprAbbrev; } - unsigned getCharacterLiteralAbbrev() const { return CharacterLiteralAbbrev; } unsigned getDeclRecordAbbrev() const { return DeclRecordAbbrev; } - unsigned getIntegerLiteralAbbrev() const { return IntegerLiteralAbbrev; } unsigned getDeclTypedefAbbrev() const { return DeclTypedefAbbrev; } unsigned getDeclVarAbbrev() const { return DeclVarAbbrev; } unsigned getDeclFieldAbbrev() const { return DeclFieldAbbrev; } unsigned getDeclEnumAbbrev() const { return DeclEnumAbbrev; } unsigned getDeclObjCIvarAbbrev() const { return DeclObjCIvarAbbrev; } + unsigned getDeclCXXMethodAbbrev() const { return DeclCXXMethodAbbrev; } + + unsigned getDeclRefExprAbbrev() const { return DeclRefExprAbbrev; } + unsigned getCharacterLiteralAbbrev() const { return CharacterLiteralAbbrev; } + unsigned getIntegerLiteralAbbrev() const { return IntegerLiteralAbbrev; } + unsigned getExprImplicitCastAbbrev() const { return ExprImplicitCastAbbrev; } bool hasChain() const { return Chain; } @@ -775,6 +798,7 @@ public: const ObjCPropertyDecl *OrigProp, const ObjCCategoryDecl *ClassExt) override; void DeclarationMarkedUsed(const Decl *D) override; + void DeclarationMarkedOpenMPThreadPrivate(const Decl *D) override; }; /// \brief AST and semantic-analysis consumer that generates a |