diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2018-10-15 10:04:59 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2018-10-15 10:04:59 +0000 |
commit | edb12a838a22f212d7bee970ff637192f7ea8576 (patch) | |
tree | b8ceecb3e12339436c13c2fb2e84ffc813ce8224 /llvm/lib/IR/BasicBlock.cpp | |
parent | ae98759ec5634759f15fe103b0c637e6f836829f (diff) | |
download | llvm-edb12a838a22f212d7bee970ff637192f7ea8576.zip llvm-edb12a838a22f212d7bee970ff637192f7ea8576.tar.gz llvm-edb12a838a22f212d7bee970ff637192f7ea8576.tar.bz2 |
[TI removal] Make variables declared as `TerminatorInst` and initialized
by `getTerminator()` calls instead be declared as `Instruction`.
This is the biggest remaining chunk of the usage of `getTerminator()`
that insists on the narrow type and so is an easy batch of updates.
Several files saw more extensive updates where this would cascade to
requiring API updates within the file to use `Instruction` instead of
`TerminatorInst`. All of these were trivial in nature (pervasively using
`Instruction` instead just worked).
llvm-svn: 344502
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index d04af92..03fb5cc 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -437,7 +437,7 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const Twine &BBName) { } void BasicBlock::replaceSuccessorsPhiUsesWith(BasicBlock *New) { - TerminatorInst *TI = getTerminator(); + Instruction *TI = getTerminator(); if (!TI) // Cope with being called on a BasicBlock that doesn't have a terminator // yet. Clang's CodeGenFunction::EmitReturnBlock() likes to do this. @@ -468,7 +468,7 @@ const LandingPadInst *BasicBlock::getLandingPadInst() const { } Optional<uint64_t> BasicBlock::getIrrLoopHeaderWeight() const { - const TerminatorInst *TI = getTerminator(); + const Instruction *TI = getTerminator(); if (MDNode *MDIrrLoopHeader = TI->getMetadata(LLVMContext::MD_irr_loop)) { MDString *MDName = cast<MDString>(MDIrrLoopHeader->getOperand(0)); |