diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2018-10-18 00:38:54 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2018-10-18 00:38:54 +0000 |
commit | 8b7a8123ddd7b438a398b38eb6e8b69ca9f5ccbc (patch) | |
tree | 176ab87c64d37dd90de688824916449a4c3b3637 /llvm/lib/Transforms/Utils/CodeExtractor.cpp | |
parent | c1e3ee29a41a73e98689f6de5ced4b1d35041cf6 (diff) | |
download | bcm5719-llvm-8b7a8123ddd7b438a398b38eb6e8b69ca9f5ccbc.tar.gz bcm5719-llvm-8b7a8123ddd7b438a398b38eb6e8b69ca9f5ccbc.zip |
[TI removal] Update CodeExtractor to use Instruction directly.
llvm-svn: 344716
Diffstat (limited to 'llvm/lib/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CodeExtractor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp index 7b45b1799c4..27b982578c4 100644 --- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp +++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp @@ -808,10 +808,10 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs, for (unsigned i = 0, e = Users.size(); i != e; ++i) // The BasicBlock which contains the branch is not in the region // modify the branch target to a new block - if (TerminatorInst *TI = dyn_cast<TerminatorInst>(Users[i])) - if (!Blocks.count(TI->getParent()) && - TI->getParent()->getParent() == oldFunction) - TI->replaceUsesOfWith(header, newHeader); + if (Instruction *I = dyn_cast<Instruction>(Users[i])) + if (I->isTerminator() && !Blocks.count(I->getParent()) && + I->getParent()->getParent() == oldFunction) + I->replaceUsesOfWith(header, newHeader); return newFunction; } |