summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.