+BasicBlock *BasicBlock::getSingleSuccessor() {
+ succ_iterator SI = succ_begin(this), E = succ_end(this);
+ if (SI == E) return nullptr; // no successors
+ BasicBlock *TheSucc = *SI;
+ ++SI;
+ return (SI == E) ? TheSucc : nullptr /* multiple successors */;
+}
+
+BasicBlock *BasicBlock::getUniqueSuccessor() {
+ succ_iterator SI = succ_begin(this), E = succ_end(this);
+ if (SI == E) return NULL; // No successors
+ BasicBlock *SuccBB = *SI;
+ ++SI;
+ for (;SI != E; ++SI) {
+ if (*SI != SuccBB)
+ return NULL;
+ // The same successor appears multiple times in the successor list.
+ // This is OK.
+ }
+ return SuccBB;
+}
+
+/// This method is used to notify a BasicBlock that the