diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-06-04 05:08:31 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-06-04 05:08:31 +0000 |
| commit | d1f91d066041164be6129ae9d764351c09e949b5 (patch) | |
| tree | aedf907fd1bb1a08d267e1143354e8487704479f | |
| parent | 4e7bad01ff217c5154afd965dbe84218209fc03b (diff) | |
| download | bcm5719-llvm-d1f91d066041164be6129ae9d764351c09e949b5.tar.gz bcm5719-llvm-d1f91d066041164be6129ae9d764351c09e949b5.zip | |
Add new setCondition member
llvm-svn: 6603
| -rw-r--r-- | llvm/include/llvm/iTerminators.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/include/llvm/iTerminators.h b/llvm/include/llvm/iTerminators.h index 0101f85d4bf..35b07171ff1 100644 --- a/llvm/include/llvm/iTerminators.h +++ b/llvm/include/llvm/iTerminators.h @@ -78,11 +78,13 @@ public: 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 |

