diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2018-10-15 10:42:50 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2018-10-15 10:42:50 +0000 |
commit | e303c87e1979f7172d49c7ceacfb1b1694932225 (patch) | |
tree | a11fb658cea2668201ca581a7d2041333db87ec0 /llvm/tools/llvm-diff/DifferenceEngine.cpp | |
parent | 52eaaf3ff8cf7321612d8f5197362fd08094d391 (diff) | |
download | bcm5719-llvm-e303c87e1979f7172d49c7ceacfb1b1694932225.tar.gz bcm5719-llvm-e303c87e1979f7172d49c7ceacfb1b1694932225.zip |
[TI removal] Make `getTerminator()` return a generic `Instruction`.
This removes the primary remaining API producing `TerminatorInst` which
will reduce the rate at which code is introduced trying to use it and
generally make it much easier to remove the remaining APIs across the
codebase.
Also clean up some of the stragglers that the previous mechanical update
of variables missed.
Users of LLVM and out-of-tree code generally will need to update any
explicit variable types to handle this. Replacing `TerminatorInst` with
`Instruction` (or `auto`) almost always works. Most of these edits were
made in prior commits using the perl one-liner:
```
perl -i -ple 's/TerminatorInst(\b.* = .*getTerminator\(\))/Instruction\1/g'
```
This also my break some rare use cases where people overload for both
`Instruction` and `TerminatorInst`, but these should be easily fixed by
removing the `TerminatorInst` overload.
llvm-svn: 344504
Diffstat (limited to 'llvm/tools/llvm-diff/DifferenceEngine.cpp')
-rw-r--r-- | llvm/tools/llvm-diff/DifferenceEngine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-diff/DifferenceEngine.cpp b/llvm/tools/llvm-diff/DifferenceEngine.cpp index b2673c1407f..acff8bb3e89 100644 --- a/llvm/tools/llvm-diff/DifferenceEngine.cpp +++ b/llvm/tools/llvm-diff/DifferenceEngine.cpp @@ -629,8 +629,8 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart, // If the terminators have different kinds, but one is an invoke and the // other is an unconditional branch immediately following a call, unify // the results and the destinations. - TerminatorInst *LTerm = LStart->getParent()->getTerminator(); - TerminatorInst *RTerm = RStart->getParent()->getTerminator(); + Instruction *LTerm = LStart->getParent()->getTerminator(); + Instruction *RTerm = RStart->getParent()->getTerminator(); if (isa<BranchInst>(LTerm) && isa<InvokeInst>(RTerm)) { if (cast<BranchInst>(LTerm)->isConditional()) return; BasicBlock::iterator I = LTerm->getIterator(); |