Revert yesterday's change by removing the LLVMContext parameter to AllocaInst and MallocInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75863 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 7f1c3cb..75a0415 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -755,7 +755,7 @@
 
       // Just add all the struct element types.
       const Type *AgTy = cast<PointerType>(I->getType())->getElementType();
-      Value *TheAlloca = new AllocaInst(*Context, AgTy, 0, "", InsertPt);
+      Value *TheAlloca = new AllocaInst(AgTy, 0, "", InsertPt);
       const StructType *STy = cast<StructType>(AgTy);
       Value *Idxs[2] = { Context->getConstantInt(Type::Int32Ty, 0), 0 };
 
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 13fe94a..398f78a 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -828,7 +828,7 @@
     Type *NewTy = Context->getArrayType(MI->getAllocatedType(),
                                  NElements->getZExtValue());
     MallocInst *NewMI =
-      new MallocInst(*Context, NewTy, Context->getNullValue(Type::Int32Ty),
+      new MallocInst(NewTy, Context->getNullValue(Type::Int32Ty),
                      MI->getAlignment(), MI->getName(), MI);
     Value* Indices[2];
     Indices[0] = Indices[1] = Context->getNullValue(Type::Int32Ty);
@@ -1291,7 +1291,7 @@
                          GV->isThreadLocal());
     FieldGlobals.push_back(NGV);
     
-    MallocInst *NMI = new MallocInst(*Context, FieldTy, MI->getArraySize(),
+    MallocInst *NMI = new MallocInst(FieldTy, MI->getArraySize(),
                                      MI->getName() + ".f" + utostr(FieldNo),MI);
     FieldMallocs.push_back(NMI);
     new StoreInst(NMI, NGV, MI);
@@ -1507,7 +1507,7 @@
       // structs.  malloc [100 x struct],1 -> malloc struct, 100
       if (const ArrayType *AT = dyn_cast<ArrayType>(MI->getAllocatedType())) {
         MallocInst *NewMI = 
-          new MallocInst(*Context, AllocSTy, 
+          new MallocInst(AllocSTy, 
                   Context->getConstantInt(Type::Int32Ty, AT->getNumElements()),
                          "", MI);
         NewMI->takeName(MI);
@@ -1703,8 +1703,7 @@
       Instruction* FirstI = GS.AccessingFunction->getEntryBlock().begin();
       const Type* ElemTy = GV->getType()->getElementType();
       // FIXME: Pass Global's alignment when globals have alignment
-      AllocaInst* Alloca = new AllocaInst(*Context, ElemTy, NULL,
-                                          GV->getName(), FirstI);
+      AllocaInst* Alloca = new AllocaInst(ElemTy, NULL, GV->getName(), FirstI);
       if (!isa<UndefValue>(GV->getInitializer()))
         new StoreInst(GV->getInitializer(), Alloca, FirstI);
 
diff --git a/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp
index d3e609d..2086a16 100644
--- a/lib/Transforms/IPO/IndMemRemoval.cpp
+++ b/lib/Transforms/IPO/IndMemRemoval.cpp
@@ -73,7 +73,7 @@
       BasicBlock* bb = BasicBlock::Create("entry",FN);
       Instruction* c = CastInst::CreateIntegerCast(
           FN->arg_begin(), Type::Int32Ty, false, "c", bb);
-      Instruction* a = new MallocInst(*Context, Type::Int8Ty, c, "m", bb);
+      Instruction* a = new MallocInst(Type::Int8Ty, c, "m", bb);
       ReturnInst::Create(a, bb);
       ++NumBounce;
       NumBounceSites += F->getNumUses();
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp
index 8f5d50d..dfdf5b6 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -311,7 +311,7 @@
 
   // Fill in the alloca and call to initialize the SJ map.
   const Type *SBPTy = Context->getPointerTypeUnqual(Type::Int8Ty);
-  AllocaInst* Map = new AllocaInst(*Context, SBPTy, 0, "SJMap", Inst);
+  AllocaInst* Map = new AllocaInst(SBPTy, 0, "SJMap", Inst);
   CallInst::Create(InitSJMap, Map, "", Inst);
   return SJMap[Func] = Map;
 }
@@ -408,7 +408,7 @@
          UI != E; ++UI)
       if (cast<Instruction>(*UI)->getParent() != ABlock ||
           InstrsAfterCall.count(cast<Instruction>(*UI))) {
-        DemoteRegToStack(*Context, *II);
+        DemoteRegToStack(*II);
         break;
       }
   InstrsAfterCall.clear();
diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp
index ce976c8..6c32050 100644
--- a/lib/Transforms/IPO/RaiseAllocations.cpp
+++ b/lib/Transforms/IPO/RaiseAllocations.cpp
@@ -169,8 +169,7 @@
               CastInst::CreateIntegerCast(Source, Type::Int32Ty, false/*ZExt*/,
                                           "MallocAmtCast", I);
 
-          MallocInst *MI = new MallocInst(*Context, Type::Int8Ty,
-                                          Source, "", I);
+          MallocInst *MI = new MallocInst(Type::Int8Ty, Source, "", I);
           MI->takeName(I);
           I->replaceAllUsesWith(MI);
 
diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp
index 7771bc4..933bbb0 100644
--- a/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/lib/Transforms/IPO/StructRetPromotion.cpp
@@ -110,8 +110,8 @@
   DOUT << "SretPromotion: sret argument will be promoted\n";
   NumSRET++;
   // [1] Replace use of sret parameter 
-  AllocaInst *TheAlloca = new AllocaInst (*Context, STy, NULL, "mrv", 
-                                          F->getEntryBlock().begin());
+  AllocaInst *TheAlloca = new AllocaInst(STy, NULL, "mrv", 
+                                         F->getEntryBlock().begin());
   Value *NFirstArg = F->arg_begin();
   NFirstArg->replaceAllUsesWith(TheAlloca);