[IR] Cleanup some formatting issues in the EH instructions

No functionality change is intended.

llvm-svn: 244399
This commit is contained in:
David Majnemer 2015-08-08 17:41:21 +00:00
parent 86474c7a1a
commit e880ae9e1a
2 changed files with 34 additions and 40 deletions

View File

@ -673,16 +673,14 @@ public:
} }
CleanupReturnInst *CreateCleanupRet(BasicBlock *UnwindBB = nullptr, CleanupReturnInst *CreateCleanupRet(BasicBlock *UnwindBB = nullptr,
Value *RetVal = nullptr) { Value *RetVal = nullptr) {
return Insert(CleanupReturnInst::Create(Context, RetVal, UnwindBB)); return Insert(CleanupReturnInst::Create(Context, RetVal, UnwindBB));
} }
CatchPadInst *CreateCatchPad(Type *Ty, BasicBlock *NormalDest, CatchPadInst *CreateCatchPad(Type *Ty, BasicBlock *NormalDest,
BasicBlock *UnwindDest, BasicBlock *UnwindDest, ArrayRef<Value *> Args,
ArrayRef<Value *> Args, const Twine &Name = "") {
const Twine &Name = "") { return Insert(CatchPadInst::Create(Ty, NormalDest, UnwindDest, Args), Name);
return Insert(CatchPadInst::Create(Ty, NormalDest, UnwindDest, Args),
Name);
} }
CatchEndPadInst *CreateCatchEndPad(BasicBlock *UnwindBB = nullptr) { CatchEndPadInst *CreateCatchEndPad(BasicBlock *UnwindBB = nullptr) {
@ -690,13 +688,13 @@ public:
} }
TerminatePadInst *CreateTerminatePad(BasicBlock *UnwindBB = nullptr, TerminatePadInst *CreateTerminatePad(BasicBlock *UnwindBB = nullptr,
ArrayRef<Value *> Args = {}, ArrayRef<Value *> Args = {},
const Twine &Name = "") { const Twine &Name = "") {
return Insert(TerminatePadInst::Create(Context, UnwindBB, Args), Name); return Insert(TerminatePadInst::Create(Context, UnwindBB, Args), Name);
} }
CleanupPadInst *CreateCleanupPad(Type *Ty, ArrayRef<Value *> Args, CleanupPadInst *CreateCleanupPad(Type *Ty, ArrayRef<Value *> Args,
const Twine &Name = "") { const Twine &Name = "") {
return Insert(CleanupPadInst::Create(Ty, Args), Name); return Insert(CleanupPadInst::Create(Ty, Args), Name);
} }

View File

@ -3684,9 +3684,9 @@ class CatchEndPadInst : public TerminatorInst {
private: private:
void init(BasicBlock *UnwindBB); void init(BasicBlock *UnwindBB);
CatchEndPadInst(LLVMContext &C, BasicBlock *UnwindBB, unsigned Values, CatchEndPadInst(LLVMContext &C, BasicBlock *UnwindBB, unsigned Values,
Instruction *InsertBefore = nullptr); Instruction *InsertBefore = nullptr);
CatchEndPadInst(LLVMContext &C, BasicBlock *UnwindBB, unsigned Values, CatchEndPadInst(LLVMContext &C, BasicBlock *UnwindBB, unsigned Values,
BasicBlock *InsertAtEnd); BasicBlock *InsertAtEnd);
protected: protected:
// Note: Instruction needs to be a friend here to call cloneImpl. // Note: Instruction needs to be a friend here to call cloneImpl.
@ -3694,14 +3694,13 @@ protected:
CatchEndPadInst *cloneImpl() const; CatchEndPadInst *cloneImpl() const;
public: public:
static CatchEndPadInst *Create(LLVMContext &C, static CatchEndPadInst *Create(LLVMContext &C, BasicBlock *UnwindBB = nullptr,
BasicBlock *UnwindBB = nullptr, Instruction *InsertBefore = nullptr) {
Instruction *InsertBefore = nullptr) {
unsigned Values = UnwindBB ? 1 : 0; unsigned Values = UnwindBB ? 1 : 0;
return new (Values) CatchEndPadInst(C, UnwindBB, Values, InsertBefore); return new (Values) CatchEndPadInst(C, UnwindBB, Values, InsertBefore);
} }
static CatchEndPadInst *Create(LLVMContext &C, BasicBlock *UnwindBB, static CatchEndPadInst *Create(LLVMContext &C, BasicBlock *UnwindBB,
BasicBlock *InsertAtEnd) { BasicBlock *InsertAtEnd) {
unsigned Values = UnwindBB ? 1 : 0; unsigned Values = UnwindBB ? 1 : 0;
return new (Values) CatchEndPadInst(C, UnwindBB, Values, InsertAtEnd); return new (Values) CatchEndPadInst(C, UnwindBB, Values, InsertAtEnd);
} }
@ -3762,13 +3761,13 @@ private:
CatchPadInst(const CatchPadInst &CPI); CatchPadInst(const CatchPadInst &CPI);
explicit CatchPadInst(Type *RetTy, BasicBlock *IfNormal, explicit CatchPadInst(Type *RetTy, BasicBlock *IfNormal,
BasicBlock *IfException, ArrayRef<Value *> Args, BasicBlock *IfException, ArrayRef<Value *> Args,
unsigned Values, const Twine &NameStr, unsigned Values, const Twine &NameStr,
Instruction *InsertBefore); Instruction *InsertBefore);
explicit CatchPadInst(Type *RetTy, BasicBlock *IfNormal, explicit CatchPadInst(Type *RetTy, BasicBlock *IfNormal,
BasicBlock *IfException, ArrayRef<Value *> Args, BasicBlock *IfException, ArrayRef<Value *> Args,
unsigned Values, const Twine &NameStr, unsigned Values, const Twine &NameStr,
BasicBlock *InsertAtEnd); BasicBlock *InsertAtEnd);
protected: protected:
// Note: Instruction needs to be a friend here to call cloneImpl. // Note: Instruction needs to be a friend here to call cloneImpl.
@ -3777,19 +3776,19 @@ protected:
public: public:
static CatchPadInst *Create(Type *RetTy, BasicBlock *IfNormal, static CatchPadInst *Create(Type *RetTy, BasicBlock *IfNormal,
BasicBlock *IfException, ArrayRef<Value *> Args, BasicBlock *IfException, ArrayRef<Value *> Args,
const Twine &NameStr = "", const Twine &NameStr = "",
Instruction *InsertBefore = nullptr) { Instruction *InsertBefore = nullptr) {
unsigned Values = unsigned(Args.size()) + 2; unsigned Values = unsigned(Args.size()) + 2;
return new (Values) CatchPadInst(RetTy, IfNormal, IfException, Args, return new (Values) CatchPadInst(RetTy, IfNormal, IfException, Args, Values,
Values, NameStr, InsertBefore); NameStr, InsertBefore);
} }
static CatchPadInst *Create(Type *RetTy, BasicBlock *IfNormal, static CatchPadInst *Create(Type *RetTy, BasicBlock *IfNormal,
BasicBlock *IfException, ArrayRef<Value *> Args, BasicBlock *IfException, ArrayRef<Value *> Args,
const Twine &NameStr, BasicBlock *InsertAtEnd) { const Twine &NameStr, BasicBlock *InsertAtEnd) {
unsigned Values = unsigned(Args.size()) + 2; unsigned Values = unsigned(Args.size()) + 2;
return new (Values) CatchPadInst(RetTy, IfNormal, IfException, Args, return new (Values) CatchPadInst(RetTy, IfNormal, IfException, Args, Values,
Values, NameStr, InsertAtEnd); NameStr, InsertAtEnd);
} }
/// Provide fast operand accessors /// Provide fast operand accessors
@ -3992,9 +3991,9 @@ private:
CleanupPadInst(const CleanupPadInst &CPI); CleanupPadInst(const CleanupPadInst &CPI);
explicit CleanupPadInst(Type *RetTy, ArrayRef<Value *> Args, explicit CleanupPadInst(Type *RetTy, ArrayRef<Value *> Args,
const Twine &NameStr, Instruction *InsertBefore); const Twine &NameStr, Instruction *InsertBefore);
explicit CleanupPadInst(Type *RetTy, ArrayRef<Value *> Args, explicit CleanupPadInst(Type *RetTy, ArrayRef<Value *> Args,
const Twine &NameStr, BasicBlock *InsertAtEnd); const Twine &NameStr, BasicBlock *InsertAtEnd);
protected: protected:
// Note: Instruction needs to be a friend here to call cloneImpl. // Note: Instruction needs to be a friend here to call cloneImpl.
@ -4003,16 +4002,13 @@ protected:
public: public:
static CleanupPadInst *Create(Type *RetTy, ArrayRef<Value *> Args, static CleanupPadInst *Create(Type *RetTy, ArrayRef<Value *> Args,
const Twine &NameStr = "", const Twine &NameStr = "",
Instruction *InsertBefore = nullptr) { Instruction *InsertBefore = nullptr) {
return new (Args.size()) return new (Args.size()) CleanupPadInst(RetTy, Args, NameStr, InsertBefore);
CleanupPadInst(RetTy, Args, NameStr, InsertBefore);
} }
static CleanupPadInst *Create(Type *RetTy, ArrayRef<Value *> Args, static CleanupPadInst *Create(Type *RetTy, ArrayRef<Value *> Args,
const Twine &NameStr, const Twine &NameStr, BasicBlock *InsertAtEnd) {
BasicBlock *InsertAtEnd) { return new (Args.size()) CleanupPadInst(RetTy, Args, NameStr, InsertAtEnd);
return new (Args.size())
CleanupPadInst(RetTy, Args, NameStr, InsertAtEnd);
} }
/// Provide fast operand accessors /// Provide fast operand accessors