forked from OSchip/llvm-project
Really cache function types and anonymous struct types.
llvm-svn: 135042
This commit is contained in:
parent
57aa636794
commit
e732a7d62a
|
@ -343,6 +343,8 @@ FunctionType *FunctionType::get(const Type *ReturnType,
|
|||
FT = (FunctionType*) operator new(sizeof(FunctionType) +
|
||||
sizeof(Type*)*(Params.size()+1));
|
||||
new (FT) FunctionType(ReturnType, Params, isVarArg);
|
||||
|
||||
ReturnType->getContext().pImpl->FunctionTypes[Key] = FT;
|
||||
}
|
||||
|
||||
return FT;
|
||||
|
@ -393,6 +395,9 @@ StructType *StructType::get(LLVMContext &Context, ArrayRef<Type*> ETypes,
|
|||
ST = new StructType(Context);
|
||||
ST->setSubclassData(SCDB_IsAnonymous); // Anonymous struct.
|
||||
ST->setBody(ETypes, isPacked);
|
||||
|
||||
Context.pImpl->AnonStructTypes[Key] = ST;
|
||||
|
||||
return ST;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue