When we code extract some stuff, leave the codeRepl block in the place where

the extracted code was, instead of putting it at the end of the function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-08-13 03:17:39 +00:00
parent 07ca8e7e28
commit 337772832b

View File

@ -622,7 +622,7 @@ ExtractCodeRegion(const std::vector<BasicBlock*> &code) {
Function *oldFunction = header->getParent();
// This takes place of the original loop
BasicBlock *codeReplacer = new BasicBlock("codeRepl", oldFunction);
BasicBlock *codeReplacer = new BasicBlock("codeRepl", oldFunction, header);
// The new function needs a root node because other nodes can branch to the
// head of the region, but the entry node of a function cannot have preds.