aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/Type.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index dc5053acc2..67fad98324 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;
}