diff options
-rw-r--r-- | include/clang/AST/Decl.h | 8 | ||||
-rw-r--r-- | include/clang/AST/DeclNodes.def | 6 | ||||
-rw-r--r-- | lib/AST/DeclSerialization.cpp | 5 |
3 files changed, 7 insertions, 12 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 15945affce..1ea015066c 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -662,15 +662,13 @@ protected: /// FieldDecl - An instance of this class is created by Sema::ActOnField to /// represent a member of a struct/union/class. -class FieldDecl : public NamedDecl { +class FieldDecl : public ValueDecl { bool Mutable : 1; - QualType DeclType; Expr *BitWidth; protected: FieldDecl(Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *BW, bool Mutable) - : NamedDecl(DK, DC, L, Id), Mutable(Mutable), DeclType(T), - BitWidth(BW) + : ValueDecl(DK, DC, L, Id, T), Mutable(Mutable), BitWidth(BW) { } public: @@ -678,8 +676,6 @@ public: IdentifierInfo *Id, QualType T, Expr *BW, bool Mutable); - QualType getType() const { return DeclType; } - /// isMutable - Determines whether this field is mutable (C++ only). bool isMutable() const { return Mutable; } diff --git a/include/clang/AST/DeclNodes.def b/include/clang/AST/DeclNodes.def index 195553ccef..602c37e5e6 100644 --- a/include/clang/AST/DeclNodes.def +++ b/include/clang/AST/DeclNodes.def @@ -72,9 +72,6 @@ DECL(TranslationUnit, Decl) ABSTRACT_DECL(Named, Decl) DECL(OverloadedFunction, NamedDecl) - DECL(Field, NameDecl) - DECL(ObjCIvar, FieldDecl) - DECL(ObjCAtDefsField, FieldDecl) DECL(Namespace, NamedDecl) DECL(UsingDirective, NamedDecl) ABSTRACT_DECL(Type, NamedDecl) @@ -91,6 +88,9 @@ ABSTRACT_DECL(Named, Decl) DECL(CXXConstructor, CXXMethodDecl) DECL(CXXDestructor, CXXMethodDecl) DECL(CXXConversion, CXXMethodDecl) + DECL(Field, ValueDecl) + DECL(ObjCIvar, FieldDecl) + DECL(ObjCAtDefsField, FieldDecl) DECL(Var, ValueDecl) DECL(ImplicitParam, VarDecl) DECL(CXXClassVar, VarDecl) diff --git a/lib/AST/DeclSerialization.cpp b/lib/AST/DeclSerialization.cpp index ea027df1df..e4534a2686 100644 --- a/lib/AST/DeclSerialization.cpp +++ b/lib/AST/DeclSerialization.cpp @@ -437,7 +437,7 @@ EnumConstantDecl* EnumConstantDecl::CreateImpl(Deserializer& D, ASTContext& C) { void FieldDecl::EmitImpl(Serializer& S) const { S.EmitBool(Mutable); S.Emit(getType()); - NamedDecl::EmitInRec(S); + ValueDecl::EmitInRec(S); S.EmitOwnedPtr(BitWidth); } @@ -445,8 +445,7 @@ FieldDecl* FieldDecl::CreateImpl(Deserializer& D, ASTContext& C) { FieldDecl* decl = new (C) FieldDecl(Field, 0, SourceLocation(), NULL, QualType(), 0, false); decl->Mutable = D.ReadBool(); - decl->DeclType.ReadBackpatch(D); - decl->ReadInRec(D, C); + decl->ValueDecl::ReadInRec(D, C); decl->BitWidth = D.ReadOwnedPtr<Expr>(C); return decl; } |