aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/Reg2Mem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/Reg2Mem.cpp b/lib/Transforms/Scalar/Reg2Mem.cpp
index be60b5a358..a43da7a60a 100644
--- a/lib/Transforms/Scalar/Reg2Mem.cpp
+++ b/lib/Transforms/Scalar/Reg2Mem.cpp
@@ -46,8 +46,9 @@ namespace {
virtual bool runOnFunction(Function &F) {
if (!F.isExternal()) {
//give us a clean block
- BasicBlock& bbhead = F.getEntryBlock();
- bbhead.splitBasicBlock(bbhead.begin());
+ BasicBlock* bbold = &F.getEntryBlock();
+ BasicBlock* bbnew = new BasicBlock("allocablock", &F, &F.getEntryBlock());
+ new BranchInst(bbold, bbnew);
//find the instructions
std::list<Instruction*> worklist;