From 9f5b2aa7fba203469386acc413c23dd41a713bc9 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 14 Jul 2009 23:09:55 +0000 Subject: Move EVER MORE stuff over to LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/ScalarReplAggregates.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/Transforms/Scalar/ScalarReplAggregates.cpp') diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 83db90d..d999f9d 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -302,14 +302,16 @@ bool SROA::performScalarRepl(Function &F) { DOUT << "CONVERT TO VECTOR: " << *AI << " TYPE = " << *VectorTy <<"\n"; // Create and insert the vector alloca. - NewAI = new AllocaInst(VectorTy, 0, "", AI->getParent()->begin()); + NewAI = new AllocaInst(*Context, VectorTy, 0, "", + AI->getParent()->begin()); ConvertUsesToScalar(AI, NewAI, 0); } else { DOUT << "CONVERT TO SCALAR INTEGER: " << *AI << "\n"; // Create and insert the integer alloca. const Type *NewTy = Context->getIntegerType(AllocaSize*8); - NewAI = new AllocaInst(NewTy, 0, "", AI->getParent()->begin()); + NewAI = new AllocaInst(*Context, NewTy, 0, "", + AI->getParent()->begin()); ConvertUsesToScalar(AI, NewAI, 0); } NewAI->takeName(AI); @@ -334,7 +336,8 @@ void SROA::DoScalarReplacement(AllocationInst *AI, if (const StructType *ST = dyn_cast(AI->getAllocatedType())) { ElementAllocas.reserve(ST->getNumContainedTypes()); for (unsigned i = 0, e = ST->getNumContainedTypes(); i != e; ++i) { - AllocaInst *NA = new AllocaInst(ST->getContainedType(i), 0, + AllocaInst *NA = new AllocaInst(*Context, + ST->getContainedType(i), 0, AI->getAlignment(), AI->getName() + "." + utostr(i), AI); ElementAllocas.push_back(NA); @@ -345,7 +348,7 @@ void SROA::DoScalarReplacement(AllocationInst *AI, ElementAllocas.reserve(AT->getNumElements()); const Type *ElTy = AT->getElementType(); for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) { - AllocaInst *NA = new AllocaInst(ElTy, 0, AI->getAlignment(), + AllocaInst *NA = new AllocaInst(*Context, ElTy, 0, AI->getAlignment(), AI->getName() + "." + utostr(i), AI); ElementAllocas.push_back(NA); WorkList.push_back(NA); // Add to worklist for recursive processing -- cgit v1.1