diff options
author | Chris Lattner <sabre@nondot.org> | 2003-09-08 18:54:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-09-08 18:54:09 +0000 |
commit | 47f3a942bef7a7325cfc62908927828a6e3e037f (patch) | |
tree | 17792d16d3c1afc6eacc37d96e0732b7d1589ec3 /include | |
parent | 9b7f42dd6ad771b972557e3ee8a140bb2a8ff680 (diff) | |
download | external_llvm-47f3a942bef7a7325cfc62908927828a6e3e037f.zip external_llvm-47f3a942bef7a7325cfc62908927828a6e3e037f.tar.gz external_llvm-47f3a942bef7a7325cfc62908927828a6e3e037f.tar.bz2 |
Add the unwind instruction class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8405 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/iTerminators.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index 434fe67..467df4d 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -61,7 +61,6 @@ public: } }; - //===--------------------------------------------------------------------------- // BranchInst - Conditional or Unconditional Branch instruction. // @@ -270,4 +269,36 @@ public: } }; + +//===--------------------------------------------------------------------------- +/// UnwindInst - Immediately exit the current function, unwinding the stack +/// until an invoke instruction is found. +/// +struct UnwindInst : public TerminatorInst { + UnwindInst(Instruction *InsertBefore = 0) + : TerminatorInst(Instruction::Unwind, InsertBefore) { + } + + virtual Instruction *clone() const { return new UnwindInst(); } + + virtual const BasicBlock *getSuccessor(unsigned idx) const { + assert(0 && "UnwindInst has no successors!"); + abort(); + return 0; + } + virtual void setSuccessor(unsigned idx, BasicBlock *NewSucc) { + assert(0 && "UnwindInst has no successors!"); + } + virtual unsigned getNumSuccessors() const { return 0; } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const UnwindInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::Unwind; + } + static inline bool classof(const Value *V) { + return isa<Instruction>(V) && classof(cast<Instruction>(V)); + } +}; + #endif |