mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add the unwind instruction class
llvm-svn: 8405
This commit is contained in:
parent
56bc7d4056
commit
3aeba4c6fc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user