[cfe-commits] r43739 - /cfe/trunk/AST/DeclSerialization.cpp
Ted Kremenek
kremenek at apple.com
Mon Nov 5 13:49:34 PST 2007
Author: kremenek
Date: Mon Nov 5 15:49:34 2007
New Revision: 43739
URL: http://llvm.org/viewvc/llvm-project?rev=43739&view=rev
Log:
Implemented serialization of TypedefDecls.
Fixed infinite recursion in VarDecl::InternalRead.
Modified:
cfe/trunk/AST/DeclSerialization.cpp
Modified: cfe/trunk/AST/DeclSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/DeclSerialization.cpp?rev=43739&r1=43738&r2=43739&view=diff
==============================================================================
--- cfe/trunk/AST/DeclSerialization.cpp (original)
+++ cfe/trunk/AST/DeclSerialization.cpp Mon Nov 5 15:49:34 2007
@@ -41,6 +41,10 @@
case Function:
cast<FunctionDecl>(this)->Emit(S);
break;
+
+ case Typedef:
+ cast<TypedefDecl>(this)->Emit(S);
+ break;
}
}
@@ -82,7 +86,7 @@
void VarDecl::InternalEmit(llvm::Serializer& S) const {
S.EmitInt(SClass);
S.EmitInt(objcDeclQualifier);
- VarDecl::InternalEmit(S);
+ ValueDecl::InternalEmit(S);
S.EmitOwnedPtr(Init);
}
@@ -165,3 +169,17 @@
return decl;
}
+
+void TypedefDecl::Emit(llvm::Serializer& S) const {
+ S.Emit(getLocation());
+ InternalEmit(S);
+ S.Emit(UnderlyingType);
+}
+
+TypedefDecl* TypedefDecl::Materialize(llvm::Deserializer& D) {
+ SourceLocation L = SourceLocation::ReadVal(D);
+ TypedefDecl* decl = new TypedefDecl(L,NULL,QualType(),NULL);
+ decl->InternalRead(D);
+ D.Read(decl->UnderlyingType);
+ return decl;
+}
More information about the cfe-commits
mailing list