зеркало из https://github.com/microsoft/clang-1.git
Implemented serialization of TypedefType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44092 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
da5dbb4a0a
Коммит
b28166d11e
|
@ -84,6 +84,10 @@ void Type::Create(ASTContext& Context, unsigned i, Deserializer& D) {
|
|||
case Type::Tagged:
|
||||
D.RegisterPtr(PtrID,TagType::CreateImpl(Context,D));
|
||||
break;
|
||||
|
||||
case Type::TypeName:
|
||||
D.RegisterPtr(PtrID,TypedefType::CreateImpl(Context,D));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,3 +177,25 @@ Type* TagType::CreateImpl(ASTContext& Context, Deserializer& D) {
|
|||
D.ReadPtr(T->Decl); // May be backpatched.
|
||||
return T;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// TypedefType
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void TypedefType::EmitImpl(Serializer& S) const {
|
||||
S.Emit(QualType((Type*)this,0).getCanonicalType());
|
||||
S.EmitPtr(Decl);
|
||||
}
|
||||
|
||||
Type* TypedefType::CreateImpl(ASTContext& Context, Deserializer& D) {
|
||||
std::vector<Type*>& Types =
|
||||
const_cast<std::vector<Type*>&>(Context.getTypes());
|
||||
|
||||
TypedefType* T = new TypedefType(NULL,QualType::ReadVal(D));
|
||||
Types.push_back(T);
|
||||
|
||||
D.ReadPtr(T->Decl); // May be backpatched.
|
||||
|
||||
return T;
|
||||
}
|
||||
|
||||
|
|
|
@ -824,6 +824,11 @@ public:
|
|||
|
||||
static bool classof(const Type *T) { return T->getTypeClass() == TypeName; }
|
||||
static bool classof(const TypedefType *) { return true; }
|
||||
|
||||
protected:
|
||||
virtual void EmitImpl(llvm::Serializer& S) const;
|
||||
static Type* CreateImpl(ASTContext& Context,llvm::Deserializer& D);
|
||||
friend class Type;
|
||||
};
|
||||
|
||||
/// TypeOfExpr (GCC extension).
|
||||
|
|
Загрузка…
Ссылка в новой задаче