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 | 72f073acd49e08e8cda34251f377d180190e3eb1 (patch) | |
| tree | b49115ac04e466af5174c442ced2e494125e3a97 /clang/AST/DeclSerialization.cpp | |
| parent | 15f50ba7559189f7c4b52dc7643fef3cf6d9ffd4 (diff) | |
| download | bcm5719-llvm-72f073acd49e08e8cda34251f377d180190e3eb1.tar.gz bcm5719-llvm-72f073acd49e08e8cda34251f377d180190e3eb1.zip | |
Implemented serialization of TypedefDecls.
Fixed infinite recursion in VarDecl::InternalRead.
llvm-svn: 43739
Diffstat (limited to 'clang/AST/DeclSerialization.cpp')
| -rw-r--r-- | clang/AST/DeclSerialization.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/clang/AST/DeclSerialization.cpp b/clang/AST/DeclSerialization.cpp index a9819be1cca..9ceb6adaef5 100644 --- a/clang/AST/DeclSerialization.cpp +++ b/clang/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; +} |

