diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-11-05 21:49:34 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-11-05 21:49:34 +0000 |
commit | f7bf411f59f29b7b340a1bbe89b8a3dc215c5b24 (patch) | |
tree | cc022dd8e8a4d9c8e6324f6e142b3f14e3d2917b | |
parent | 4ac81217e4e4e90dddeb40d3ebf236dfb6156a5c (diff) |
Implemented serialization of TypedefDecls.
Fixed infinite recursion in VarDecl::InternalRead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43739 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | AST/DeclSerialization.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/AST/DeclSerialization.cpp b/AST/DeclSerialization.cpp index a9819be1cc..9ceb6adaef 100644 --- a/AST/DeclSerialization.cpp +++ b/AST/DeclSerialization.cpp @@ -41,6 +41,10 @@ void Decl::Emit(llvm::Serializer& S) const { case Function: cast<FunctionDecl>(this)->Emit(S); break; + + case Typedef: + cast<TypedefDecl>(this)->Emit(S); + break; } } @@ -82,7 +86,7 @@ void ValueDecl::InternalRead(llvm::Deserializer& D) { 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 @@ FunctionDecl* FunctionDecl::Materialize(llvm::Deserializer& D) { 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; +} |