diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-15 00:42:39 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-15 00:42:39 +0000 |
commit | 35bc0821c4f80041724cd4c5c4889b2581546a41 (patch) | |
tree | d7137778d1d806d227e05eb0389e83ca4da8ce9e /lib/AST/DeclSerialization.cpp | |
parent | 00231ee34cefea1bffc4653c0149d5a8fc22516e (diff) |
Simplify handling of struct/union/class tags.
Instead of using two sets of Decl kinds (Struct/Union/Class and CXXStruct/CXXUnion/CXXClass), use one 'Record' and one 'CXXRecord' Decl kind and make tag kind a property of TagDecl.
Cleans up the code a bit and better reflects that Decl class structure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclSerialization.cpp')
-rw-r--r-- | lib/AST/DeclSerialization.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/AST/DeclSerialization.cpp b/lib/AST/DeclSerialization.cpp index 718885b2b5..a0befbdbb0 100644 --- a/lib/AST/DeclSerialization.cpp +++ b/lib/AST/DeclSerialization.cpp @@ -75,10 +75,8 @@ Decl* Decl::Create(Deserializer& D, ASTContext& C) { Dcl = FunctionDecl::CreateImpl(D, C); break; - case Class: - case Union: - case Struct: - Dcl = RecordDecl::CreateImpl(k, D, C); + case Record: + Dcl = RecordDecl::CreateImpl(D, C); break; case Typedef: @@ -461,6 +459,8 @@ BlockDecl* BlockDecl::CreateImpl(Deserializer& D, ASTContext& C) { //===----------------------------------------------------------------------===// void RecordDecl::EmitImpl(Serializer& S) const { + S.EmitInt(getTagKind()); + ScopedDecl::EmitInRec(S); S.EmitBool(isDefinition()); S.EmitBool(hasFlexibleArrayMember()); @@ -473,11 +473,11 @@ void RecordDecl::EmitImpl(Serializer& S) const { ScopedDecl::EmitOutRec(S); } -RecordDecl* RecordDecl::CreateImpl(Decl::Kind DK, Deserializer& D, - ASTContext& C) { +RecordDecl* RecordDecl::CreateImpl(Deserializer& D, ASTContext& C) { + TagKind TK = TagKind(D.ReadInt()); void *Mem = C.getAllocator().Allocate<RecordDecl>(); - RecordDecl* decl = new (Mem) RecordDecl(DK, 0, SourceLocation(), NULL); + RecordDecl* decl = new (Mem) RecordDecl(Record, TK, 0, SourceLocation(), NULL); decl->ScopedDecl::ReadInRec(D, C); decl->setDefinition(D.ReadBool()); |