[IR] Use const_cast to reuse the const version of two BasicBlock methods that are duplicated for both const and non-const. NFC

Similar is already done for other methods in BasicBlock.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292753 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2017-01-22 06:53:04 +00:00
parent 80b90fe5c1
commit f931f143cb
2 changed files with 6 additions and 11 deletions
-9
View File
@@ -113,10 +113,6 @@ void BasicBlock::moveAfter(BasicBlock *MovePos) {
getIterator());
}
const Module *BasicBlock::getModule() const {
return getParent()->getParent();
}
Module *BasicBlock::getModule() {
return getParent()->getParent();
}
@@ -126,11 +122,6 @@ TerminatorInst *BasicBlock::getTerminator() {
return dyn_cast<TerminatorInst>(&InstList.back());
}
const TerminatorInst *BasicBlock::getTerminator() const {
if (InstList.empty()) return nullptr;
return dyn_cast<TerminatorInst>(&InstList.back());
}
CallInst *BasicBlock::getTerminatingMustTailCall() {
if (InstList.empty())
return nullptr;