summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CodeExtractor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-08-13 03:17:39 +0000
committerChris Lattner <sabre@nondot.org>2004-08-13 03:17:39 +0000
commit337772832bb93ed98ee1e93c584ac3f82d9ea959 (patch)
tree73671b7e69e49a1abb78cd3837a31d502a483d03 /lib/Transforms/Utils/CodeExtractor.cpp
parent07ca8e7e286289c14001cbb8ba483097df70e758 (diff)
downloadllvm-337772832bb93ed98ee1e93c584ac3f82d9ea959.tar.gz
llvm-337772832bb93ed98ee1e93c584ac3f82d9ea959.tar.bz2
llvm-337772832bb93ed98ee1e93c584ac3f82d9ea959.tar.xz
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
Diffstat (limited to 'lib/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index b3de38a5db..4521038dd6 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -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.