diff options
| author | Owen Anderson <resistor@mac.com> | 2009-07-15 23:53:25 +0000 | 
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2009-07-15 23:53:25 +0000 | 
| commit | 4fdeba97063da375ba360a021db34f025c0d9faf (patch) | |
| tree | cd662afb216dfa9b654e98cc1033a4dca474d8d2 /llvm/lib/Transforms/Utils | |
| parent | f060b4d9771d1035891aa458f5688ed8c12a30d4 (diff) | |
| download | bcm5719-llvm-4fdeba97063da375ba360a021db34f025c0d9faf.tar.gz bcm5719-llvm-4fdeba97063da375ba360a021db34f025c0d9faf.zip  | |
Revert yesterday's change by removing the LLVMContext parameter to AllocaInst and MallocInst.
llvm-svn: 75863
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/CodeExtractor.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/DemoteRegToStack.cpp | 14 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/LowerInvoke.cpp | 6 | 
4 files changed, 12 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp index 46e27c8c277..be02560de07 100644 --- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp +++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp @@ -372,8 +372,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,        StructValues.push_back(*i);      } else {        AllocaInst *alloca = -        new AllocaInst(*codeReplacer->getContext(),  -                       (*i)->getType(), 0, (*i)->getName()+".loc", +        new AllocaInst((*i)->getType(), 0, (*i)->getName()+".loc",                         codeReplacer->getParent()->begin()->begin());        ReloadOutputs.push_back(alloca);        params.push_back(alloca); @@ -390,7 +389,7 @@ emitCallAndSwitchStatement(Function *newFunction, BasicBlock *codeReplacer,      // Allocate a struct at the beginning of this function      Type *StructArgTy = Context->getStructType(ArgTypes);      Struct = -      new AllocaInst(*codeReplacer->getContext(), StructArgTy, 0, "structArg", +      new AllocaInst(StructArgTy, 0, "structArg",                       codeReplacer->getParent()->begin()->begin());      params.push_back(Struct); diff --git a/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp b/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp index 6cf043b6a1f..c908b4a5591 100644 --- a/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp +++ b/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp @@ -29,8 +29,7 @@ using namespace llvm;  /// invalidating the SSA information for the value.  It returns the pointer to  /// the alloca inserted to create a stack slot for I.  /// -AllocaInst* llvm::DemoteRegToStack(LLVMContext &Context,  -                                   Instruction &I, bool VolatileLoads, +AllocaInst* llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads,                                     Instruction *AllocaPoint) {    if (I.use_empty()) {      I.eraseFromParent(); @@ -40,11 +39,11 @@ AllocaInst* llvm::DemoteRegToStack(LLVMContext &Context,    // Create a stack slot to hold the value.    AllocaInst *Slot;    if (AllocaPoint) { -    Slot = new AllocaInst(Context, I.getType(), 0, +    Slot = new AllocaInst(I.getType(), 0,                            I.getName()+".reg2mem", AllocaPoint);    } else {      Function *F = I.getParent()->getParent(); -    Slot = new AllocaInst(Context, I.getType(), 0, I.getName()+".reg2mem", +    Slot = new AllocaInst(I.getType(), 0, I.getName()+".reg2mem",                            F->getEntryBlock().begin());    } @@ -109,8 +108,7 @@ AllocaInst* llvm::DemoteRegToStack(LLVMContext &Context,  /// DemotePHIToStack - This function takes a virtual register computed by a phi  /// node and replaces it with a slot in the stack frame, allocated via alloca.  /// The phi node is deleted and it returns the pointer to the alloca inserted. -AllocaInst* llvm::DemotePHIToStack(LLVMContext &Context, PHINode *P, -                                   Instruction *AllocaPoint) { +AllocaInst* llvm::DemotePHIToStack(PHINode *P, Instruction *AllocaPoint) {    if (P->use_empty()) {      P->eraseFromParent();          return 0;                 @@ -119,11 +117,11 @@ AllocaInst* llvm::DemotePHIToStack(LLVMContext &Context, PHINode *P,    // Create a stack slot to hold the value.    AllocaInst *Slot;    if (AllocaPoint) { -    Slot = new AllocaInst(Context, P->getType(), 0, +    Slot = new AllocaInst(P->getType(), 0,                            P->getName()+".reg2mem", AllocaPoint);    } else {      Function *F = P->getParent()->getParent(); -    Slot = new AllocaInst(Context, P->getType(), 0, P->getName()+".reg2mem", +    Slot = new AllocaInst(P->getType(), 0, P->getName()+".reg2mem",                            F->getEntryBlock().begin());    } diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 30b1caaa4c5..e1b493c204a 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -309,7 +309,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {          // Create the alloca.  If we have TargetData, use nice alignment.          unsigned Align = 1;          if (TD) Align = TD->getPrefTypeAlignment(AggTy); -        Value *NewAlloca = new AllocaInst(*Context, AggTy, 0, Align,  +        Value *NewAlloca = new AllocaInst(AggTy, 0, Align,                                             I->getName(),                                             &*Caller->begin()->begin());          // Emit a memcpy. diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp index 8ba14392eca..fae3edf0ada 100644 --- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp @@ -417,7 +417,7 @@ splitLiveRangesLiveAcrossInvokes(std::vector<InvokeInst*> &Invokes) {        // If we decided we need a spill, do it.        if (NeedsSpill) {          ++NumSpilled; -        DemoteRegToStack(*Context, *Inst, true); +        DemoteRegToStack(*Inst, true);        }      }  } @@ -470,7 +470,7 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) {      // alloca because the value needs to be live across invokes.      unsigned Align = TLI ? TLI->getJumpBufAlignment() : 0;      AllocaInst *JmpBuf = -      new AllocaInst(*Context, JBLinkTy, 0, Align, +      new AllocaInst(JBLinkTy, 0, Align,                       "jblink", F.begin()->begin());      std::vector<Value*> Idx; @@ -494,7 +494,7 @@ bool LowerInvoke::insertExpensiveEHSupport(Function &F) {      // Create an alloca which keeps track of which invoke is currently      // executing.  For normal calls it contains zero. -    AllocaInst *InvokeNum = new AllocaInst(*Context, Type::Int32Ty, 0, +    AllocaInst *InvokeNum = new AllocaInst(Type::Int32Ty, 0,                                             "invokenum",EntryBB->begin());      new StoreInst(Context->getConstantInt(Type::Int32Ty, 0), InvokeNum, true,                    EntryBB->getTerminator());  | 

