[llvm-commits] [llvm] r135042 - /llvm/trunk/lib/VMCore/Type.cpp
Jay Foad
jay.foad at gmail.com
Wed Jul 13 03:39:49 PDT 2011
Author: foad
Date: Wed Jul 13 05:39:49 2011
New Revision: 135042
URL: http://llvm.org/viewvc/llvm-project?rev=135042&view=rev
Log:
Really cache function types and anonymous struct types.
Modified:
llvm/trunk/lib/VMCore/Type.cpp
Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=135042&r1=135041&r2=135042&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Wed Jul 13 05:39:49 2011
@@ -343,6 +343,8 @@
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 @@
ST = new StructType(Context);
ST->setSubclassData(SCDB_IsAnonymous); // Anonymous struct.
ST->setBody(ETypes, isPacked);
+
+ Context.pImpl->AnonStructTypes[Key] = ST;
+
return ST;
}
More information about the llvm-commits
mailing list