[TI removal] Make `getTerminator()` return a generic `Instruction`.
authorChandler Carruth <chandlerc@gmail.com>
Mon, 15 Oct 2018 10:42:50 +0000 (10:42 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 15 Oct 2018 10:42:50 +0000 (10:42 +0000)
commite303c87e1979f7172d49c7ceacfb1b1694932225
treea11fb658cea2668201ca581a7d2041333db87ec0
parent52eaaf3ff8cf7321612d8f5197362fd08094d391
[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
16 files changed:
clang/lib/CodeGen/CGCleanup.cpp
clang/lib/CodeGen/CGException.cpp
llvm/include/llvm/IR/BasicBlock.h
llvm/lib/IR/BasicBlock.cpp
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/lib/Transforms/Scalar/GVNHoist.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/tools/bugpoint/CrashDebugger.cpp
llvm/tools/llvm-diff/DifferenceEngine.cpp
llvm/unittests/IR/DominatorTreeTest.cpp
llvm/unittests/IR/IRBuilderTest.cpp
polly/include/polly/Support/ScopHelper.h
polly/lib/Analysis/ScopDetection.cpp
polly/lib/Analysis/ScopInfo.cpp
polly/lib/CodeGen/BlockGenerators.cpp
polly/lib/Support/ScopHelper.cpp