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
This commit is contained in:
Owen Anderson
2009-08-05 23:16:16 +00:00
parent 70cd88fb7b
commit d7f2a6cb3f
18 changed files with 84 additions and 58 deletions

View File

@ -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());