From e880ae9e1a0e634621516eb22055f8e087a1702d Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Sat, 8 Aug 2015 17:41:21 +0000 Subject: [PATCH] [IR] Cleanup some formatting issues in the EH instructions No functionality change is intended. llvm-svn: 244399 --- llvm/include/llvm/IR/IRBuilder.h | 16 +++++----- llvm/include/llvm/IR/Instructions.h | 58 +++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h index d02f41b..b9f8019 100644 --- a/llvm/include/llvm/IR/IRBuilder.h +++ b/llvm/include/llvm/IR/IRBuilder.h @@ -673,16 +673,14 @@ public: } CleanupReturnInst *CreateCleanupRet(BasicBlock *UnwindBB = nullptr, - Value *RetVal = nullptr) { + Value *RetVal = nullptr) { return Insert(CleanupReturnInst::Create(Context, RetVal, UnwindBB)); } CatchPadInst *CreateCatchPad(Type *Ty, BasicBlock *NormalDest, - BasicBlock *UnwindDest, - ArrayRef Args, - const Twine &Name = "") { - return Insert(CatchPadInst::Create(Ty, NormalDest, UnwindDest, Args), - Name); + BasicBlock *UnwindDest, ArrayRef Args, + const Twine &Name = "") { + return Insert(CatchPadInst::Create(Ty, NormalDest, UnwindDest, Args), Name); } CatchEndPadInst *CreateCatchEndPad(BasicBlock *UnwindBB = nullptr) { @@ -690,13 +688,13 @@ public: } TerminatePadInst *CreateTerminatePad(BasicBlock *UnwindBB = nullptr, - ArrayRef Args = {}, - const Twine &Name = "") { + ArrayRef Args = {}, + const Twine &Name = "") { return Insert(TerminatePadInst::Create(Context, UnwindBB, Args), Name); } CleanupPadInst *CreateCleanupPad(Type *Ty, ArrayRef Args, - const Twine &Name = "") { + const Twine &Name = "") { return Insert(CleanupPadInst::Create(Ty, Args), Name); } diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h index 5540829..bde5cba 100644 --- a/llvm/include/llvm/IR/Instructions.h +++ b/llvm/include/llvm/IR/Instructions.h @@ -3684,9 +3684,9 @@ class CatchEndPadInst : public TerminatorInst { private: void init(BasicBlock *UnwindBB); CatchEndPadInst(LLVMContext &C, BasicBlock *UnwindBB, unsigned Values, - Instruction *InsertBefore = nullptr); + Instruction *InsertBefore = nullptr); CatchEndPadInst(LLVMContext &C, BasicBlock *UnwindBB, unsigned Values, - BasicBlock *InsertAtEnd); + BasicBlock *InsertAtEnd); protected: // Note: Instruction needs to be a friend here to call cloneImpl. @@ -3694,14 +3694,13 @@ protected: CatchEndPadInst *cloneImpl() const; public: - static CatchEndPadInst *Create(LLVMContext &C, - BasicBlock *UnwindBB = nullptr, - Instruction *InsertBefore = nullptr) { + static CatchEndPadInst *Create(LLVMContext &C, BasicBlock *UnwindBB = nullptr, + Instruction *InsertBefore = nullptr) { unsigned Values = UnwindBB ? 1 : 0; return new (Values) CatchEndPadInst(C, UnwindBB, Values, InsertBefore); } static CatchEndPadInst *Create(LLVMContext &C, BasicBlock *UnwindBB, - BasicBlock *InsertAtEnd) { + BasicBlock *InsertAtEnd) { unsigned Values = UnwindBB ? 1 : 0; return new (Values) CatchEndPadInst(C, UnwindBB, Values, InsertAtEnd); } @@ -3762,13 +3761,13 @@ private: CatchPadInst(const CatchPadInst &CPI); explicit CatchPadInst(Type *RetTy, BasicBlock *IfNormal, - BasicBlock *IfException, ArrayRef Args, - unsigned Values, const Twine &NameStr, - Instruction *InsertBefore); + BasicBlock *IfException, ArrayRef Args, + unsigned Values, const Twine &NameStr, + Instruction *InsertBefore); explicit CatchPadInst(Type *RetTy, BasicBlock *IfNormal, - BasicBlock *IfException, ArrayRef Args, - unsigned Values, const Twine &NameStr, - BasicBlock *InsertAtEnd); + BasicBlock *IfException, ArrayRef Args, + unsigned Values, const Twine &NameStr, + BasicBlock *InsertAtEnd); protected: // Note: Instruction needs to be a friend here to call cloneImpl. @@ -3777,19 +3776,19 @@ protected: public: static CatchPadInst *Create(Type *RetTy, BasicBlock *IfNormal, - BasicBlock *IfException, ArrayRef Args, - const Twine &NameStr = "", - Instruction *InsertBefore = nullptr) { + BasicBlock *IfException, ArrayRef Args, + const Twine &NameStr = "", + Instruction *InsertBefore = nullptr) { unsigned Values = unsigned(Args.size()) + 2; - return new (Values) CatchPadInst(RetTy, IfNormal, IfException, Args, - Values, NameStr, InsertBefore); + return new (Values) CatchPadInst(RetTy, IfNormal, IfException, Args, Values, + NameStr, InsertBefore); } static CatchPadInst *Create(Type *RetTy, BasicBlock *IfNormal, - BasicBlock *IfException, ArrayRef Args, - const Twine &NameStr, BasicBlock *InsertAtEnd) { + BasicBlock *IfException, ArrayRef Args, + const Twine &NameStr, BasicBlock *InsertAtEnd) { unsigned Values = unsigned(Args.size()) + 2; - return new (Values) CatchPadInst(RetTy, IfNormal, IfException, Args, - Values, NameStr, InsertAtEnd); + return new (Values) CatchPadInst(RetTy, IfNormal, IfException, Args, Values, + NameStr, InsertAtEnd); } /// Provide fast operand accessors @@ -3992,9 +3991,9 @@ private: CleanupPadInst(const CleanupPadInst &CPI); explicit CleanupPadInst(Type *RetTy, ArrayRef Args, - const Twine &NameStr, Instruction *InsertBefore); + const Twine &NameStr, Instruction *InsertBefore); explicit CleanupPadInst(Type *RetTy, ArrayRef Args, - const Twine &NameStr, BasicBlock *InsertAtEnd); + const Twine &NameStr, BasicBlock *InsertAtEnd); protected: // Note: Instruction needs to be a friend here to call cloneImpl. @@ -4003,16 +4002,13 @@ protected: public: static CleanupPadInst *Create(Type *RetTy, ArrayRef Args, - const Twine &NameStr = "", - Instruction *InsertBefore = nullptr) { - return new (Args.size()) - CleanupPadInst(RetTy, Args, NameStr, InsertBefore); + const Twine &NameStr = "", + Instruction *InsertBefore = nullptr) { + return new (Args.size()) CleanupPadInst(RetTy, Args, NameStr, InsertBefore); } static CleanupPadInst *Create(Type *RetTy, ArrayRef Args, - const Twine &NameStr, - BasicBlock *InsertAtEnd) { - return new (Args.size()) - CleanupPadInst(RetTy, Args, NameStr, InsertAtEnd); + const Twine &NameStr, BasicBlock *InsertAtEnd) { + return new (Args.size()) CleanupPadInst(RetTy, Args, NameStr, InsertAtEnd); } /// Provide fast operand accessors -- 2.7.4