From 97baedc8c5b9e24f90a3bde98ec2c05e1713e5ed Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 8 Jun 2004 22:03:05 +0000 Subject: [PATCH] I checked and no clients expect this to return null for unconditional branches Simplify code and make it more uniform. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14077 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/iTerminators.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index 7a10467e062..ddced52697e 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -126,7 +126,8 @@ public: inline bool isConditional() const { return Operands.size() == 3; } inline Value *getCondition() const { - return isUnconditional() ? 0 : reinterpret_cast(Operands[2].get()); + assert(isConditional() && "Cannot get condition of an uncond branch!"); + return Operands[2].get(); } void setCondition(Value *V) {