From d7f2a6cb3fbc012763adb42fd967f6fefbb22a37 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 5 Aug 2009 23:16:16 +0000 Subject: Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CodeExtractor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Transforms/Utils/CodeExtractor.cpp') diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index 80da263df5..d4f0c8095a 100644 --- a/lib/Transforms/Utils/CodeExtractor.cpp +++ b/lib/Transforms/Utils/CodeExtractor.cpp @@ -275,7 +275,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs, if (AggregateArgs && (inputs.size() + outputs.size() > 0)) { PointerType *StructPtr = - PointerType::getUnqual(StructType::get(paramTy)); + PointerType::getUnqual(StructType::get(M->getContext(), paramTy)); paramTy.clear(); paramTy.push_back(StructPtr); } @@ -382,7 +382,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer, ArgTypes.push_back((*v)->getType()); // Allocate a struct at the beginning of this function - Type *StructArgTy = StructType::get(ArgTypes); + Type *StructArgTy = StructType::get(newFunction->getContext(), ArgTypes); Struct = new AllocaInst(StructArgTy, 0, "structArg", codeReplacer->getParent()->begin()->begin()); -- cgit v1.2.3-18-g5258