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 | 75f67e0d8daa6201675d7bdec86e7e4f995f969f (patch) | |
tree | d67b6c9494a7ac9543ba7499164eb00f8ed4213a /lib/VMCore | |
parent | fc6d3a49867cd38954dc40936a88f1907252c6d2 (diff) | |
download | external_llvm-75f67e0d8daa6201675d7bdec86e7e4f995f969f.zip external_llvm-75f67e0d8daa6201675d7bdec86e7e4f995f969f.tar.gz external_llvm-75f67e0d8daa6201675d7bdec86e7e4f995f969f.tar.bz2 |
Really cache function types and anonymous struct types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Type.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index dc5053a..67fad98 100644 --- a/lib/VMCore/Type.cpp +++ b/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; } |