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 | 50dead06ffc107edb7e84857baaeeb09039c631c (patch) | |
tree | 2e30bfd47153b472b2e2ff73a2fb3b594ca56f46 /lib/Transforms/Utils/DemoteRegToStack.cpp | |
parent | 6d823cd39d8d16571682cd1bb4cbf2ecb4815d8e (diff) |
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
Diffstat (limited to 'lib/Transforms/Utils/DemoteRegToStack.cpp')
-rw-r--r-- | lib/Transforms/Utils/DemoteRegToStack.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Transforms/Utils/DemoteRegToStack.cpp b/lib/Transforms/Utils/DemoteRegToStack.cpp index 6cf043b6a1..c908b4a559 100644 --- a/lib/Transforms/Utils/DemoteRegToStack.cpp +++ b/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()); } |