diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 9503d8a5437..73e4f85b38c 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -2188,9 +2188,7 @@ public: BasicBlock *getSuccessor(unsigned i) const { assert(i < getNumSuccessors() && "Successor # out of range for Branch!"); - if (Value *V = getOperand(i)) - return cast(V); - return 0; + return cast_or_null(getOperand(i)); } void setSuccessor(unsigned idx, BasicBlock *NewSucc) {