diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-09 18:36:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-09 18:36:05 +0000 |
commit | a6fd4b0d82d76ffea4edebc9f2f203b4ca0bb01b (patch) | |
tree | 7e0e3b989c74bd1cc7e1aadb9b9434d4e31f599a /include/llvm/iTerminators.h | |
parent | 184b2fa1b9b536e6c2bc27ba3f43dd42b2a557f9 (diff) | |
download | external_llvm-a6fd4b0d82d76ffea4edebc9f2f203b4ca0bb01b.zip external_llvm-a6fd4b0d82d76ffea4edebc9f2f203b4ca0bb01b.tar.gz external_llvm-a6fd4b0d82d76ffea4edebc9f2f203b4ca0bb01b.tar.bz2 |
Use .get() explicitly and add a few extra casts to avoid 2 #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2204 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/iTerminators.h')
-rw-r--r-- | include/llvm/iTerminators.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index 790b0e2..e0d6d62 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -11,8 +11,6 @@ #define LLVM_ITERMINATORS_H #include "llvm/InstrTypes.h" -#include "llvm/BasicBlock.h" -#include "llvm/ConstantVals.h" //===----------------------------------------------------------------------===// // Classes to represent Basic Block "Terminator" instructions @@ -98,16 +96,16 @@ public: void setUnconditionalDest(BasicBlock *Dest) { if (Operands.size() == 3) Operands.erase(Operands.begin()+1, Operands.end()); - Operands[0] = Dest; + Operands[0] = (Value*)Dest; } // Additionally, they must provide a method to get at the successors of this // terminator instruction. // virtual const BasicBlock *getSuccessor(unsigned i) const { - return (i == 0) ? cast<const BasicBlock>(Operands[0]) : + return (i == 0) ? cast<BasicBlock>(Operands[0].get()) : ((i == 1 && Operands.size() > 1) - ? cast<const BasicBlock>(Operands[1]) : 0); + ? cast<BasicBlock>(Operands[1].get()) : 0); } inline BasicBlock *getSuccessor(unsigned idx) { return (BasicBlock*)((const BranchInst *)this)->getSuccessor(idx); @@ -145,10 +143,10 @@ public: inline const Value *getCondition() const { return Operands[0]; } inline Value *getCondition() { return Operands[0]; } inline const BasicBlock *getDefaultDest() const { - return cast<const BasicBlock>(Operands[1]); + return cast<BasicBlock>(Operands[1].get()); } inline BasicBlock *getDefaultDest() { - return cast<BasicBlock>(Operands[1]); + return cast<BasicBlock>(Operands[1].get()); } void dest_push_back(Constant *OnVal, BasicBlock *Dest); @@ -161,22 +159,22 @@ public: // virtual const BasicBlock *getSuccessor(unsigned idx) const { if (idx >= Operands.size()/2) return 0; - return cast<const BasicBlock>(Operands[idx*2+1]); + return cast<BasicBlock>(Operands[idx*2+1].get()); } inline BasicBlock *getSuccessor(unsigned idx) { if (idx >= Operands.size()/2) return 0; - return cast<BasicBlock>(Operands[idx*2+1]); + return cast<BasicBlock>(Operands[idx*2+1].get()); } // getSuccessorValue - Return the value associated with the specified // successor. WARNING: This does not gracefully accept idx's out of range! inline const Constant *getSuccessorValue(unsigned idx) const { assert(idx < getNumSuccessors() && "Successor # out of range!"); - return cast<const Constant>(Operands[idx*2]); + return cast<Constant>(Operands[idx*2].get()); } inline Constant *getSuccessorValue(unsigned idx) { assert(idx < getNumSuccessors() && "Successor # out of range!"); - return cast<Constant>(Operands[idx*2]); + return cast<Constant>(Operands[idx*2].get()); } virtual unsigned getNumSuccessors() const { return Operands.size()/2; } @@ -218,16 +216,16 @@ public: // get*Dest - Return the destination basic blocks... inline const BasicBlock *getNormalDest() const { - return cast<BasicBlock>(Operands[1]); + return cast<BasicBlock>(Operands[1].get()); } inline BasicBlock *getNormalDest() { - return cast<BasicBlock>(Operands[1]); + return cast<BasicBlock>(Operands[1].get()); } inline const BasicBlock *getExceptionalDest() const { - return cast<BasicBlock>(Operands[2]); + return cast<BasicBlock>(Operands[2].get()); } inline BasicBlock *getExceptionalDest() { - return cast<BasicBlock>(Operands[2]); + return cast<BasicBlock>(Operands[2].get()); } virtual const char *getOpcodeName() const { return "invoke"; } |