diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-07-27 03:47:53 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-07-27 03:47:53 +0000 |
| commit | d90700108cfb45f2dda6c5a7adc11ce5ac68aa0d (patch) | |
| tree | 359f4875de281dbce0f77db18b2ff99d4556dd11 | |
| parent | c36d405a02fab41f6c45cb2bc750d64949742903 (diff) | |
Fix serialization for TypedefType by allowing TypedefType to access the internal CanonicalType stored in Type.
The test case Serialization/stmt_exprs.c now passes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54117 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | include/clang/AST/Type.h | 1 | ||||
| -rw-r--r-- | lib/AST/TypeSerialization.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 952a5dd9ba..5d764894c2 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -394,6 +394,7 @@ public: private: QualType getCanonicalTypeInternal() const { return CanonicalType; } friend class QualType; + friend class TypedefType; public: void dump() const; virtual void getAsStringInternal(std::string &InnerString) const = 0; diff --git a/lib/AST/TypeSerialization.cpp b/lib/AST/TypeSerialization.cpp index 00b71b65b5..60b5c68b0c 100644 --- a/lib/AST/TypeSerialization.cpp +++ b/lib/AST/TypeSerialization.cpp @@ -239,7 +239,7 @@ Type* TagType::CreateImpl(ASTContext& Context, Deserializer& D) { //===----------------------------------------------------------------------===// void TypedefType::EmitImpl(Serializer& S) const { - S.Emit(QualType((Type*)this,0)/*.getCanonicalType()*/); + S.Emit(getCanonicalTypeInternal()); S.EmitPtr(Decl); } @@ -247,7 +247,7 @@ Type* TypedefType::CreateImpl(ASTContext& Context, Deserializer& D) { std::vector<Type*>& Types = const_cast<std::vector<Type*>&>(Context.getTypes()); - TypedefType* T = new TypedefType(Type::TypeName, NULL,QualType::ReadVal(D)); + TypedefType* T = new TypedefType(Type::TypeName, NULL, QualType::ReadVal(D)); Types.push_back(T); D.ReadPtr(T->Decl); // May be backpatched. |
