forked from OSchip/llvm-project
Implemented serialization of FunctionTypeNoProto.
llvm-svn: 44094
This commit is contained in:
parent
7068cef079
commit
164faf98f3
|
@ -73,6 +73,10 @@ void Type::Create(ASTContext& Context, unsigned i, Deserializer& D) {
|
||||||
case Type::ConstantArray:
|
case Type::ConstantArray:
|
||||||
D.RegisterPtr(PtrID,ConstantArrayType::CreateImpl(Context,D));
|
D.RegisterPtr(PtrID,ConstantArrayType::CreateImpl(Context,D));
|
||||||
|
|
||||||
|
case Type::FunctionNoProto:
|
||||||
|
D.RegisterPtr(PtrID,FunctionTypeNoProto::CreateImpl(Context,D));
|
||||||
|
break;
|
||||||
|
|
||||||
case Type::FunctionProto:
|
case Type::FunctionProto:
|
||||||
D.RegisterPtr(PtrID,FunctionTypeProto::CreateImpl(Context,D));
|
D.RegisterPtr(PtrID,FunctionTypeProto::CreateImpl(Context,D));
|
||||||
break;
|
break;
|
||||||
|
@ -130,7 +134,7 @@ Type* ConstantArrayType::CreateImpl(ASTContext& Context, Deserializer& D) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// FunctionTypeProto
|
// FunctionTypeNoProto
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
void FunctionTypeProto::EmitImpl(Serializer& S) const {
|
void FunctionTypeProto::EmitImpl(Serializer& S) const {
|
||||||
|
@ -148,12 +152,24 @@ Type* FunctionTypeProto::CreateImpl(ASTContext& Context, Deserializer& D) {
|
||||||
unsigned NumArgs = D.ReadInt();
|
unsigned NumArgs = D.ReadInt();
|
||||||
|
|
||||||
llvm::SmallVector<QualType,15> Args;
|
llvm::SmallVector<QualType,15> Args;
|
||||||
|
|
||||||
for (unsigned j = 0; j < NumArgs; ++j)
|
for (unsigned j = 0; j < NumArgs; ++j)
|
||||||
Args.push_back(QualType::ReadVal(D));
|
Args.push_back(QualType::ReadVal(D));
|
||||||
|
|
||||||
return Context.getFunctionType(ResultType,&*Args.begin(),
|
return Context.getFunctionType(ResultType,&*Args.begin(),
|
||||||
NumArgs,isVariadic).getTypePtr();
|
NumArgs,isVariadic).getTypePtr();
|
||||||
|
}
|
||||||
|
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
// FunctionTypeProto
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
void FunctionTypeNoProto::EmitImpl(Serializer& S) const {
|
||||||
|
S.Emit(getResultType());
|
||||||
|
}
|
||||||
|
|
||||||
|
Type* FunctionTypeNoProto::CreateImpl(ASTContext& Context, Deserializer& D) {
|
||||||
|
return Context.getFunctionTypeNoProto(QualType::ReadVal(D)).getTypePtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
|
@ -751,6 +751,11 @@ public:
|
||||||
return T->getTypeClass() == FunctionNoProto;
|
return T->getTypeClass() == FunctionNoProto;
|
||||||
}
|
}
|
||||||
static bool classof(const FunctionTypeNoProto *) { return true; }
|
static bool classof(const FunctionTypeNoProto *) { return true; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void EmitImpl(llvm::Serializer& S) const;
|
||||||
|
static Type* CreateImpl(ASTContext& Context,llvm::Deserializer& D);
|
||||||
|
friend class Type;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// FunctionTypeProto - Represents a prototype with argument type info, e.g.
|
/// FunctionTypeProto - Represents a prototype with argument type info, e.g.
|
||||||
|
|
Loading…
Reference in New Issue