Implement basic block successor iterators. Rename BBDestination ->
BasicBlockOperand to be more consistent with InstOperand. Rename
getDestinations() to getBasicBlockOperands() to reduce confusion on their role.
PiperOrigin-RevId: 206192327
diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp
index fa578f1..c3f0b1e 100644
--- a/lib/IR/Instructions.cpp
+++ b/lib/IR/Instructions.cpp
@@ -107,7 +107,7 @@
op.drop();
if (auto *term = dyn_cast<TerminatorInst>(this))
- for (auto &dest : term->getDestinations())
+ for (auto &dest : term->getBasicBlockOperands())
dest.drop();
}
@@ -224,14 +224,14 @@
}
/// Return the list of destination entries that this terminator branches to.
-MutableArrayRef<BBDestination> TerminatorInst::getDestinations() {
+MutableArrayRef<BasicBlockOperand> TerminatorInst::getBasicBlockOperands() {
switch (getKind()) {
case Kind::Operation:
llvm_unreachable("not a terminator");
case Kind::Branch:
- return cast<BranchInst>(this)->getDestinations();
+ return cast<BranchInst>(this)->getBasicBlockOperands();
case Kind::CondBranch:
- return cast<CondBranchInst>(this)->getDestinations();
+ return cast<CondBranchInst>(this)->getBasicBlockOperands();
case Kind::Return:
// Return has no basic block successors.
return {};