I checked and no clients expect this to return null for unconditional branches
authorChris Lattner <sabre@nondot.org>
Tue, 8 Jun 2004 22:03:05 +0000 (22:03 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 8 Jun 2004 22:03:05 +0000 (22:03 +0000)
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

index 7a10467e0623ab3968db13d7de45c365e5a5a30b..ddced52697e81d1a4121af91b5f375202f4dc00c 100644 (file)
@@ -126,7 +126,8 @@ public:
   inline bool isConditional()   const { return Operands.size() == 3; }
 
   inline Value *getCondition() const {
-    return isUnconditional() ? 0 : reinterpret_cast<Value*>(Operands[2].get());
+    assert(isConditional() && "Cannot get condition of an uncond branch!");
+    return Operands[2].get();
   }
 
   void setCondition(Value *V) {