diff options
-rw-r--r-- | include/llvm/Instructions.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 9503d8a543..73e4f85b38 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<BasicBlock>(V); - return 0; + return cast_or_null<BasicBlock>(getOperand(i)); } void setSuccessor(unsigned idx, BasicBlock *NewSucc) { |