summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-09-29 20:21:17 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-09-29 20:21:17 +0000
commitbb5a7442e362776621112dc9453e546a55878e79 (patch)
tree6f504615cfbcf1d88494b1688f90eecb2998855a /include
parent0066f9290e95dddedc47472e927319893929b05b (diff)
downloadllvm-bb5a7442e362776621112dc9453e546a55878e79.tar.gz
llvm-bb5a7442e362776621112dc9453e546a55878e79.tar.bz2
llvm-bb5a7442e362776621112dc9453e546a55878e79.tar.xz
Clean up uses of switch instructions so they are not dependent on the operand ordering. Patch by Stepan Dyatkovskiy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Instructions.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 2b681abbbd..2f879a1861 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -2509,6 +2509,13 @@ public:
return reinterpret_cast<ConstantInt*>(getOperand(idx*2));
}
+ // setSuccessorValue - Updates the value associated with the specified
+ // successor.
+ void setSuccessorValue(unsigned idx, ConstantInt* SuccessorValue) {
+ assert(idx < getNumSuccessors() && "Successor # out of range!");
+ setOperand(idx*2, reinterpret_cast<Value*>(SuccessorValue));
+ }
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SwitchInst *) { return true; }
static inline bool classof(const Instruction *I) {