summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclSerialization.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-10-15 00:42:39 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-10-15 00:42:39 +0000
commit88e1b97f16c752ca889f24cc7e2a795b47c64696 (patch)
tree0da3ab7033a52adeb9cfb498ec7736b0fb2ef277 /clang/lib/AST/DeclSerialization.cpp
parent267c4fe1b5b290c937ec0ff84908dcd3fd5c8709 (diff)
downloadbcm5719-llvm-88e1b97f16c752ca889f24cc7e2a795b47c64696.tar.gz
bcm5719-llvm-88e1b97f16c752ca889f24cc7e2a795b47c64696.zip
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. llvm-svn: 57541
Diffstat (limited to 'clang/lib/AST/DeclSerialization.cpp')
-rw-r--r--clang/lib/AST/DeclSerialization.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/AST/DeclSerialization.cpp b/clang/lib/AST/DeclSerialization.cpp
index 718885b2b56..a0befbdbb08 100644
--- a/clang/lib/AST/DeclSerialization.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud