[llvm-commits] CVS: llvm/include/llvm/iTerminators.h

Chris Lattner lattner at cs.uiuc.edu
Wed Jun 4 00:09:03 PDT 2003


Changes in directory llvm/include/llvm:

iTerminators.h updated: 1.25 -> 1.26

---
Log message:

Add new setCondition member


---
Diffs of the changes:

Index: llvm/include/llvm/iTerminators.h
diff -u llvm/include/llvm/iTerminators.h:1.25 llvm/include/llvm/iTerminators.h:1.26
--- llvm/include/llvm/iTerminators.h:1.25	Mon Feb 24 14:48:28 2003
+++ llvm/include/llvm/iTerminators.h	Wed Jun  4 00:08:31 2003
@@ -78,11 +78,13 @@
   inline bool isUnconditional() const { return Operands.size() == 1; }
   inline bool isConditional()   const { return Operands.size() == 3; }
 
-  inline const Value *getCondition() const {
-    return isUnconditional() ? 0 : Operands[2].get();
+  inline Value *getCondition() const {
+    return isUnconditional() ? 0 : (Value*)Operands[2].get();
   }
-  Value *getCondition() {
-    return isUnconditional() ? 0 : Operands[2].get();
+
+  void setCondition(Value *V) {
+    assert(isConditional() && "Cannot set condition of unconditional branch!");
+    setOperand(2, V);
   }
 
   // setUnconditionalDest - Change the current branch to an unconditional branch





More information about the llvm-commits mailing list