From 0bdbfe0b158859c62d1d1cf21fac31c95cbd1174 Mon Sep 17 00:00:00 2001 From: Anand Shukla Date: Tue, 25 Jun 2002 20:17:40 +0000 Subject: [PATCH] Added setSuccessor() method to terminator instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2784 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/InstrTypes.h | 4 +++- include/llvm/iTerminators.h | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index f7d63d6a900..8b5b39091af 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -35,7 +35,9 @@ public: // virtual const BasicBlock *getSuccessor(unsigned idx) const = 0; virtual unsigned getNumSuccessors() const = 0; - virtual void setSuccessor(unsigned idx, BasicBlock *NewSucc) = 0; + + //set a successor at a given index + virtual void setSuccessor(unsigned idx, BasicBlock *B) = 0; inline BasicBlock *getSuccessor(unsigned idx) { return (BasicBlock*)((const TerminatorInst *)this)->getSuccessor(idx); diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index 482684aa8ad..b17029be750 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -233,6 +233,14 @@ public: return cast(Operands[2].get()); } + inline void setNormalDest(BasicBlock *B){ + Operands[1] = (Value*)B; + } + + inline void setExceptionalDest(BasicBlock *B){ + Operands[2] = (Value*)B; + } + virtual const char *getOpcodeName() const { return "invoke"; } virtual const BasicBlock *getSuccessor(unsigned i) const {