aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-04 05:08:31 +0000
committerChris Lattner <sabre@nondot.org>2003-06-04 05:08:31 +0000
commit9dad6d741104209e8ee5fe916639035e127c3c27 (patch)
tree7f7988ac41fc4fdc32c50dd859cd4475a7a0e316 /include
parentd15cd2752fc2dba5155f7f5588e80449919dd424 (diff)
downloadexternal_llvm-9dad6d741104209e8ee5fe916639035e127c3c27.zip
external_llvm-9dad6d741104209e8ee5fe916639035e127c3c27.tar.gz
external_llvm-9dad6d741104209e8ee5fe916639035e127c3c27.tar.bz2
Add new setCondition member
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/iTerminators.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h
index 0101f85..35b0717 100644
--- a/include/llvm/iTerminators.h
+++ b/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