Added setSuccessor() method to terminator instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2784 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anand Shukla 2002-06-25 20:17:40 +00:00
parent a3b8867861
commit 0bdbfe0b15
2 changed files with 11 additions and 1 deletions

View File

@ -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);

View File

@ -233,6 +233,14 @@ public:
return cast<BasicBlock>(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 {