diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-07-13 10:39:49 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-07-13 10:39:49 +0000 |
commit | e732a7d62a477d928ea61b0a97fd2b60a127d51c (patch) | |
tree | b7114e0a54fe5b4678c835e34ad936a8b940066a | |
parent | 57aa63679434eaead4457308038331e685cef817 (diff) | |
download | bcm5719-llvm-e732a7d62a477d928ea61b0a97fd2b60a127d51c.tar.gz bcm5719-llvm-e732a7d62a477d928ea61b0a97fd2b60a127d51c.zip |
Really cache function types and anonymous struct types.
llvm-svn: 135042
-rw-r--r-- | llvm/lib/VMCore/Type.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index dc5053acc24..67fad983248 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -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; } |