[IR] remove redundant code comments; NFC

As noted in D92247 (and independent of that patch):

http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments

"Don’t duplicate the documentation comment in the header file and in the
implementation file. Put the documentation comments for public APIs into
the header file."
This commit is contained in:
Sanjay Patel 2020-11-29 08:56:20 -05:00
parent fba0b65f72
commit 2cebad702c

View File

@ -130,15 +130,11 @@ iplist<BasicBlock>::iterator BasicBlock::eraseFromParent() {
return getParent()->getBasicBlockList().erase(getIterator()); return getParent()->getBasicBlockList().erase(getIterator());
} }
/// Unlink this basic block from its current function and
/// insert it into the function that MovePos lives in, right before MovePos.
void BasicBlock::moveBefore(BasicBlock *MovePos) { void BasicBlock::moveBefore(BasicBlock *MovePos) {
MovePos->getParent()->getBasicBlockList().splice( MovePos->getParent()->getBasicBlockList().splice(
MovePos->getIterator(), getParent()->getBasicBlockList(), getIterator()); MovePos->getIterator(), getParent()->getBasicBlockList(), getIterator());
} }
/// Unlink this basic block from its current function and
/// insert it into the function that MovePos lives in, right after MovePos.
void BasicBlock::moveAfter(BasicBlock *MovePos) { void BasicBlock::moveAfter(BasicBlock *MovePos) {
MovePos->getParent()->getBasicBlockList().splice( MovePos->getParent()->getBasicBlockList().splice(
++MovePos->getIterator(), getParent()->getBasicBlockList(), ++MovePos->getIterator(), getParent()->getBasicBlockList(),
@ -265,8 +261,6 @@ void BasicBlock::dropAllReferences() {
I.dropAllReferences(); I.dropAllReferences();
} }
/// If this basic block has a single predecessor block,
/// return the block, otherwise return a null pointer.
const BasicBlock *BasicBlock::getSinglePredecessor() const { const BasicBlock *BasicBlock::getSinglePredecessor() const {
const_pred_iterator PI = pred_begin(this), E = pred_end(this); const_pred_iterator PI = pred_begin(this), E = pred_end(this);
if (PI == E) return nullptr; // No preds. if (PI == E) return nullptr; // No preds.
@ -275,11 +269,6 @@ const BasicBlock *BasicBlock::getSinglePredecessor() const {
return (PI == E) ? ThePred : nullptr /*multiple preds*/; return (PI == E) ? ThePred : nullptr /*multiple preds*/;
} }
/// If this basic block has a unique predecessor block,
/// return the block, otherwise return a null pointer.
/// Note that unique predecessor doesn't mean single edge, there can be
/// multiple edges from the unique predecessor to this block (for example
/// a switch statement with multiple cases having the same destination).
const BasicBlock *BasicBlock::getUniquePredecessor() const { const BasicBlock *BasicBlock::getUniquePredecessor() const {
const_pred_iterator PI = pred_begin(this), E = pred_end(this); const_pred_iterator PI = pred_begin(this), E = pred_end(this);
if (PI == E) return nullptr; // No preds. if (PI == E) return nullptr; // No preds.
@ -329,12 +318,6 @@ iterator_range<BasicBlock::phi_iterator> BasicBlock::phis() {
return make_range<phi_iterator>(P, nullptr); return make_range<phi_iterator>(P, nullptr);
} }
/// Update PHI nodes in this BasicBlock before removal of predecessor \p Pred.
/// Note that this function does not actually remove the predecessor.
///
/// If \p KeepOneInputPHIs is true then don't remove PHIs that are left with
/// zero or one incoming values, and don't simplify PHIs with all incoming
/// values the same.
void BasicBlock::removePredecessor(BasicBlock *Pred, void BasicBlock::removePredecessor(BasicBlock *Pred,
bool KeepOneInputPHIs) { bool KeepOneInputPHIs) {
// Use hasNUsesOrMore to bound the cost of this assertion for complex CFGs. // Use hasNUsesOrMore to bound the cost of this assertion for complex CFGs.
@ -389,17 +372,6 @@ bool BasicBlock::isLegalToHoistInto() const {
return !Term->isExceptionalTerminator(); return !Term->isExceptionalTerminator();
} }
/// This splits a basic block into two at the specified
/// instruction. Note that all instructions BEFORE the specified iterator stay
/// as part of the original basic block, an unconditional branch is added to
/// the new BB, and the rest of the instructions in the BB are moved to the new
/// BB, including the old terminator. This invalidates the iterator.
///
/// Note that this only works on well formed basic blocks (must have a
/// terminator), and 'I' must not be the end of instruction list (which would
/// cause a degenerate basic block to be formed, having a terminator inside of
/// the basic block).
///
BasicBlock *BasicBlock::splitBasicBlock(iterator I, const Twine &BBName) { BasicBlock *BasicBlock::splitBasicBlock(iterator I, const Twine &BBName) {
assert(getTerminator() && "Can't use splitBasicBlock on degenerate BB!"); assert(getTerminator() && "Can't use splitBasicBlock on degenerate BB!");
assert(I != InstList.end() && assert(I != InstList.end() &&
@ -454,13 +426,10 @@ void BasicBlock::replaceSuccessorsPhiUsesWith(BasicBlock *New) {
this->replaceSuccessorsPhiUsesWith(this, New); this->replaceSuccessorsPhiUsesWith(this, New);
} }
/// Return true if this basic block is a landing pad. I.e., it's
/// the destination of the 'unwind' edge of an invoke instruction.
bool BasicBlock::isLandingPad() const { bool BasicBlock::isLandingPad() const {
return isa<LandingPadInst>(getFirstNonPHI()); return isa<LandingPadInst>(getFirstNonPHI());
} }
/// Return the landingpad instruction associated with the landing pad.
const LandingPadInst *BasicBlock::getLandingPadInst() const { const LandingPadInst *BasicBlock::getLandingPadInst() const {
return dyn_cast<LandingPadInst>(getFirstNonPHI()); return dyn_cast<LandingPadInst>(getFirstNonPHI());
} }