diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/Reg2Mem.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp index be60b5a3588..a43da7a60ac 100644 --- a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp +++ b/llvm/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; |