Index: docs/BitCodeFormat.rst =================================================================== --- docs/BitCodeFormat.rst +++ docs/BitCodeFormat.rst @@ -741,7 +741,7 @@ MODULE_CODE_FUNCTION Record ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prologuedata, dllstorageclass, comdat, prefixdata]`` +``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prologuedata, dllstorageclass, comdat, prefixdata, personalityfn]`` The ``FUNCTION`` record (code 8) marks the declaration or definition of a function. The operand fields are: @@ -795,6 +795,8 @@ * *prefixdata*: If non-zero, the value index of the prefix data for this function, plus 1. +* *personalityfn*: If non-zero, the value index of the personality function for this function, + plus 1. MODULE_CODE_ALIAS Record ^^^^^^^^^^^^^^^^^^^^^^^^ Index: docs/LangRef.rst =================================================================== --- docs/LangRef.rst +++ docs/LangRef.rst @@ -635,8 +635,9 @@ an optional section, an optional alignment, an optional :ref:`comdat `, an optional :ref:`garbage collector name `, an optional :ref:`prefix `, -an optional :ref:`prologue `, an opening -curly brace, a list of basic blocks, and a closing curly brace. +an optional :ref:`prologue `, +an optional :ref:`personality `, +an opening curly brace, a list of basic blocks, and a closing curly brace. LLVM function declarations consist of the "``declare``" keyword, an optional :ref:`linkage type `, an optional :ref:`visibility @@ -646,7 +647,8 @@ :ref:`parameter attribute ` for the return type, a function name, a possibly empty list of arguments, an optional alignment, an optional :ref:`garbage collector name `, an optional :ref:`prefix `, -and an optional :ref:`prologue `. +an optional :ref:`prologue `, +and an optional :ref:`personality `. A function definition contains a list of basic blocks, forming the CFG (Control Flow Graph) for the function. Each basic block may optionally start with a label @@ -683,7 +685,8 @@ [cconv] [ret attrs] @ ([argument list]) [unnamed_addr] [fn Attrs] [section "name"] [comdat [($name)]] - [align N] [gc] [prefix Constant] [prologue Constant] { ... } + [align N] [gc] [prefix Constant] [prologue Constant] + [personality Constant] { ... } The argument list is a comma seperated sequence of arguments where each argument is of the following form @@ -1130,6 +1133,14 @@ to the ``available_externally`` linkage in that the data may be used by the optimizers but will not be emitted in the object file. +.. _personalityfn: + +Personality Function +------------- + +The ``personality`` attribute permits functions to specify what function +to use for exception handling. + .. _attrgrp: Attribute Groups @@ -7274,8 +7285,8 @@ :: - = landingpad personality + - = landingpad personality cleanup * + = landingpad + + = landingpad cleanup * := catch := filter @@ -7287,14 +7298,13 @@ system `_ to specify that a basic block is a landing pad --- one where the exception lands, and corresponds to the code found in the ``catch`` portion of a ``try``/``catch`` sequence. It -defines values supplied by the personality function (``pers_fn``) upon +defines values supplied by the personality function upon re-entry to the function. The ``resultval`` has the type ``resultty``. Arguments: """""""""" -This instruction takes a ``pers_fn`` value. This is the personality -function associated with the unwinding mechanism. The optional +The optional ``cleanup`` flag indicates that the landing pad block is a cleanup. A ``clause`` begins with the clause type --- ``catch`` or ``filter`` --- and Index: include/llvm/Analysis/LibCallSemantics.h =================================================================== --- include/llvm/Analysis/LibCallSemantics.h +++ include/llvm/Analysis/LibCallSemantics.h @@ -207,7 +207,7 @@ llvm_unreachable("invalid enum"); } - bool canSimplifyInvokeNoUnwind(const InvokeInst *II); + bool canSimplifyInvokeNoUnwind(const Function *F); } // end namespace llvm Index: include/llvm/Bitcode/LLVMBitCodes.h =================================================================== --- include/llvm/Bitcode/LLVMBitCodes.h +++ include/llvm/Bitcode/LLVMBitCodes.h @@ -342,7 +342,7 @@ // align, vol, // ordering, synchscope] FUNC_CODE_INST_RESUME = 39, // RESUME: [opval] - FUNC_CODE_INST_LANDINGPAD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...] + FUNC_CODE_INST_LANDINGPAD_OLD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...] FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol, // ordering, synchscope] FUNC_CODE_INST_STOREATOMIC_OLD = 42, // STORE: [ptrty,ptr,val, align, vol @@ -352,6 +352,7 @@ FUNC_CODE_INST_STOREATOMIC = 45, // STORE: [ptrty,ptr,val, align, vol FUNC_CODE_INST_CMPXCHG = 46, // CMPXCHG: [ptrty,ptr,valty,cmp,new, align, // vol,ordering,synchscope] + FUNC_CODE_INST_LANDINGPAD = 47, // LANDINGPAD: [ty,val,num,id0,val0...] }; enum UseListCodes { Index: include/llvm/IR/Function.h =================================================================== --- include/llvm/IR/Function.h +++ include/llvm/IR/Function.h @@ -25,6 +25,7 @@ #include "llvm/IR/BasicBlock.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/GlobalObject.h" +#include "llvm/IR/OperandTraits.h" #include "llvm/Support/Compiler.h" namespace llvm { @@ -119,11 +120,22 @@ public: static Function *Create(FunctionType *Ty, LinkageTypes Linkage, const Twine &N = "", Module *M = nullptr) { - return new(0) Function(Ty, Linkage, N, M); + return new(1) Function(Ty, Linkage, N, M); } ~Function() override; + /// \brief Provide fast operand accessors + DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); + + /// \brief Get the personality function associated with this function. + bool hasPersonalityFn() const { return getNumOperands() != 0; } + Constant *getPersonalityFn() const { + assert(hasPersonalityFn()); + return cast(Op<0>()); + } + void setPersonalityFn(Constant *C); + Type *getReturnType() const; // Return the type of the ret val FunctionType *getFunctionType() const; // Return the FunctionType for me @@ -601,6 +613,11 @@ return F ? &F->getValueSymbolTable() : nullptr; } +template <> +struct OperandTraits : public OptionalOperandTraits {}; + +DEFINE_TRANSPARENT_OPERAND_ACCESSORS(Function, Value) + } // End llvm namespace #endif Index: include/llvm/IR/IRBuilder.h =================================================================== --- include/llvm/IR/IRBuilder.h +++ include/llvm/IR/IRBuilder.h @@ -1556,9 +1556,9 @@ return Insert(InsertValueInst::Create(Agg, Val, Idxs), Name); } - LandingPadInst *CreateLandingPad(Type *Ty, Value *PersFn, unsigned NumClauses, + LandingPadInst *CreateLandingPad(Type *Ty, unsigned NumClauses, const Twine &Name = "") { - return Insert(LandingPadInst::Create(Ty, PersFn, NumClauses), Name); + return Insert(LandingPadInst::Create(Ty, NumClauses), Name); } //===--------------------------------------------------------------------===// Index: include/llvm/IR/Instructions.h =================================================================== --- include/llvm/IR/Instructions.h +++ include/llvm/IR/Instructions.h @@ -2437,34 +2437,27 @@ return User::operator new(s); } void growOperands(unsigned Size); - void init(Value *PersFn, unsigned NumReservedValues, const Twine &NameStr); + void init(unsigned NumReservedValues, const Twine &NameStr); + + explicit LandingPadInst(Type *RetTy, unsigned NumReservedValues, + const Twine &NameStr, Instruction *InsertBefore); + explicit LandingPadInst(Type *RetTy, unsigned NumReservedValues, + const Twine &NameStr, BasicBlock *InsertAtEnd); - explicit LandingPadInst(Type *RetTy, Value *PersonalityFn, - unsigned NumReservedValues, const Twine &NameStr, - Instruction *InsertBefore); - explicit LandingPadInst(Type *RetTy, Value *PersonalityFn, - unsigned NumReservedValues, const Twine &NameStr, - BasicBlock *InsertAtEnd); protected: LandingPadInst *clone_impl() const override; public: /// Constructors - NumReservedClauses is a hint for the number of incoming /// clauses that this landingpad will have (use 0 if you really have no idea). - static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn, - unsigned NumReservedClauses, + static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses, const Twine &NameStr = "", Instruction *InsertBefore = nullptr); - static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn, - unsigned NumReservedClauses, + static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses, const Twine &NameStr, BasicBlock *InsertAtEnd); /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); - /// getPersonalityFn - Get the personality function associated with this - /// landing pad. - Value *getPersonalityFn() const { return getOperand(0); } - /// isCleanup - Return 'true' if this landingpad instruction is a /// cleanup. I.e., it should be run when unwinding even if its landing pad /// doesn't catch the exception. @@ -2482,21 +2475,21 @@ /// Get the value of the clause at index Idx. Use isCatch/isFilter to /// determine what type of clause this is. Constant *getClause(unsigned Idx) const { - return cast(getOperandList()[Idx + 1]); + return cast(getOperandList()[Idx]); } /// isCatch - Return 'true' if the clause and index Idx is a catch clause. bool isCatch(unsigned Idx) const { - return !isa(getOperandList()[Idx + 1]->getType()); + return !isa(getOperandList()[Idx]->getType()); } /// isFilter - Return 'true' if the clause and index Idx is a filter clause. bool isFilter(unsigned Idx) const { - return isa(getOperandList()[Idx + 1]->getType()); + return isa(getOperandList()[Idx]->getType()); } /// getNumClauses - Get the number of clauses for this landing pad. - unsigned getNumClauses() const { return getNumOperands() - 1; } + unsigned getNumClauses() const { return getNumOperands(); } /// reserveClauses - Grow the size of the operand list to accommodate the new /// number of clauses. @@ -2512,7 +2505,7 @@ }; template <> -struct OperandTraits : public HungoffOperandTraits<2> { +struct OperandTraits : public HungoffOperandTraits<1> { }; DEFINE_TRANSPARENT_OPERAND_ACCESSORS(LandingPadInst, Value) Index: include/llvm/IR/User.h =================================================================== --- include/llvm/IR/User.h +++ include/llvm/IR/User.h @@ -149,6 +149,19 @@ NumUserOperands = NumOps; } + /// Set the number of operands on a Function. + /// + /// Function always allocates space for a single operands, but + /// doesn't always use it. + /// + /// FIXME: As that the number of operands is used to find the start of + /// the allocated memory in operator delete, we need to always think we have + /// 1 operand before delete. + void setFunctionNumOperands(unsigned NumOps) { + assert(NumOps <= 1 && "Function can only have 0 or 1 operands"); + NumUserOperands = NumOps; + } + /// \brief Subclasses with hung off uses need to manage the operand count /// themselves. In these instances, the operand count isn't used to find the /// OperandList, so there's no issue in having the operand count change. Index: lib/Analysis/LibCallSemantics.cpp =================================================================== --- lib/Analysis/LibCallSemantics.cpp +++ lib/Analysis/LibCallSemantics.cpp @@ -80,9 +80,8 @@ .Default(EHPersonality::Unknown); } -bool llvm::canSimplifyInvokeNoUnwind(const InvokeInst *II) { - const LandingPadInst *LP = II->getLandingPadInst(); - EHPersonality Personality = classifyEHPersonality(LP->getPersonalityFn()); +bool llvm::canSimplifyInvokeNoUnwind(const Function *F) { + EHPersonality Personality = classifyEHPersonality(F->getPersonalityFn()); // We can't simplify any invokes to nounwind functions if the personality // function wants to catch asynch exceptions. The nounwind attribute only // implies that the function does not throw synchronous exceptions. Index: lib/AsmParser/LLParser.cpp =================================================================== --- lib/AsmParser/LLParser.cpp +++ lib/AsmParser/LLParser.cpp @@ -4051,7 +4051,7 @@ /// FunctionHeader /// ::= OptionalLinkage OptionalVisibility OptionalCallingConv OptRetAttrs /// OptUnnamedAddr Type GlobalName '(' ArgList ')' OptFuncAttrs OptSection -/// OptionalAlign OptGC OptionalPrefix OptionalPrologue +/// OptionalAlign OptGC OptionalPrefix OptionalPrologue OptPersonalityFn bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) { // Parse the linkage. LocTy LinkageLoc = Lex.getLoc(); @@ -4133,6 +4133,7 @@ LocTy UnnamedAddrLoc; Constant *Prefix = nullptr; Constant *Prologue = nullptr; + Constant *PersonalityFn = nullptr; Comdat *C; if (ParseArgumentList(ArgList, isVarArg) || @@ -4149,7 +4150,9 @@ (EatIfPresent(lltok::kw_prefix) && ParseGlobalTypeAndValue(Prefix)) || (EatIfPresent(lltok::kw_prologue) && - ParseGlobalTypeAndValue(Prologue))) + ParseGlobalTypeAndValue(Prologue)) || + (EatIfPresent(lltok::kw_personality) && + ParseGlobalTypeAndValue(PersonalityFn))) return true; if (FuncAttrs.contains(Attribute::Builtin)) @@ -4248,6 +4251,7 @@ Fn->setAlignment(Alignment); Fn->setSection(Section); Fn->setComdat(C); + Fn->setPersonalityFn(PersonalityFn); if (!GC.empty()) Fn->setGC(GC.c_str()); Fn->setPrefixData(Prefix); Fn->setPrologueData(Prologue); @@ -5099,14 +5103,11 @@ /// ::= 'filter' TypeAndValue ( ',' TypeAndValue )* bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) { Type *Ty = nullptr; LocTy TyLoc; - Value *PersFn; LocTy PersFnLoc; - if (ParseType(Ty, TyLoc) || - ParseToken(lltok::kw_personality, "expected 'personality'") || - ParseTypeAndValue(PersFn, PersFnLoc, PFS)) + if (ParseType(Ty, TyLoc)) return true; - std::unique_ptr LP(LandingPadInst::Create(Ty, PersFn, 0)); + std::unique_ptr LP(LandingPadInst::Create(Ty, 0)); LP->setCleanup(EatIfPresent(lltok::kw_cleanup)); while (Lex.getKind() == lltok::kw_catch || Lex.getKind() == lltok::kw_filter){ Index: lib/Bitcode/Reader/BitcodeReader.cpp =================================================================== --- lib/Bitcode/Reader/BitcodeReader.cpp +++ lib/Bitcode/Reader/BitcodeReader.cpp @@ -150,6 +150,7 @@ std::vector > AliasInits; std::vector > FunctionPrefixes; std::vector > FunctionPrologues; + std::vector > FunctionPersonalityFns; SmallVector InstsWithTBAATag; @@ -2040,11 +2041,13 @@ std::vector > AliasInitWorklist; std::vector > FunctionPrefixWorklist; std::vector > FunctionPrologueWorklist; + std::vector > FunctionPersonalityFnWorklist; GlobalInitWorklist.swap(GlobalInits); AliasInitWorklist.swap(AliasInits); FunctionPrefixWorklist.swap(FunctionPrefixes); FunctionPrologueWorklist.swap(FunctionPrologues); + FunctionPersonalityFnWorklist.swap(FunctionPersonalityFns); while (!GlobalInitWorklist.empty()) { unsigned ValID = GlobalInitWorklist.back().second; @@ -2102,6 +2105,19 @@ FunctionPrologueWorklist.pop_back(); } + while (!FunctionPersonalityFnWorklist.empty()) { + unsigned ValID = FunctionPersonalityFnWorklist.back().second; + if (ValID >= ValueList.size()) { + FunctionPersonalityFns.push_back(FunctionPersonalityFnWorklist.back()); + } else { + if (Constant *C = dyn_cast_or_null(ValueList[ValID])) + FunctionPersonalityFnWorklist.back().first->setPersonalityFn(C); + else + return Error("Expected a constant"); + } + FunctionPersonalityFnWorklist.pop_back(); + } + return std::error_code(); } @@ -3033,6 +3049,9 @@ if (Record.size() > 13 && Record[13] != 0) FunctionPrefixes.push_back(std::make_pair(Func, Record[13]-1)); + if (Record.size() > 14 && Record[14] != 0) + FunctionPersonalityFns.push_back(std::make_pair(Func, Record[14] - 1)); + ValueList.push_back(Func); // If this is a function with a body, remember the prototype we are @@ -4021,21 +4040,32 @@ break; } - case bitc::FUNC_CODE_INST_LANDINGPAD: { + case bitc::FUNC_CODE_INST_LANDINGPAD: + case bitc::FUNC_CODE_INST_LANDINGPAD_OLD: { // LANDINGPAD: [ty, val, val, num, (id0,val0 ...)?] unsigned Idx = 0; - if (Record.size() < 4) - return Error("Invalid record"); + if (BitCode == bitc::FUNC_CODE_INST_LANDINGPAD) { + if (Record.size() < 3) + return Error("Invalid record"); + } else { + assert(BitCode == bitc::FUNC_CODE_INST_LANDINGPAD_OLD); + if (Record.size() < 4) + return Error("Invalid record"); + } Type *Ty = getTypeByID(Record[Idx++]); if (!Ty) return Error("Invalid record"); - Value *PersFn = nullptr; - if (getValueTypePair(Record, Idx, NextValueNo, PersFn)) - return Error("Invalid record"); + if (BitCode == bitc::FUNC_CODE_INST_LANDINGPAD_OLD) { + Value *PersFn = nullptr; + if (getValueTypePair(Record, Idx, NextValueNo, PersFn)) + return Error("Invalid record"); + + F->setPersonalityFn(cast(PersFn)); + } bool IsCleanup = !!Record[Idx++]; unsigned NumClauses = Record[Idx++]; - LandingPadInst *LP = LandingPadInst::Create(Ty, PersFn, NumClauses); + LandingPadInst *LP = LandingPadInst::Create(Ty, NumClauses); LP->setCleanup(IsCleanup); for (unsigned J = 0; J != NumClauses; ++J) { LandingPadInst::ClauseType CT = Index: lib/Bitcode/Writer/BitcodeWriter.cpp =================================================================== --- lib/Bitcode/Writer/BitcodeWriter.cpp +++ lib/Bitcode/Writer/BitcodeWriter.cpp @@ -693,7 +693,7 @@ for (const Function &F : *M) { // FUNCTION: [type, callingconv, isproto, linkage, paramattrs, alignment, // section, visibility, gc, unnamed_addr, prologuedata, - // dllstorageclass, comdat, prefixdata] + // dllstorageclass, comdat, prefixdata, personalityfn] Vals.push_back(VE.getTypeID(F.getFunctionType())); Vals.push_back(F.getCallingConv()); Vals.push_back(F.isDeclaration()); @@ -710,6 +710,8 @@ Vals.push_back(F.hasComdat() ? VE.getComdatID(F.getComdat()) : 0); Vals.push_back(F.hasPrefixData() ? (VE.getValueID(F.getPrefixData()) + 1) : 0); + Vals.push_back( + F.hasPersonalityFn() ? (VE.getValueID(F.getPersonalityFn()) + 1) : 0); unsigned AbbrevToUse = 0; Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse); @@ -1857,7 +1859,6 @@ const LandingPadInst &LP = cast(I); Code = bitc::FUNC_CODE_INST_LANDINGPAD; Vals.push_back(VE.getTypeID(LP.getType())); - PushValueAndType(LP.getPersonalityFn(), InstID, Vals, VE); Vals.push_back(LP.isCleanup()); Vals.push_back(LP.getNumClauses()); for (unsigned I = 0, E = LP.getNumClauses(); I != E; ++I) { Index: lib/Bitcode/Writer/ValueEnumerator.cpp =================================================================== --- lib/Bitcode/Writer/ValueEnumerator.cpp +++ lib/Bitcode/Writer/ValueEnumerator.cpp @@ -93,6 +93,9 @@ if (F.hasPrologueData()) if (!isa(F.getPrologueData())) orderValue(F.getPrologueData(), OM); + if (F.hasPersonalityFn()) + if (!isa(F.getPersonalityFn())) + orderValue(F.getPersonalityFn(), OM); } OM.LastGlobalConstantID = OM.size(); @@ -274,6 +277,8 @@ predictValueUseListOrder(F.getPrefixData(), nullptr, OM, Stack); if (F.hasPrologueData()) predictValueUseListOrder(F.getPrologueData(), nullptr, OM, Stack); + if (F.hasPersonalityFn()) + predictValueUseListOrder(F.getPersonalityFn(), nullptr, OM, Stack); } return Stack; @@ -326,6 +331,11 @@ if (F.hasPrologueData()) EnumerateValue(F.getPrologueData()); + // Enumerate the personality functions. + for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I) + if (I->hasPersonalityFn()) + EnumerateValue(I->getPersonalityFn()); + // Enumerate the metadata type. // // TODO: Move this to ValueEnumerator::EnumerateOperandType() once bitcode Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp =================================================================== --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -547,6 +547,10 @@ if (F->hasPrefixData()) EmitGlobalConstant(F->getPrefixData()); + // Emit the personality function. + if (F->hasPersonalityFn()) + EmitGlobalConstant(F->getPersonalityFn()); + // Emit the CurrentFnSym. This is a virtual function to allow targets to // do their wild and crazy things as required. EmitFunctionEntryLabel(); Index: lib/CodeGen/DwarfEHPrepare.cpp =================================================================== --- lib/CodeGen/DwarfEHPrepare.cpp +++ lib/CodeGen/DwarfEHPrepare.cpp @@ -181,27 +181,22 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls(Function &Fn) { SmallVector Resumes; SmallVector CleanupLPads; - bool FoundLP = false; for (BasicBlock &BB : Fn) { if (auto *RI = dyn_cast(BB.getTerminator())) Resumes.push_back(RI); - if (auto *LP = BB.getLandingPadInst()) { + if (auto *LP = BB.getLandingPadInst()) if (LP->isCleanup()) CleanupLPads.push_back(LP); - // Check the personality on the first landingpad. Don't do anything if - // it's for MSVC. - if (!FoundLP) { - FoundLP = true; - EHPersonality Pers = classifyEHPersonality(LP->getPersonalityFn()); - if (isMSVCEHPersonality(Pers)) - return false; - } - } } if (Resumes.empty()) return false; + // Check the personality, don't do anything if it's for MSVC. + EHPersonality Pers = classifyEHPersonality(Fn.getPersonalityFn()); + if (isMSVCEHPersonality(Pers)) + return false; + LLVMContext &Ctx = Fn.getContext(); size_t ResumesLeft = pruneUnreachableResumes(Fn, Resumes, CleanupLPads); Index: lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp =================================================================== --- lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -259,8 +259,8 @@ // If this is an MSVC EH personality, we need to do a bit more work. EHPersonality Personality = EHPersonality::Unknown; - if (!LPads.empty()) - Personality = classifyEHPersonality(LPads.back()->getPersonalityFn()); + if (Fn->hasPersonalityFn()) + Personality = classifyEHPersonality(Fn->getPersonalityFn()); if (!isMSVCEHPersonality(Personality)) return; @@ -546,8 +546,10 @@ /// landingpad instruction and add them to the specified machine module info. void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI, MachineBasicBlock *MBB) { - MMI.addPersonality(MBB, - cast(I.getPersonalityFn()->stripPointerCasts())); + MMI.addPersonality( + MBB, + cast( + I.getParent()->getParent()->getPersonalityFn()->stripPointerCasts())); if (I.isCleanup()) MMI.addCleanup(MBB); Index: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -938,8 +938,10 @@ // pad into several BBs. const BasicBlock *LLVMBB = MBB->getBasicBlock(); const LandingPadInst *LPadInst = LLVMBB->getLandingPadInst(); - MF->getMMI().addPersonality( - MBB, cast(LPadInst->getPersonalityFn()->stripPointerCasts())); + MF->getMMI().addPersonality(MBB, cast(LPadInst->getParent() + ->getParent() + ->getPersonalityFn() + ->stripPointerCasts())); EHPersonality Personality = MF->getMMI().getPersonalityType(); if (isMSVCEHPersonality(Personality)) { Index: lib/CodeGen/ShadowStackGCLowering.cpp =================================================================== --- lib/CodeGen/ShadowStackGCLowering.cpp +++ lib/CodeGen/ShadowStackGCLowering.cpp @@ -144,10 +144,14 @@ BasicBlock *CleanupBB = BasicBlock::Create(C, CleanupBBName, &F); Type *ExnTy = StructType::get(Type::getInt8PtrTy(C), Type::getInt32Ty(C), nullptr); - Constant *PersFn = F.getParent()->getOrInsertFunction( - "__gcc_personality_v0", FunctionType::get(Type::getInt32Ty(C), true)); + if (!F.hasPersonalityFn()) { + Constant *PersFn = F.getParent()->getOrInsertFunction( + "__gcc_personality_v0", + FunctionType::get(Type::getInt32Ty(C), true)); + F.setPersonalityFn(PersFn); + } LandingPadInst *LPad = - LandingPadInst::Create(ExnTy, PersFn, 1, "cleanup.lpad", CleanupBB); + LandingPadInst::Create(ExnTy, 1, "cleanup.lpad", CleanupBB); LPad->setCleanup(true); ResumeInst *RI = ResumeInst::Create(LPad, CleanupBB); Index: lib/CodeGen/SjLjEHPrepare.cpp =================================================================== --- lib/CodeGen/SjLjEHPrepare.cpp +++ lib/CodeGen/SjLjEHPrepare.cpp @@ -227,7 +227,7 @@ // Personality function IRBuilder<> Builder(EntryBB->getTerminator()); if (!PersonalityFn) - PersonalityFn = LPads[0]->getPersonalityFn(); + PersonalityFn = F.getPersonalityFn(); Value *PersonalityFieldPtr = Builder.CreateConstGEP2_32( FunctionContextTy, FuncCtx, 0, 3, "pers_fn_gep"); Builder.CreateStore( Index: lib/CodeGen/WinEHPrepare.cpp =================================================================== --- lib/CodeGen/WinEHPrepare.cpp +++ lib/CodeGen/WinEHPrepare.cpp @@ -111,7 +111,7 @@ bool outlineHandler(ActionHandler *Action, Function *SrcFn, LandingPadInst *LPad, BasicBlock *StartBB, FrameVarInfoMap &VarInfo); - void addStubInvokeToHandlerIfNeeded(Function *Handler, Value *PersonalityFn); + void addStubInvokeToHandlerIfNeeded(Function *Handler); void mapLandingPadBlocks(LandingPadInst *LPad, LandingPadActions &Actions); CatchHandler *findCatchHandler(BasicBlock *BB, BasicBlock *&NextBB, @@ -379,7 +379,7 @@ return false; // Classify the personality to see what kind of preparation we need. - Personality = classifyEHPersonality(LPads.back()->getPersonalityFn()); + Personality = classifyEHPersonality(Fn.getPersonalityFn()); // Do nothing if this is not an MSVC personality. if (!isMSVCEHPersonality(Personality)) @@ -1265,8 +1265,7 @@ return false; } -static BasicBlock *createStubLandingPad(Function *Handler, - Value *PersonalityFn) { +static BasicBlock *createStubLandingPad(Function *Handler) { // FIXME: Finish this! LLVMContext &Context = Handler->getContext(); BasicBlock *StubBB = BasicBlock::Create(Context, "stub"); @@ -1275,7 +1274,7 @@ LandingPadInst *LPad = Builder.CreateLandingPad( llvm::StructType::get(Type::getInt8PtrTy(Context), Type::getInt32Ty(Context), nullptr), - PersonalityFn, 0); + 0); // Insert a call to llvm.eh.actions so that we don't try to outline this lpad. Function *ActionIntrin = Intrinsic::getDeclaration(Handler->getParent(), Intrinsic::eh_actions); @@ -1290,8 +1289,7 @@ // landing pad if none is found. The code that generates the .xdata tables for // the handler needs at least one landing pad to identify the parent function's // personality. -void WinEHPrepare::addStubInvokeToHandlerIfNeeded(Function *Handler, - Value *PersonalityFn) { +void WinEHPrepare::addStubInvokeToHandlerIfNeeded(Function *Handler) { ReturnInst *Ret = nullptr; UnreachableInst *Unreached = nullptr; for (BasicBlock &BB : *Handler) { @@ -1323,7 +1321,7 @@ // parent block. We want to replace that with an invoke call, so we can // erase it now. OldRetBB->getTerminator()->eraseFromParent(); - BasicBlock *StubLandingPad = createStubLandingPad(Handler, PersonalityFn); + BasicBlock *StubLandingPad = createStubLandingPad(Handler); Function *F = Intrinsic::getDeclaration(Handler->getParent(), Intrinsic::donothing); InvokeInst::Create(F, NewRetBB, StubLandingPad, None, "", OldRetBB); @@ -1379,6 +1377,7 @@ Handler = createHandlerFunc(Type::getVoidTy(Context), SrcFn->getName() + ".cleanup", M, ParentFP); } + Handler->setPersonalityFn(SrcFn->getPersonalityFn()); HandlerToParentFP[Handler] = ParentFP; Handler->addFnAttr("wineh-parent", SrcFn->getName()); BasicBlock *Entry = &Handler->getEntryBlock(); @@ -1456,7 +1455,7 @@ ClonedEntryBB->eraseFromParent(); // Make sure we can identify the handler's personality later. - addStubInvokeToHandlerIfNeeded(Handler, LPad->getPersonalityFn()); + addStubInvokeToHandlerIfNeeded(Handler); if (auto *CatchAction = dyn_cast(Action)) { WinEHCatchDirector *CatchDirector = Index: lib/IR/AsmWriter.cpp =================================================================== --- lib/IR/AsmWriter.cpp +++ lib/IR/AsmWriter.cpp @@ -109,6 +109,10 @@ if (!isa(F.getPrologueData())) orderValue(F.getPrologueData(), OM); + if (F.hasPersonalityFn()) + if (!isa(F.getPersonalityFn())) + orderValue(F.getPersonalityFn(), OM); + orderValue(&F, OM); if (F.isDeclaration()) @@ -2544,6 +2548,10 @@ Out << " prologue "; writeOperand(F->getPrologueData(), true); } + if (F->hasPersonalityFn()) { + Out << " personality "; + writeOperand(F->getPersonalityFn(), /*PrintType=*/true); + } SmallVector, 4> MDs; F->getAllMetadata(MDs); @@ -2786,8 +2794,8 @@ } else if (const LandingPadInst *LPI = dyn_cast(&I)) { Out << ' '; TypePrinter.print(I.getType(), Out); - Out << " personality "; - writeOperand(I.getOperand(0), true); Out << '\n'; + if (LPI->isCleanup() || LPI->getNumClauses() != 0) + Out << '\n'; if (LPI->isCleanup()) Out << " cleanup"; Index: lib/IR/Core.cpp =================================================================== --- lib/IR/Core.cpp +++ lib/IR/Core.cpp @@ -2249,11 +2249,8 @@ } LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, - LLVMValueRef PersFn, unsigned NumClauses, - const char *Name) { - return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), - cast(unwrap(PersFn)), - NumClauses, Name)); + unsigned NumClauses, const char *Name) { + return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name)); } LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn) { Index: lib/IR/Function.cpp =================================================================== --- lib/IR/Function.cpp +++ lib/IR/Function.cpp @@ -248,8 +248,8 @@ Function::Function(FunctionType *Ty, LinkageTypes Linkage, const Twine &name, Module *ParentModule) - : GlobalObject(PointerType::getUnqual(Ty), Value::FunctionVal, nullptr, 0, - Linkage, name), + : GlobalObject(PointerType::getUnqual(Ty), Value::FunctionVal, + OperandTraits::op_begin(this), 0, Linkage, name), Ty(Ty) { assert(FunctionType::isValidReturnType(getReturnType()) && "invalid return type"); @@ -279,6 +279,9 @@ // Remove the function from the on-the-side GC table. clearGC(); + + // FIXME: needed by operator delete + setFunctionNumOperands(1); } void Function::BuildLazyArguments() const { @@ -331,6 +334,8 @@ // Metadata is stored in a side-table. clearMetadata(); + + setPersonalityFn(nullptr); } void Function::addAttribute(unsigned i, Attribute::AttrKind attr) { @@ -426,6 +431,10 @@ setPrologueData(SrcF->getPrologueData()); else setPrologueData(nullptr); + if (SrcF->hasPersonalityFn()) + setPersonalityFn(SrcF->getPersonalityFn()); + else + setPersonalityFn(nullptr); } /// \brief This does the actual lookup of an intrinsic ID which @@ -976,3 +985,22 @@ } return None; } + +void Function::setPersonalityFn(Constant *C) { + if (!C) { + if (hasPersonalityFn()) { + // Note, the num operands is used to compute the offset of the operand, so + // the order here matters. Clearing the operand then clearing the num + // operands ensures we have the correct offset to the operand. + Op<0>().set(nullptr); + setFunctionNumOperands(0); + } + } else { + // Note, the num operands is used to compute the offset of the operand, so + // the order here matters. We need to set num operands to 1 first so that + // we get the correct offset to the first operand when we set it. + if (!hasPersonalityFn()) + setFunctionNumOperands(1); + Op<0>().set(C); + } +} Index: lib/IR/Instructions.cpp =================================================================== --- lib/IR/Instructions.cpp +++ lib/IR/Instructions.cpp @@ -153,18 +153,16 @@ // LandingPadInst Implementation //===----------------------------------------------------------------------===// -LandingPadInst::LandingPadInst(Type *RetTy, Value *PersonalityFn, - unsigned NumReservedValues, const Twine &NameStr, - Instruction *InsertBefore) - : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertBefore) { - init(PersonalityFn, 1 + NumReservedValues, NameStr); +LandingPadInst::LandingPadInst(Type *RetTy, unsigned NumReservedValues, + const Twine &NameStr, Instruction *InsertBefore) + : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertBefore) { + init(1 + NumReservedValues, NameStr); } -LandingPadInst::LandingPadInst(Type *RetTy, Value *PersonalityFn, - unsigned NumReservedValues, const Twine &NameStr, - BasicBlock *InsertAtEnd) - : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertAtEnd) { - init(PersonalityFn, 1 + NumReservedValues, NameStr); +LandingPadInst::LandingPadInst(Type *RetTy, unsigned NumReservedValues, + const Twine &NameStr, BasicBlock *InsertAtEnd) + : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertAtEnd) { + init(1 + NumReservedValues, NameStr); } LandingPadInst::LandingPadInst(const LandingPadInst &LP) @@ -180,28 +178,22 @@ setCleanup(LP.isCleanup()); } -LandingPadInst *LandingPadInst::Create(Type *RetTy, Value *PersonalityFn, - unsigned NumReservedClauses, +LandingPadInst *LandingPadInst::Create(Type *RetTy, unsigned NumReservedClauses, const Twine &NameStr, Instruction *InsertBefore) { - return new LandingPadInst(RetTy, PersonalityFn, NumReservedClauses, NameStr, - InsertBefore); + return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertBefore); } -LandingPadInst *LandingPadInst::Create(Type *RetTy, Value *PersonalityFn, - unsigned NumReservedClauses, +LandingPadInst *LandingPadInst::Create(Type *RetTy, unsigned NumReservedClauses, const Twine &NameStr, BasicBlock *InsertAtEnd) { - return new LandingPadInst(RetTy, PersonalityFn, NumReservedClauses, NameStr, - InsertAtEnd); + return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertAtEnd); } -void LandingPadInst::init(Value *PersFn, unsigned NumReservedValues, - const Twine &NameStr) { +void LandingPadInst::init(unsigned NumReservedValues, const Twine &NameStr) { ReservedSpace = NumReservedValues; - setNumHungOffUseOperands(1); + setNumHungOffUseOperands(0); allocHungoffUses(ReservedSpace); - Op<0>() = PersFn; setName(NameStr); setCleanup(false); } @@ -211,7 +203,7 @@ void LandingPadInst::growOperands(unsigned Size) { unsigned e = getNumOperands(); if (ReservedSpace >= e + Size) return; - ReservedSpace = (e + Size / 2) * 2; + ReservedSpace = (std::max(e, 1U) + Size / 2) * 2; growHungoffUses(ReservedSpace); } Index: lib/IR/TypeFinder.cpp =================================================================== --- lib/IR/TypeFinder.cpp +++ lib/IR/TypeFinder.cpp @@ -50,6 +50,9 @@ if (FI->hasPrologueData()) incorporateValue(FI->getPrologueData()); + if (FI->hasPersonalityFn()) + incorporateValue(FI->getPersonalityFn()); + // First incorporate the arguments. for (Function::const_arg_iterator AI = FI->arg_begin(), AE = FI->arg_end(); AI != AE; ++AI) Index: lib/IR/Verifier.cpp =================================================================== --- lib/IR/Verifier.cpp +++ lib/IR/Verifier.cpp @@ -181,11 +181,6 @@ /// \brief Track unresolved string-based type references. SmallDenseMap UnresolvedTypeRefs; - /// \brief The personality function referenced by the LandingPadInsts. - /// All LandingPadInsts within the same function must use the same - /// personality function. - const Value *PersonalityFn; - /// \brief Whether we've seen a call to @llvm.frameescape in this function /// already. bool SawFrameEscape; @@ -196,8 +191,7 @@ public: explicit Verifier(raw_ostream &OS) - : VerifierSupport(OS), Context(nullptr), PersonalityFn(nullptr), - SawFrameEscape(false) {} + : VerifierSupport(OS), Context(nullptr), SawFrameEscape(false) {} bool verify(const Function &F) { M = F.getParent(); @@ -231,7 +225,6 @@ // FIXME: We strip const here because the inst visitor strips const. visit(const_cast(F)); InstsInThisBlock.clear(); - PersonalityFn = nullptr; SawFrameEscape = false; return !Broken; @@ -2795,22 +2788,16 @@ &LPI); } + Function *F = LPI.getParent()->getParent(); + Assert(F->hasPersonalityFn(), + "LandingPadInst needs to be in a function with a personality.", &LPI); + // The landingpad instruction must be the first non-PHI instruction in the // block. Assert(LPI.getParent()->getLandingPadInst() == &LPI, "LandingPadInst not the first non-PHI instruction in the block.", &LPI); - // The personality functions for all landingpad instructions within the same - // function should match. - if (PersonalityFn) - Assert(LPI.getPersonalityFn() == PersonalityFn, - "Personality function doesn't match others in function", &LPI); - PersonalityFn = LPI.getPersonalityFn(); - - // All operands must be constants. - Assert(isa(PersonalityFn), "Personality function is not constant!", - &LPI); for (unsigned i = 0, e = LPI.getNumClauses(); i < e; ++i) { Constant *Clause = LPI.getClause(i); if (LPI.isCatch(i)) { Index: lib/Linker/LinkModules.cpp =================================================================== --- lib/Linker/LinkModules.cpp +++ lib/Linker/LinkModules.cpp @@ -1194,6 +1194,11 @@ Dst.setPrologueData(MapValue(Src.getPrologueData(), ValueMap, RF_None, &TypeMap, &ValMaterializer)); + // Link in the personality function. + if (Src.hasPersonalityFn()) + Dst.setPersonalityFn(MapValue(Src.getPersonalityFn(), ValueMap, RF_None, + &TypeMap, &ValMaterializer)); + // Go through and convert function arguments over, remembering the mapping. Function::arg_iterator DI = Dst.arg_begin(); for (Argument &Arg : Src.args()) { Index: lib/Target/X86/X86WinEHState.cpp =================================================================== --- lib/Target/X86/X86WinEHState.cpp +++ lib/Target/X86/X86WinEHState.cpp @@ -146,16 +146,10 @@ return false; // Check the personality. Do nothing if this is not an MSVC personality. - LandingPadInst *LP = nullptr; - for (BasicBlock &BB : F) { - LP = BB.getLandingPadInst(); - if (LP) - break; - } - if (!LP) + if (!F.hasPersonalityFn()) return false; PersonalityFn = - dyn_cast(LP->getPersonalityFn()->stripPointerCasts()); + dyn_cast(F.getPersonalityFn()->stripPointerCasts()); if (!PersonalityFn) return false; Personality = classifyEHPersonality(PersonalityFn); Index: lib/Transforms/IPO/GlobalDCE.cpp =================================================================== --- lib/Transforms/IPO/GlobalDCE.cpp +++ lib/Transforms/IPO/GlobalDCE.cpp @@ -228,6 +228,9 @@ if (F->hasPrologueData()) MarkUsedGlobalsAsNeeded(F->getPrologueData()); + if (F->hasPersonalityFn()) + MarkUsedGlobalsAsNeeded(F->getPersonalityFn()); + for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) for (User::op_iterator U = I->op_begin(), E = I->op_end(); U != E; ++U) Index: lib/Transforms/IPO/PruneEH.cpp =================================================================== --- lib/Transforms/IPO/PruneEH.cpp +++ lib/Transforms/IPO/PruneEH.cpp @@ -177,7 +177,7 @@ bool MadeChange = false; for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { if (InvokeInst *II = dyn_cast(BB->getTerminator())) - if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(II)) { + if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(F)) { SmallVector Args(II->op_begin(), II->op_end() - 3); // Insert a call instruction before the invoke. CallInst *Call = CallInst::Create(II->getCalledValue(), Args, "", II); Index: lib/Transforms/InstCombine/InstructionCombining.cpp =================================================================== --- lib/Transforms/InstCombine/InstructionCombining.cpp +++ lib/Transforms/InstCombine/InstructionCombining.cpp @@ -2353,7 +2353,8 @@ // The logic here should be correct for any real-world personality function. // However if that turns out not to be true, the offending logic can always // be conditioned on the personality function, like the catch-all logic is. - EHPersonality Personality = classifyEHPersonality(LI.getPersonalityFn()); + EHPersonality Personality = + classifyEHPersonality(LI.getParent()->getParent()->getPersonalityFn()); // Simplify the list of clauses, eg by removing repeated catch clauses // (these are often created by inlining). @@ -2620,7 +2621,6 @@ // with a new one. if (MakeNewInstruction) { LandingPadInst *NLI = LandingPadInst::Create(LI.getType(), - LI.getPersonalityFn(), NewClauses.size()); for (unsigned i = 0, e = NewClauses.size(); i != e; ++i) NLI->addClause(NewClauses[i]); @@ -2691,7 +2691,8 @@ } // Instruction isn't dead, see if we can constant propagate it. - if (!I->use_empty() && isa(I->getOperand(0))) { + if (!I->use_empty() && + (I->getNumOperands() == 0 || isa(I->getOperand(0)))) { if (Constant *C = ConstantFoldInstruction(I, DL, TLI)) { DEBUG(dbgs() << "IC: ConstFold to: " << *C << " from: " << *I << '\n'); @@ -2846,7 +2847,8 @@ } // ConstantProp instruction if trivially constant. - if (!Inst->use_empty() && isa(Inst->getOperand(0))) + if (!Inst->use_empty() && + (Inst->getNumOperands() == 0 || isa(Inst->getOperand(0)))) if (Constant *C = ConstantFoldInstruction(Inst, DL, TLI)) { DEBUG(dbgs() << "IC: ConstFold to: " << *C << " from: " << *Inst << '\n'); Index: lib/Transforms/Utils/InlineFunction.cpp =================================================================== --- lib/Transforms/Utils/InlineFunction.cpp +++ lib/Transforms/Utils/InlineFunction.cpp @@ -949,35 +949,23 @@ } // Get the personality function from the callee if it contains a landing pad. - Value *CalleePersonality = nullptr; - for (Function::const_iterator I = CalledFunc->begin(), E = CalledFunc->end(); - I != E; ++I) - if (const InvokeInst *II = dyn_cast(I->getTerminator())) { - const BasicBlock *BB = II->getUnwindDest(); - const LandingPadInst *LP = BB->getLandingPadInst(); - CalleePersonality = LP->getPersonalityFn(); - break; - } + Constant *CalledPersonality = + CalledFunc->hasPersonalityFn() ? CalledFunc->getPersonalityFn() : nullptr; // Find the personality function used by the landing pads of the caller. If it // exists, then check to see that it matches the personality function used in // the callee. - if (CalleePersonality) { - for (Function::const_iterator I = Caller->begin(), E = Caller->end(); - I != E; ++I) - if (const InvokeInst *II = dyn_cast(I->getTerminator())) { - const BasicBlock *BB = II->getUnwindDest(); - const LandingPadInst *LP = BB->getLandingPadInst(); - - // If the personality functions match, then we can perform the - // inlining. Otherwise, we can't inline. - // TODO: This isn't 100% true. Some personality functions are proper - // supersets of others and can be used in place of the other. - if (LP->getPersonalityFn() != CalleePersonality) - return false; - - break; - } + Constant *CallerPersonality = + Caller->hasPersonalityFn() ? Caller->getPersonalityFn() : nullptr; + if (CalledPersonality) { + if (!CallerPersonality) + Caller->setPersonalityFn(CalledPersonality); + // If the personality functions match, then we can perform the + // inlining. Otherwise, we can't inline. + // TODO: This isn't 100% true. Some personality functions are proper + // supersets of others and can be used in place of the other. + else if (CalledPersonality != CallerPersonality) + return false; } // Get an iterator to the last basic block in the function, which will have Index: lib/Transforms/Utils/Local.cpp =================================================================== --- lib/Transforms/Utils/Local.cpp +++ lib/Transforms/Utils/Local.cpp @@ -1173,10 +1173,11 @@ II->eraseFromParent(); } -static bool markAliveBlocks(BasicBlock *BB, +static bool markAliveBlocks(Function &F, SmallPtrSetImpl &Reachable) { SmallVector Worklist; + BasicBlock *BB = F.begin(); Worklist.push_back(BB); Reachable.insert(BB); bool Changed = false; @@ -1247,7 +1248,7 @@ if (isa(Callee) || isa(Callee)) { changeToUnreachable(II, true); Changed = true; - } else if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(II)) { + } else if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(&F)) { if (II->use_empty() && II->onlyReadsMemory()) { // jump to the normal destination branch. BranchInst::Create(II->getNormalDest(), II); @@ -1272,7 +1273,7 @@ /// otherwise. bool llvm::removeUnreachableBlocks(Function &F) { SmallPtrSet Reachable; - bool Changed = markAliveBlocks(F.begin(), Reachable); + bool Changed = markAliveBlocks(F, Reachable); // If there are unreachable blocks in the CFG... if (Reachable.size() == F.size()) Index: test/Analysis/CallGraph/do-nothing-intrinsic.ll =================================================================== --- test/Analysis/CallGraph/do-nothing-intrinsic.ll +++ test/Analysis/CallGraph/do-nothing-intrinsic.ll @@ -1,11 +1,11 @@ ; RUN: opt < %s -basiccg ; PR13903 -define void @main() { +define void @main() personality i8 0 { invoke void @llvm.donothing() to label %ret unwind label %unw unw: - %tmp = landingpad i8 personality i8 0 cleanup + %tmp = landingpad i8 cleanup br label %ret ret: ret void Index: test/Analysis/Dominators/invoke.ll =================================================================== --- test/Analysis/Dominators/invoke.ll +++ test/Analysis/Dominators/invoke.ll @@ -1,7 +1,7 @@ ; RUN: opt -verify -disable-output < %s ; This tests that we handle unreachable blocks correctly -define void @f() { +define void @f() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { %v1 = invoke i32* @g() to label %bb1 unwind label %bb2 invoke void @__dynamic_cast() @@ -10,7 +10,7 @@ %Hidden = getelementptr inbounds i32, i32* %v1, i64 1 ret void bb2: - %lpad.loopexit80 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %lpad.loopexit80 = landingpad { i8*, i32 } cleanup ret void } Index: test/Analysis/LazyCallGraph/basic.ll =================================================================== --- test/Analysis/LazyCallGraph/basic.ll +++ test/Analysis/LazyCallGraph/basic.ll @@ -63,7 +63,7 @@ ret void } -define void ()* @test1(void ()** %x) { +define void ()* @test1(void ()** %x) personality i32 (...)* @__gxx_personality_v0 { ; CHECK-LABEL: Call edges in function: test1 ; CHECK-NEXT: -> f12 ; CHECK-NEXT: -> f11 @@ -97,7 +97,7 @@ ret void ()* @f11 unwind: - %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + %res = landingpad { i8*, i32 } cleanup resume { i8*, i32 } { i8* bitcast (void ()* @f12 to i8*), i32 42 } } Index: test/Analysis/Lint/cppeh-catch-intrinsics-clean.ll =================================================================== --- test/Analysis/Lint/cppeh-catch-intrinsics-clean.ll +++ test/Analysis/Lint/cppeh-catch-intrinsics-clean.ll @@ -12,13 +12,13 @@ @_ZTIi = external constant i8* ; Function Attrs: uwtable -define void @test_ref_clean() { +define void @test_ref_clean() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: invoke void @_Z9may_throwv() to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %exn = extractvalue { i8*, i32 } %0, 0 %sel = extractvalue { i8*, i32 } %0, 1 @@ -43,7 +43,7 @@ } ; Function Attrs: uwtable -define void @test_ref_clean_multibranch() { +define void @test_ref_clean_multibranch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: invoke void @_Z9may_throwv() to label %invoke.cont unwind label %lpad @@ -53,7 +53,7 @@ to label %invoke.cont unwind label %lpad1 lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %exn = extractvalue { i8*, i32 } %0, 0 %sel = extractvalue { i8*, i32 } %0, 1 @@ -65,7 +65,7 @@ to label %try.cont unwind label %lpad lpad1: ; preds = %entry - %l1.0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %l1.0 = landingpad { i8*, i32 } cleanup catch i8* bitcast (i8** @_ZTIi to i8*) %exn1 = extractvalue { i8*, i32 } %l1.0, 0 Index: test/Analysis/Lint/cppeh-catch-intrinsics.ll =================================================================== --- test/Analysis/Lint/cppeh-catch-intrinsics.ll +++ test/Analysis/Lint/cppeh-catch-intrinsics.ll @@ -13,7 +13,7 @@ @_ZTIi = external constant i8* ; Function Attrs: uwtable -define void @test_missing_endcatch() { +define void @test_missing_endcatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { ; CHECK: Some paths from llvm.eh.begincatch may not reach llvm.eh.endcatch ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null) entry: @@ -21,7 +21,7 @@ to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %exn = extractvalue { i8*, i32 } %0, 0 %sel = extractvalue { i8*, i32 } %0, 1 @@ -45,7 +45,7 @@ } ; Function Attrs: uwtable -define void @test_missing_begincatch() { +define void @test_missing_begincatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { ; CHECK: llvm.eh.endcatch may be reachable without passing llvm.eh.begincatch ; CHECK-NEXT: call void @llvm.eh.endcatch() entry: @@ -53,7 +53,7 @@ to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %exn = extractvalue { i8*, i32 } %0, 0 %sel = extractvalue { i8*, i32 } %0, 1 @@ -77,7 +77,7 @@ } ; Function Attrs: uwtable -define void @test_multiple_begin() { +define void @test_multiple_begin() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { ; CHECK: llvm.eh.begincatch may be called a second time before llvm.eh.endcatch ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null) ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null) @@ -86,7 +86,7 @@ to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %exn = extractvalue { i8*, i32 } %0, 0 %sel = extractvalue { i8*, i32 } %0, 1 @@ -112,7 +112,7 @@ } ; Function Attrs: uwtable -define void @test_multiple_end() { +define void @test_multiple_end() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { ; CHECK: llvm.eh.endcatch may be called a second time after llvm.eh.begincatch ; CHECK-NEXT: call void @llvm.eh.endcatch() ; CHECK-NEXT: call void @llvm.eh.endcatch() @@ -121,7 +121,7 @@ to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %exn = extractvalue { i8*, i32 } %0, 0 %sel = extractvalue { i8*, i32 } %0, 1 @@ -166,7 +166,7 @@ } ; Function Attrs: uwtable -define void @test_branch_to_begincatch_with_no_lpad(i32 %fake.sel) { +define void @test_branch_to_begincatch_with_no_lpad(i32 %fake.sel) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { ; CHECK: llvm.eh.begincatch may be reachable without passing a landingpad ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn2, i8* null) entry: @@ -175,7 +175,7 @@ to label %catch unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %exn = extractvalue { i8*, i32 } %0, 0 %sel = extractvalue { i8*, i32 } %0, 1 @@ -211,7 +211,7 @@ } ; Function Attrs: uwtable -define void @test_branch_missing_endcatch() { +define void @test_branch_missing_endcatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { ; CHECK: Some paths from llvm.eh.begincatch may not reach llvm.eh.endcatch ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn2, i8* null) entry: @@ -223,7 +223,7 @@ to label %invoke.cont unwind label %lpad1 lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %exn = extractvalue { i8*, i32 } %0, 0 %sel = extractvalue { i8*, i32 } %0, 1 @@ -235,7 +235,7 @@ to label %try.cont unwind label %lpad lpad1: ; preds = %entry - %l1.0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %l1.0 = landingpad { i8*, i32 } cleanup catch i8* bitcast (i8** @_ZTIi to i8*) %exn1 = extractvalue { i8*, i32 } %l1.0, 0 Index: test/Assembler/invalid-landingpad.ll =================================================================== --- test/Assembler/invalid-landingpad.ll +++ test/Assembler/invalid-landingpad.ll @@ -2,6 +2,6 @@ ; CHECK: clause argument must be a constant -define void @test(i32 %in) { - landingpad {} personality void()* null filter i32 %in +define void @test(i32 %in) personality void()* null { + landingpad {} filter i32 %in } Index: test/Bitcode/miscInstructions.3.2.ll =================================================================== --- test/Bitcode/miscInstructions.3.2.ll +++ test/Bitcode/miscInstructions.3.2.ll @@ -13,27 +13,33 @@ ret i32 0 } +; CHECK-LABEL: define void @landingpadInstr1 +; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0 define void @landingpadInstr1(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){ entry: -; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 +; CHECK: %res = landingpad { i8*, i32 } %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 ; CHECK: catch i8** @_ZTIi catch i8** @_ZTIi ret void } +; CHECK-LABEL: define void @landingpadInstr2 +; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0 define void @landingpadInstr2(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){ entry: -; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 +; CHECK: %res = landingpad { i8*, i32 } %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 ; CHECK: cleanup cleanup ret void } +; CHECK-LABEL: define void @landingpadInstr3 +; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0 define void @landingpadInstr3(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){ entry: -; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 +; CHECK: %res = landingpad { i8*, i32 } %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 ; CHECK: catch i8** @_ZTIi catch i8** @_ZTIi Index: test/CodeGen/AArch64/arm64-big-endian-eh.ll =================================================================== --- test/CodeGen/AArch64/arm64-big-endian-eh.ll +++ test/CodeGen/AArch64/arm64-big-endian-eh.ll @@ -14,13 +14,13 @@ ; } ;} -define void @_Z4testii(i32 %a, i32 %b) #0 { +define void @_Z4testii(i32 %a, i32 %b) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_Z3fooi(i32 %a) to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 %2 = tail call i8* @__cxa_begin_catch(i8* %1) #2 @@ -35,7 +35,7 @@ ret void lpad1: ; preds = %lpad - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %3 = landingpad { i8*, i32 } cleanup invoke void @__cxa_end_catch() to label %eh.resume unwind label %terminate.lpad @@ -44,7 +44,7 @@ resume { i8*, i32 } %3 terminate.lpad: ; preds = %lpad1 - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %4 = landingpad { i8*, i32 } catch i8* null %5 = extractvalue { i8*, i32 } %4, 0 tail call void @__clang_call_terminate(i8* %5) #3 Index: test/CodeGen/AArch64/br-to-eh-lpad.ll =================================================================== --- test/CodeGen/AArch64/br-to-eh-lpad.ll +++ test/CodeGen/AArch64/br-to-eh-lpad.ll @@ -7,12 +7,12 @@ ; that case, the machine verifier, which relies on analyzing branches for this ; kind of verification, is unable to check anything, so accepts the CFG. -define void @test_branch_to_landingpad() { +define void @test_branch_to_landingpad() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) { entry: br i1 undef, label %if.end50.thread, label %if.then6 lpad: - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765* @"OBJC_EHTYPE_$_NSString" catch %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765* @OBJC_EHTYPE_id catch i8* null @@ -46,7 +46,7 @@ unreachable lpad40: - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) + %1 = landingpad { i8*, i32 } catch i8* null br label %finally.catchall Index: test/CodeGen/AArch64/pic-eh-stubs.ll =================================================================== --- test/CodeGen/AArch64/pic-eh-stubs.ll +++ test/CodeGen/AArch64/pic-eh-stubs.ll @@ -21,13 +21,13 @@ @_ZTIi = external constant i8* -define i32 @_Z3barv() { +define i32 @_Z3barv() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_Z3foov() to label %return unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %1 = extractvalue { i8*, i32 } %0, 1 %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) nounwind Index: test/CodeGen/ARM/2009-08-31-LSDA-Name.ll =================================================================== --- test/CodeGen/ARM/2009-08-31-LSDA-Name.ll +++ test/CodeGen/ARM/2009-08-31-LSDA-Name.ll @@ -7,7 +7,7 @@ %struct.A = type { i32* } -define void @"\01-[MyFunction Name:]"() { +define void @"\01-[MyFunction Name:]"() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: %save_filt.1 = alloca i32 %save_eptr.0 = alloca i8* @@ -39,7 +39,7 @@ ret void lpad: ; preds = %entry - %exn = landingpad {i8*, i32} personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %exn = landingpad {i8*, i32} cleanup %eh_ptr = extractvalue {i8*, i32} %exn, 0 store i8* %eh_ptr, i8** %eh_exception Index: test/CodeGen/ARM/2010-07-26-GlobalMerge.ll =================================================================== --- test/CodeGen/ARM/2010-07-26-GlobalMerge.ll +++ test/CodeGen/ARM/2010-07-26-GlobalMerge.ll @@ -40,7 +40,7 @@ declare void @__cxa_throw(i8*, i8*, i8*) -define i32 @main() ssp { +define i32 @main() ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: %puts.i = tail call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i32 0, i32 0)) ; [#uses=0] %exception.i = tail call i8* @__cxa_allocate_exception(i32 4) nounwind ; [#uses=2] @@ -71,7 +71,7 @@ ret i32 %conv lpad: ; preds = %entry - %exn.ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %exn.ptr = landingpad { i8*, i32 } catch i8* bitcast (%0* @_ZTI1A to i8*) catch i8* null %exn = extractvalue { i8*, i32 } %exn.ptr, 0 Index: test/CodeGen/ARM/2010-08-04-EHCrash.ll =================================================================== --- test/CodeGen/ARM/2010-08-04-EHCrash.ll +++ test/CodeGen/ARM/2010-08-04-EHCrash.ll @@ -1,7 +1,7 @@ ; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 ; -define linkonce_odr arm_apcscc void @func1() { +define linkonce_odr arm_apcscc void @func1() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: %save_filt.936 = alloca i32 ; [#uses=2] %save_eptr.935 = alloca i8* ; [#uses=2] @@ -34,7 +34,7 @@ ret void lpad: ; preds = %bb - %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %eh_ptr = landingpad { i8*, i32 } cleanup %exn = extractvalue { i8*, i32 } %eh_ptr, 0 store i8* %exn, i8** %eh_exception Index: test/CodeGen/ARM/2011-05-04-MultipleLandingPadSuccs.ll =================================================================== --- test/CodeGen/ARM/2011-05-04-MultipleLandingPadSuccs.ll +++ test/CodeGen/ARM/2011-05-04-MultipleLandingPadSuccs.ll @@ -3,7 +3,7 @@ target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32" target triple = "thumbv7-apple-darwin" -define void @func() unnamed_addr align 2 { +define void @func() unnamed_addr align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: br label %for.cond @@ -35,13 +35,13 @@ br label %for.cond lpad: - %exn = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %exn = landingpad { i8*, i32 } catch i8* null invoke void @foo() to label %eh.resume unwind label %terminate.lpad lpad26: - %exn27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %exn27 = landingpad { i8*, i32 } catch i8* null invoke void @foo() to label %eh.resume unwind label %terminate.lpad @@ -57,7 +57,7 @@ ret void lpad44: - %exn45 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %exn45 = landingpad { i8*, i32 } catch i8* null invoke void @foo() to label %eh.resume unwind label %terminate.lpad @@ -67,7 +67,7 @@ resume { i8*, i32 } %exn.slot.0 terminate.lpad: - %exn51 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %exn51 = landingpad { i8*, i32 } catch i8* null tail call void @_ZSt9terminatev() noreturn nounwind unreachable Index: test/CodeGen/ARM/2011-12-19-sjlj-clobber.ll =================================================================== --- test/CodeGen/ARM/2011-12-19-sjlj-clobber.ll +++ test/CodeGen/ARM/2011-12-19-sjlj-clobber.ll @@ -8,7 +8,7 @@ %0 = type opaque %struct.NSConstantString = type { i32*, i32, i8*, i32 } -define i32 @asdf(i32 %a, i32 %b, i8** %c, i8* %d) { +define i32 @asdf(i32 %a, i32 %b, i8** %c, i8* %d) personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) { bb: %tmp = alloca i32, align 4 %tmp1 = alloca i32, align 4 @@ -37,7 +37,7 @@ unreachable bb15: ; preds = %bb11, %bb - %tmp16 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) + %tmp16 = landingpad { i8*, i32 } catch i8* null %tmp17 = extractvalue { i8*, i32 } %tmp16, 0 store i8* %tmp17, i8** %tmp4 Index: test/CodeGen/ARM/2012-04-24-SplitEHCriticalEdge.ll =================================================================== --- test/CodeGen/ARM/2012-04-24-SplitEHCriticalEdge.ll +++ test/CodeGen/ARM/2012-04-24-SplitEHCriticalEdge.ll @@ -25,13 +25,13 @@ declare void @_ZSt9terminatev() -define hidden double @t(%0* %self, i8* nocapture %_cmd) optsize ssp { +define hidden double @t(%0* %self, i8* nocapture %_cmd) optsize ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: %call = invoke double undef(%class.FunctionInterpreter.3.15.31* undef) optsize to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast ({ i8*, i8* }* @_ZTI13ParseErrorMsg to i8*) br i1 undef, label %catch, label %eh.resume @@ -47,7 +47,7 @@ ret double %value.0 lpad1: ; preds = %catch - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %1 = landingpad { i8*, i32 } cleanup invoke void @__cxa_end_catch() to label %eh.resume unwind label %terminate.lpad @@ -56,7 +56,7 @@ resume { i8*, i32 } undef terminate.lpad: ; preds = %lpad1 - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %2 = landingpad { i8*, i32 } catch i8* null unreachable } Index: test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll =================================================================== --- test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll +++ test/CodeGen/ARM/2014-05-14-DwarfEHCrash.ll @@ -8,13 +8,13 @@ @_ZTIi = external constant i8* -define void @_Z3fn2v() #0 { +define void @_Z3fn2v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_Z3fn1v() to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %1 = extractvalue { i8*, i32 } %0, 1 %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #2 Index: test/CodeGen/ARM/arm-ttype-target2.ll =================================================================== --- test/CodeGen/ARM/arm-ttype-target2.ll +++ test/CodeGen/ARM/arm-ttype-target2.ll @@ -4,13 +4,13 @@ @_ZTS3Foo = linkonce_odr constant [5 x i8] c"3Foo\00" @_ZTI3Foo = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_ZTS3Foo, i32 0, i32 0) } -define i32 @main() { +define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_Z3foov() to label %return unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast ({ i8*, i8* }* @_ZTI3Foo to i8*) %1 = extractvalue { i8*, i32 } %0, 1 %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast ({ i8*, i8* }* @_ZTI3Foo to i8*)) nounwind Index: test/CodeGen/ARM/big-endian-eh-unwind.ll =================================================================== --- test/CodeGen/ARM/big-endian-eh-unwind.ll +++ test/CodeGen/ARM/big-endian-eh-unwind.ll @@ -14,13 +14,13 @@ ; } ;} -define void @_Z4testii(i32 %a, i32 %b) #0 { +define void @_Z4testii(i32 %a, i32 %b) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_Z3fooi(i32 %a) to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 %2 = tail call i8* @__cxa_begin_catch(i8* %1) #2 @@ -35,7 +35,7 @@ ret void lpad1: ; preds = %lpad - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %3 = landingpad { i8*, i32 } cleanup invoke void @__cxa_end_catch() to label %eh.resume unwind label %terminate.lpad @@ -44,7 +44,7 @@ resume { i8*, i32 } %3 terminate.lpad: ; preds = %lpad1 - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %4 = landingpad { i8*, i32 } catch i8* null %5 = extractvalue { i8*, i32 } %4, 0 tail call void @__clang_call_terminate(i8* %5) #3 Index: test/CodeGen/ARM/crash.ll =================================================================== --- test/CodeGen/ARM/crash.ll +++ test/CodeGen/ARM/crash.ll @@ -74,7 +74,7 @@ %A = type { %B } %B = type { i32 } -define void @_Z3Foov() ssp { +define void @_Z3Foov() ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: br i1 true, label %exit, label %false @@ -83,7 +83,7 @@ to label %exit unwind label %lpad lpad: - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null unreachable Index: test/CodeGen/ARM/debug-frame-no-debug.ll =================================================================== --- test/CodeGen/ARM/debug-frame-no-debug.ll +++ test/CodeGen/ARM/debug-frame-no-debug.ll @@ -34,14 +34,13 @@ define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, double %m, double %n, double %p, - double %q, double %r) { + double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) to label %try.cont unwind label %lpad lpad: %0 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 %2 = tail call i8* @__cxa_begin_catch(i8* %1) @@ -58,7 +57,6 @@ lpad1: %3 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup invoke void @__cxa_end_catch() to label %eh.resume unwind label %terminate.lpad @@ -68,7 +66,6 @@ terminate.lpad: %4 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* null %5 = extractvalue { i8*, i32 } %4, 0 tail call void @__clang_call_terminate(i8* %5) Index: test/CodeGen/ARM/debug-frame.ll =================================================================== --- test/CodeGen/ARM/debug-frame.ll +++ test/CodeGen/ARM/debug-frame.ll @@ -73,14 +73,13 @@ define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, double %m, double %n, double %p, - double %q, double %r) { + double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) to label %try.cont unwind label %lpad lpad: %0 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 %2 = tail call i8* @__cxa_begin_catch(i8* %1) @@ -97,7 +96,6 @@ lpad1: %3 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup invoke void @__cxa_end_catch() to label %eh.resume unwind label %terminate.lpad @@ -107,7 +105,6 @@ terminate.lpad: %4 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* null %5 = extractvalue { i8*, i32 } %4, 0 tail call void @__clang_call_terminate(i8* %5) Index: test/CodeGen/ARM/dwarf-eh.ll =================================================================== --- test/CodeGen/ARM/dwarf-eh.ll +++ test/CodeGen/ARM/dwarf-eh.ll @@ -17,7 +17,7 @@ @_ZTS9exception = linkonce_odr constant [11 x i8] c"9exception\00" @_ZTI9exception = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @_ZTS9exception, i32 0, i32 0) } -define void @f() uwtable { +define void @f() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { %1 = alloca i8* %2 = alloca i32 %e = alloca %struct.exception*, align 4 @@ -26,7 +26,7 @@ br label %16 - %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %5 = landingpad { i8*, i32 } catch i8* bitcast ({ i8*, i8* }* @_ZTI9exception to i8*) %6 = extractvalue { i8*, i32 } %5, 0 store i8* %6, i8** %1 Index: test/CodeGen/ARM/eh-dispcont.ll =================================================================== --- test/CodeGen/ARM/eh-dispcont.ll +++ test/CodeGen/ARM/eh-dispcont.ll @@ -7,7 +7,7 @@ @_ZTIi = external constant i8* -define i32 @main() #0 { +define i32 @main() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: %exception = tail call i8* @__cxa_allocate_exception(i32 4) #1 %0 = bitcast i8* %exception to i32* @@ -16,7 +16,7 @@ to label %unreachable unwind label %lpad lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %1 = landingpad { i8*, i32 } catch i8* null %2 = extractvalue { i8*, i32 } %1, 0 %3 = tail call i8* @__cxa_begin_catch(i8* %2) #1 Index: test/CodeGen/ARM/eh-resume-darwin.ll =================================================================== --- test/CodeGen/ARM/eh-resume-darwin.ll +++ test/CodeGen/ARM/eh-resume-darwin.ll @@ -5,7 +5,7 @@ declare i32 @__gxx_personality_sj0(...) -define void @test0() { +define void @test0() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: invoke void @func() to label %cont unwind label %lpad @@ -14,7 +14,7 @@ ret void lpad: - %exn = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %exn = landingpad { i8*, i32 } cleanup resume { i8*, i32 } %exn } Index: test/CodeGen/ARM/ehabi-filters.ll =================================================================== --- test/CodeGen/ARM/ehabi-filters.ll +++ test/CodeGen/ARM/ehabi-filters.ll @@ -14,7 +14,7 @@ declare void @__cxa_call_unexpected(i8*) -define i32 @main() { +define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { ; CHECK-LABEL: main: entry: %exception.i = tail call i8* @__cxa_allocate_exception(i32 4) nounwind @@ -24,7 +24,7 @@ to label %unreachable.i unwind label %lpad.i lpad.i: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %1 = landingpad { i8*, i32 } filter [1 x i8*] [i8* bitcast (i8** @_ZTIi to i8*)] catch i8* bitcast (i8** @_ZTIi to i8*) ; CHECK: .long _ZTIi(target2) @ TypeInfo 1 @@ -45,7 +45,7 @@ unreachable lpad: ; preds = %ehspec.unexpected.i - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %4 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) br label %lpad.body Index: test/CodeGen/ARM/ehabi-handlerdata-nounwind.ll =================================================================== --- test/CodeGen/ARM/ehabi-handlerdata-nounwind.ll +++ test/CodeGen/ARM/ehabi-handlerdata-nounwind.ll @@ -25,12 +25,12 @@ declare void @__cxa_end_catch() -define void @test1() nounwind { +define void @test1() nounwind personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @throw_exception() to label %try.cont unwind label %lpad lpad: - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 %2 = tail call i8* @__cxa_begin_catch(i8* %1) Index: test/CodeGen/ARM/ehabi-handlerdata.ll =================================================================== --- test/CodeGen/ARM/ehabi-handlerdata.ll +++ test/CodeGen/ARM/ehabi-handlerdata.ll @@ -23,12 +23,12 @@ declare void @__cxa_end_catch() -define void @test1() { +define void @test1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @throw_exception() to label %try.cont unwind label %lpad lpad: - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 %2 = tail call i8* @__cxa_begin_catch(i8* %1) Index: test/CodeGen/ARM/ehabi.ll =================================================================== --- test/CodeGen/ARM/ehabi.ll +++ test/CodeGen/ARM/ehabi.ll @@ -89,14 +89,13 @@ define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, double %m, double %n, double %p, - double %q, double %r) { + double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e) to label %try.cont unwind label %lpad lpad: %0 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 %2 = tail call i8* @__cxa_begin_catch(i8* %1) @@ -113,7 +112,6 @@ lpad1: %3 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup invoke void @__cxa_end_catch() to label %eh.resume unwind label %terminate.lpad @@ -123,7 +121,6 @@ terminate.lpad: %4 = landingpad { i8*, i32 } - personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* null %5 = extractvalue { i8*, i32 } %4, 0 tail call void @__clang_call_terminate(i8* %5) Index: test/CodeGen/ARM/global-merge.ll =================================================================== --- test/CodeGen/ARM/global-merge.ll +++ test/CodeGen/ARM/global-merge.ll @@ -15,13 +15,13 @@ ; CHECK: ZTIi @_ZTIi = internal global i8* null -define i32 @_Z9exceptioni(i32 %arg) { +define i32 @_Z9exceptioni(i32 %arg) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { bb: %tmp = invoke i32 @_Z14throwSomethingi(i32 %arg) to label %bb9 unwind label %bb1 bb1: ; preds = %bb - %tmp2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %tmp2 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %tmp3 = extractvalue { i8*, i32 } %tmp2, 1 %tmp4 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) Index: test/CodeGen/ARM/gv-stubs-crash.ll =================================================================== --- test/CodeGen/ARM/gv-stubs-crash.ll +++ test/CodeGen/ARM/gv-stubs-crash.ll @@ -3,7 +3,7 @@ @Exn = external hidden unnamed_addr constant { i8*, i8* } -define hidden void @func(i32* %this, i32* %e) optsize align 2 { +define hidden void @func(i32* %this, i32* %e) optsize align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { %e.ld = load i32, i32* %e, align 4 %inv = invoke zeroext i1 @func2(i32* %this, i32 %e.ld) optsize to label %ret unwind label %lpad @@ -12,7 +12,7 @@ ret void lpad: - %lp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %lp = landingpad { i8*, i32 } catch i8* bitcast ({ i8*, i8* }* @Exn to i8*) br label %.loopexit4 Index: test/CodeGen/ARM/invoke-donothing-assert.ll =================================================================== --- test/CodeGen/ARM/invoke-donothing-assert.ll +++ test/CodeGen/ARM/invoke-donothing-assert.ll @@ -4,7 +4,7 @@ ; & ; CHECK: .globl _foo -define void @foo() { +define void @foo() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { invoke.cont: invoke void @callA() to label %invoke.cont25 unwind label %lpad2 @@ -20,12 +20,12 @@ ret void lpad2: - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %0 = landingpad { i8*, i32 } cleanup br label %eh.resume lpad15: - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %1 = landingpad { i8*, i32 } cleanup br label %eh.resume @@ -34,7 +34,7 @@ } ; CHECK: .globl _bar -define linkonce_odr void @bar(i32* %a) { +define linkonce_odr void @bar(i32* %a) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { if.end.i.i.i: invoke void @llvm.donothing() to label %call.i.i.i.noexc unwind label %eh.resume @@ -58,7 +58,7 @@ ret void eh.resume: - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %1 = landingpad { i8*, i32 } cleanup %2 = extractvalue { i8*, i32 } %1, 0 %3 = extractvalue { i8*, i32 } %1, 1 Index: test/CodeGen/ARM/sjlj-prepare-critical-edge.ll =================================================================== --- test/CodeGen/ARM/sjlj-prepare-critical-edge.ll +++ test/CodeGen/ARM/sjlj-prepare-critical-edge.ll @@ -6,7 +6,7 @@ declare void @bar(%struct.__CFString*, %struct.__CFString*) -define noalias i8* @foo(i8* nocapture %inRefURL) noreturn ssp { +define noalias i8* @foo(i8* nocapture %inRefURL) noreturn ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: %call = tail call %struct.__CFString* @bar3() %call2 = invoke i8* @bar2() @@ -17,14 +17,14 @@ to label %for.cond unwind label %lpad5 lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %0 = landingpad { i8*, i32 } cleanup %1 = extractvalue { i8*, i32 } %0, 0 %2 = extractvalue { i8*, i32 } %0, 1 br label %ehcleanup lpad5: ; preds = %for.cond - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %3 = landingpad { i8*, i32 } cleanup %4 = extractvalue { i8*, i32 } %3, 0 %5 = extractvalue { i8*, i32 } %3, 1 @@ -32,7 +32,7 @@ to label %ehcleanup unwind label %terminate.lpad.i.i16 terminate.lpad.i.i16: ; preds = %lpad5 - %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %6 = landingpad { i8*, i32 } catch i8* null tail call void @terminatev() noreturn nounwind unreachable @@ -45,7 +45,7 @@ to label %_ZN5SmartIPK10__CFStringED1Ev.exit unwind label %terminate.lpad.i.i terminate.lpad.i.i: ; preds = %ehcleanup - %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %8 = landingpad { i8*, i32 } catch i8* null tail call void @terminatev() noreturn nounwind unreachable @@ -90,7 +90,7 @@ @.str = private unnamed_addr constant [12 x i8] c"some_string\00", align 1 -define void @_Z4foo1c(i8 signext %a) { +define void @_Z4foo1c(i8 signext %a) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: %s1 = alloca %"class.std::__1::basic_string", align 4 call void @_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(%"class.std::__1::basic_string"* %s1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 11) @@ -131,14 +131,14 @@ ret void lpad.body: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %2 = landingpad { i8*, i32 } cleanup %3 = extractvalue { i8*, i32 } %2, 0 %4 = extractvalue { i8*, i32 } %2, 1 br label %ehcleanup lpad2: ; preds = %invoke.cont - %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %5 = landingpad { i8*, i32 } cleanup %6 = extractvalue { i8*, i32 } %5, 0 %7 = extractvalue { i8*, i32 } %5, 1 @@ -161,7 +161,7 @@ resume { i8*, i32 } %lpad.val13 terminate.lpad: ; preds = %ehcleanup - %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %8 = landingpad { i8*, i32 } catch i8* null %9 = extractvalue { i8*, i32 } %8, 0 call void @__clang_call_terminate(i8* %9) Index: test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll =================================================================== --- test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll +++ test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll @@ -10,7 +10,7 @@ ; __Unwind_SjLj_Register and actual @bar invocation -define i8* @foo(i8 %a, {} %c) { +define i8* @foo(i8 %a, {} %c) personality i8* bitcast (i32 (...)* @baz to i8*) { entry: ; CHECK: bl __Unwind_SjLj_Register ; CHECK-NEXT: {{[A-Z][a-zA-Z0-9]*}}: @@ -22,7 +22,7 @@ unreachable handler: - %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @baz to i8*) + %tmp = landingpad { i8*, i32 } cleanup resume { i8*, i32 } undef } Index: test/CodeGen/Generic/2007-02-25-invoke.ll =================================================================== --- test/CodeGen/Generic/2007-02-25-invoke.ll +++ test/CodeGen/Generic/2007-02-25-invoke.ll @@ -3,12 +3,12 @@ ; PR1224 declare i32 @test() -define i32 @test2() { +define i32 @test2() personality i32 (...)* @__gxx_personality_v0 { %A = invoke i32 @test() to label %invcont unwind label %blat invcont: ret i32 %A blat: - %lpad = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + %lpad = landingpad { i8*, i32 } cleanup ret i32 0 } Index: test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll =================================================================== --- test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll +++ test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll @@ -7,7 +7,7 @@ %"struct.std::locale::facet" = type { i32 (...)**, i32 } %"struct.std::string" = type { %"struct.std::basic_string,std::allocator >::_Alloc_hider" } -define void @_ZNKSt6locale4nameEv(%"struct.std::string"* %agg.result) { +define void @_ZNKSt6locale4nameEv(%"struct.std::string"* %agg.result) personality i32 (...)* @__gxx_personality_v0 { entry: %tmp105 = icmp eq i8* null, null ; [#uses=1] br i1 %tmp105, label %cond_true, label %cond_true222 @@ -45,7 +45,7 @@ ret void cond_true1402: ; preds = %invcont282, %cond_false280, %cond_true235, %cond_true - %lpad = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + %lpad = landingpad { i8*, i32 } cleanup ret void } Index: test/CodeGen/Generic/2007-12-17-InvokeAsm.ll =================================================================== --- test/CodeGen/Generic/2007-12-17-InvokeAsm.ll +++ test/CodeGen/Generic/2007-12-17-InvokeAsm.ll @@ -1,6 +1,6 @@ ; RUN: llc -no-integrated-as < %s -define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() { +define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() personality i32 (...)* @__gxx_personality_v0 { entry: invoke void asm "rdtsc\0A\09movl %eax, $0\0A\09movl %edx, $1", "=*imr,=*imr,~{dirflag},~{fpsr},~{flags},~{dx},~{ax}"( i32* null, i32* null ) to label %.noexc unwind label %cleanup144 @@ -9,7 +9,7 @@ ret void cleanup144: ; preds = %entry - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} cleanup resume { i8*, i32 } %exn } Index: test/CodeGen/Generic/2007-12-31-UnusedSelector.ll =================================================================== --- test/CodeGen/Generic/2007-12-31-UnusedSelector.ll +++ test/CodeGen/Generic/2007-12-31-UnusedSelector.ll @@ -5,7 +5,7 @@ %struct.__type_info_pseudo = type { i8*, i8* } @_ZTI2e1 = external constant %struct.__class_type_info_pseudo ; <%struct.__class_type_info_pseudo*> [#uses=1] -define void @_Z7ex_testv() { +define void @_Z7ex_testv() personality i32 (...)* @__gxx_personality_v0 { entry: invoke void @__cxa_throw( i8* null, i8* bitcast (%struct.__class_type_info_pseudo* @_ZTI2e1 to i8*), void (i8*)* null ) noreturn to label %UnifiedUnreachableBlock unwind label %lpad @@ -14,13 +14,13 @@ unreachable lpad: ; preds = %entry - %lpad1 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + %lpad1 = landingpad { i8*, i32 } catch i8* null invoke void @__cxa_end_catch( ) to label %bb14 unwind label %lpad17 lpad17: ; preds = %lpad - %lpad2 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + %lpad2 = landingpad { i8*, i32 } catch i8* null unreachable Index: test/CodeGen/Generic/2009-11-16-BadKillsCrash.ll =================================================================== --- test/CodeGen/Generic/2009-11-16-BadKillsCrash.ll +++ test/CodeGen/Generic/2009-11-16-BadKillsCrash.ll @@ -19,7 +19,7 @@ declare %"struct.std::ctype"* @_ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale(%"struct.std::locale"*) -define %"struct.std::basic_istream >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(%"struct.std::basic_istream >"* %__in, i8* nocapture %__s) { +define %"struct.std::basic_istream >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(%"struct.std::basic_istream >"* %__in, i8* nocapture %__s) personality i32 (...)* @__gxx_personality_v0 { entry: %0 = invoke %"struct.std::ctype"* @_ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale(%"struct.std::locale"* undef) to label %invcont8 unwind label %lpad74 ; <%"struct.std::ctype"*> [#uses=0] @@ -62,14 +62,14 @@ lpad: ; preds = %bb.i93, %invcont24, %bb1.i, %invcont8 %__extracted.1 = phi i32 [ 0, %invcont8 ], [ %2, %bb1.i ], [ undef, %bb.i93 ], [ undef, %invcont24 ] ; [#uses=0] - %lpad1 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + %lpad1 = landingpad { i8*, i32 } catch i8* null %eh_ptr = extractvalue { i8*, i32 } %lpad1, 0 %6 = call i8* @__cxa_begin_catch(i8* %eh_ptr) nounwind ; [#uses=0] unreachable lpad74: ; preds = %entry - %lpad2 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + %lpad2 = landingpad { i8*, i32 } cleanup unreachable } Index: test/CodeGen/Generic/donothing.ll =================================================================== --- test/CodeGen/Generic/donothing.ll +++ test/CodeGen/Generic/donothing.ll @@ -5,7 +5,7 @@ declare void @llvm.donothing() readnone ; CHECK: f1 -define void @f1() nounwind uwtable ssp { +define void @f1() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: ; CHECK-NOT: donothing invoke void @llvm.donothing() @@ -15,7 +15,7 @@ ret void lpad: - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } filter [0 x i8*] zeroinitializer %1 = extractvalue { i8*, i32 } %0, 0 tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind Index: test/CodeGen/Generic/exception-handling.ll =================================================================== --- test/CodeGen/Generic/exception-handling.ll +++ test/CodeGen/Generic/exception-handling.ll @@ -2,7 +2,7 @@ ; PR10733 declare void @_Znam() -define void @_ZNK14gIndexOdometer15AfterExcisionOfERi() uwtable align 2 { +define void @_ZNK14gIndexOdometer15AfterExcisionOfERi() uwtable align 2 personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 { _ZN6Gambit5ArrayIiEC2Ej.exit36: br label %"9" @@ -19,7 +19,7 @@ lpad27: ; preds = %"10", %"9" %0 = phi i32 [ undef, %"9" ], [ %tmp, %"10" ] - %1 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 + %1 = landingpad { i8*, i32 } cleanup resume { i8*, i32 } zeroinitializer } Index: test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll =================================================================== --- test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll +++ test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll @@ -2,7 +2,7 @@ ; XFAIL: hexagon declare { i64, double } @wild() -define void @foo(i64* %p, double* %q) nounwind { +define void @foo(i64* %p, double* %q) nounwind personality i32 (...)* @__gxx_personality_v0 { %t = invoke { i64, double } @wild() to label %normal unwind label %handler normal: @@ -13,7 +13,7 @@ ret void handler: - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} catch i8* null ret void } Index: test/CodeGen/Mips/eh.ll =================================================================== --- test/CodeGen/Mips/eh.ll +++ test/CodeGen/Mips/eh.ll @@ -4,7 +4,7 @@ @g1 = global double 0.000000e+00, align 8 @_ZTId = external constant i8* -define void @_Z1fd(double %i2) { +define void @_Z1fd(double %i2) personality i32 (...)* @__gxx_personality_v0 { entry: ; CHECK-EL: addiu $sp, $sp ; CHECK-EL: .cfi_def_cfa_offset @@ -26,7 +26,7 @@ ; CHECK-EL: # %lpad ; CHECK-EL: bne $5 - %exn.val = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + %exn.val = landingpad { i8*, i32 } cleanup catch i8* bitcast (i8** @_ZTId to i8*) %exn = extractvalue { i8*, i32 } %exn.val, 0 Index: test/CodeGen/Mips/ehframe-indirect.ll =================================================================== --- test/CodeGen/Mips/ehframe-indirect.ll +++ test/CodeGen/Mips/ehframe-indirect.ll @@ -7,7 +7,7 @@ @_ZTISt9exception = external constant i8* -define i32 @main() { +define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { ; ALL: .cfi_startproc ; ALL: .cfi_personality 128, DW.ref.__gxx_personality_v0 @@ -17,8 +17,7 @@ ; ALL: jalr lpad: - %0 = landingpad { i8*, i32 } personality i8* - bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null catch i8* bitcast (i8** @_ZTISt9exception to i8*) ret i32 0 Index: test/CodeGen/Mips/insn-zero-size-bb.ll =================================================================== --- test/CodeGen/Mips/insn-zero-size-bb.ll +++ test/CodeGen/Mips/insn-zero-size-bb.ll @@ -8,7 +8,7 @@ declare i32 @foo(...) declare void @bar() -define void @main() { +define void @main() personality i8* bitcast (i32 (...)* @foo to i8*) { entry: invoke void @bar() #0 to label %unreachable unwind label %return @@ -19,7 +19,7 @@ unreachable return: - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @foo to i8*) + %0 = landingpad { i8*, i32 } catch i8* null ret void } Index: test/CodeGen/Mips/mips16ex.ll =================================================================== --- test/CodeGen/Mips/mips16ex.ll +++ test/CodeGen/Mips/mips16ex.ll @@ -9,7 +9,7 @@ @_ZTIi = external constant i8* @.str1 = private unnamed_addr constant [15 x i8] c"exception %i \0A\00", align 1 -define i32 @main() { +define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %retval = alloca i32, align 4 %exn.slot = alloca i8* @@ -24,7 +24,7 @@ to label %unreachable unwind label %lpad lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %1 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %2 = extractvalue { i8*, i32 } %1, 0 store i8* %2, i8** %exn.slot @@ -56,7 +56,7 @@ ret i32 0 lpad1: ; preds = %catch - %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %8 = landingpad { i8*, i32 } cleanup %9 = extractvalue { i8*, i32 } %8, 0 store i8* %9, i8** %exn.slot Index: test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll =================================================================== --- test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll +++ test/CodeGen/PowerPC/2007-11-16-landingpad-split.ll @@ -19,7 +19,7 @@ ; CHECK: .cfi_endproc -define void @Bork(i64 %range.0.0, i64 %range.0.1, i64 %size) { +define void @Bork(i64 %range.0.0, i64 %range.0.1, i64 %size) personality i32 (...)* @__gxx_personality_v0 { entry: %effectiveRange = alloca %struct.Range, align 8 ; <%struct.Range*> [#uses=2] %tmp4 = call i8* @llvm.stacksave() ; [#uses=1] @@ -33,7 +33,7 @@ br label %bb30 unwind: ; preds = %cond_true, %entry - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} catch i8* null call void @llvm.stackrestore(i8* %tmp4) resume { i8*, i32 } %exn Index: test/CodeGen/PowerPC/extra-toc-reg-deps.ll =================================================================== --- test/CodeGen/PowerPC/extra-toc-reg-deps.ll +++ test/CodeGen/PowerPC/extra-toc-reg-deps.ll @@ -61,7 +61,7 @@ @.str28 = external unnamed_addr constant [7 x i8], align 1 @_ZN4Foam4PoutE = external global %"class.Foam::prefixOSstream.27", align 8 -define void @_ZN4Foam13checkTopologyERKNS_8polyMeshEbb(i1 zeroext %allTopology) #0 { +define void @_ZN4Foam13checkTopologyERKNS_8polyMeshEbb(i1 zeroext %allTopology) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: br i1 undef, label %for.body, label %for.cond.cleanup @@ -124,7 +124,7 @@ to label %_ZN4Foam4wordC2EPKcb.exit unwind label %lpad.i lpad.i: ; preds = %_ZNK4Foam8ZoneMeshINS_9pointZoneENS_8polyMeshEE15checkDefinitionEb.exit - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } cleanup resume { i8*, i32 } %0 @@ -157,7 +157,7 @@ br i1 undef, label %if.then121, label %if.else lpad: ; preds = %_ZN4Foam4wordC2EPKcb.exit - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %1 = landingpad { i8*, i32 } cleanup br i1 undef, label %_ZNSsD2Ev.exit1578, label %if.then.i.i1570, !prof !1 @@ -181,7 +181,7 @@ to label %_ZN4Foam4wordC2EPKcb.exit1701 unwind label %lpad.i1689 lpad.i1689: ; preds = %if.else - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %2 = landingpad { i8*, i32 } cleanup unreachable @@ -200,12 +200,12 @@ unreachable lpad165: ; preds = %_ZN4Foam4wordC2EPKcb.exit1701 - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %3 = landingpad { i8*, i32 } cleanup unreachable lpad175: ; preds = %invoke.cont169 - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %4 = landingpad { i8*, i32 } cleanup invoke void @_ZN4Foam8pointSetD1Ev() to label %eh.resume unwind label %terminate.lpad @@ -215,7 +215,7 @@ to label %_ZN4Foam4wordC2EPKcb.exit1777 unwind label %lpad.i1765 lpad.i1765: ; preds = %if.end213 - %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %5 = landingpad { i8*, i32 } cleanup br i1 undef, label %eh.resume.i1776, label %if.then.i.i.i1767, !prof !1 @@ -247,12 +247,12 @@ to label %invoke.cont243 unwind label %lpad230 lpad217: ; preds = %_ZN4Foam4wordC2EPKcb.exit1777 - %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %6 = landingpad { i8*, i32 } cleanup br label %eh.resume lpad230: ; preds = %invoke.cont231, %_ZNSsD2Ev.exit1792 - %7 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %7 = landingpad { i8*, i32 } cleanup invoke void @_ZN4Foam7faceSetD1Ev() to label %eh.resume unwind label %terminate.lpad @@ -262,7 +262,7 @@ to label %_ZN4Foam4wordC2EPKcb.exit1862 unwind label %lpad.i1850 lpad.i1850: ; preds = %invoke.cont243 - %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %8 = landingpad { i8*, i32 } cleanup unreachable @@ -283,7 +283,7 @@ unreachable lpad276: ; preds = %_ZN4Foam4wordC2EPKcb.exit1862 - %9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %9 = landingpad { i8*, i32 } cleanup unreachable @@ -314,7 +314,7 @@ to label %if.end878 unwind label %lpad663 lpad663: ; preds = %invoke.cont670, %if.end660, %invoke.cont668, %invoke.cont674, %invoke.cont676 - %10 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %10 = landingpad { i8*, i32 } cleanup br i1 undef, label %_ZN4Foam4ListIiED2Ev.exit.i3073, label %delete.notnull.i.i3071 @@ -342,7 +342,7 @@ to label %_ZN4Foam4wordC2EPKcb.exit3098 unwind label %lpad.i3086 lpad.i3086: ; preds = %if.else888 - %11 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %11 = landingpad { i8*, i32 } cleanup unreachable @@ -371,7 +371,7 @@ unreachable lpad898: ; preds = %_ZN4Foam4wordC2EPKcb.exit3098 - %12 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %12 = landingpad { i8*, i32 } cleanup br i1 undef, label %_ZNSsD2Ev.exit3204, label %if.then.i.i3196, !prof !1 @@ -382,7 +382,7 @@ unreachable lpad905.loopexit.split-lp: ; preds = %call.i3116.noexc, %_ZNSsD2Ev.exit3113 - %lpad.loopexit.split-lp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %lpad.loopexit.split-lp = landingpad { i8*, i32 } cleanup invoke void @_ZN4Foam8pointSetD1Ev() to label %eh.resume unwind label %terminate.lpad @@ -391,7 +391,7 @@ resume { i8*, i32 } undef terminate.lpad: ; preds = %_ZN4Foam4ListIiED2Ev.exit.i3073, %lpad230, %lpad175, %lpad905.loopexit.split-lp - %13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %13 = landingpad { i8*, i32 } catch i8* null unreachable } Index: test/CodeGen/PowerPC/fast-isel-icmp-split.ll =================================================================== --- test/CodeGen/PowerPC/fast-isel-icmp-split.ll +++ test/CodeGen/PowerPC/fast-isel-icmp-split.ll @@ -9,7 +9,7 @@ %"class.boost::serialization::extended_type_info.129.150" = type { i32 (...)**, i32, i8* } ; Function Attrs: noinline -define void @_ZN5boost13serialization18extended_type_info4findEPKc() #0 align 2 { +define void @_ZN5boost13serialization18extended_type_info4findEPKc() #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: br i1 undef, label %cond.true, label %cond.false @@ -42,7 +42,7 @@ br label %cleanup lpad: ; preds = %cond.end - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %2 = landingpad { i8*, i32 } cleanup br label %eh.resume Index: test/CodeGen/PowerPC/glob-comp-aa-crash.ll =================================================================== --- test/CodeGen/PowerPC/glob-comp-aa-crash.ll +++ test/CodeGen/PowerPC/glob-comp-aa-crash.ll @@ -17,7 +17,7 @@ declare i32 @__gxx_personality_v0(...) ; Function Attrs: optsize -define void @_ZNSt3__117__assoc_sub_state4copyEv(%"class.std::__1::__assoc_sub_state"* %this) #0 align 2 { +define void @_ZNSt3__117__assoc_sub_state4copyEv(%"class.std::__1::__assoc_sub_state"* %this) #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %__lk = alloca %"class.std::__1::unique_lock", align 8 %ref.tmp = alloca %"class.std::__exception_ptr::exception_ptr", align 8 @@ -50,14 +50,14 @@ unreachable lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %1 = landingpad { i8*, i32 } cleanup %2 = extractvalue { i8*, i32 } %1, 0 %3 = extractvalue { i8*, i32 } %1, 1 br label %ehcleanup lpad3: ; preds = %if.then - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %4 = landingpad { i8*, i32 } cleanup %5 = extractvalue { i8*, i32 } %4, 0 %6 = extractvalue { i8*, i32 } %4, 1 Index: test/CodeGen/PowerPC/pr18663-2.ll =================================================================== --- test/CodeGen/PowerPC/pr18663-2.ll +++ test/CodeGen/PowerPC/pr18663-2.ll @@ -46,7 +46,7 @@ ; Function Attrs: inlinehint declare void @_ZN4Foam8fileName12stripInvalidEv() #2 align 2 -define void @_ZN4Foam3CSVINS_6VectorIdEEE4readEv() #0 align 2 { +define void @_ZN4Foam3CSVINS_6VectorIdEEE4readEv() #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: invoke void @_ZN4Foam6string6expandEb() to label %invoke.cont unwind label %lpad @@ -66,7 +66,7 @@ to label %invoke.cont2 unwind label %lpad.i lpad.i: ; preds = %_ZN4Foam6stringC2ERKS0_.exit.i - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %0 = landingpad { i8*, i32 } cleanup br label %ehcleanup142 @@ -90,17 +90,17 @@ to label %if.end unwind label %lpad5 lpad: ; preds = %if.then.i.i.i.i176, %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %1 = landingpad { i8*, i32 } cleanup br label %ehcleanup142 lpad3: ; preds = %invoke.cont2 - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %2 = landingpad { i8*, i32 } cleanup br label %ehcleanup142 lpad5: ; preds = %memptr.end.i, %invoke.cont8, %if.then - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %3 = landingpad { i8*, i32 } cleanup br label %ehcleanup142 @@ -119,12 +119,12 @@ unreachable lpad.i.i.i: ; preds = %.noexc205 - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %4 = landingpad { i8*, i32 } cleanup br label %ehcleanup142 lpad19: ; preds = %for.body - %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %5 = landingpad { i8*, i32 } cleanup br label %ehcleanup142 Index: test/CodeGen/PowerPC/preincprep-invoke.ll =================================================================== --- test/CodeGen/PowerPC/preincprep-invoke.ll +++ test/CodeGen/PowerPC/preincprep-invoke.ll @@ -11,7 +11,7 @@ declare i32 @__gxx_personality_v0(...) -define void @_Z11GetPasswordP13CStdOutStreamb() { +define void @_Z11GetPasswordP13CStdOutStreamb() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: br label %for.cond.i.i @@ -41,7 +41,7 @@ br label %for.cond.i.i30 lpad: ; preds = %invoke.cont4, %invoke.cont, %_ZN11CStringBaseIcEC2EPKc.exit.critedge - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %1 = landingpad { i8*, i32 } cleanup resume { i8*, i32 } undef } Index: test/CodeGen/SPARC/exception.ll =================================================================== --- test/CodeGen/SPARC/exception.ll +++ test/CodeGen/SPARC/exception.ll @@ -71,7 +71,7 @@ ; V9PIC: .L_ZTIi.DW.stub: ; V9PIC-NEXT: .xword _ZTIi -define i32 @main(i32 %argc, i8** nocapture readnone %argv) unnamed_addr #0 { +define i32 @main(i32 %argc, i8** nocapture readnone %argv) unnamed_addr #0 personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 { entry: %0 = icmp eq i32 %argc, 2 %1 = tail call i8* @__cxa_allocate_exception(i32 4) #1 @@ -102,7 +102,7 @@ ret i32 %6 "8": ; preds = %"4", %"3" - %exc = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 + %exc = landingpad { i8*, i32 } catch %struct.__fundamental_type_info_pseudo* @_ZTIi catch %struct.__fundamental_type_info_pseudo* @_ZTIf %exc_ptr12 = extractvalue { i8*, i32 } %exc, 0 Index: test/CodeGen/Thumb/sjljehprepare-lower-vector.ll =================================================================== --- test/CodeGen/Thumb/sjljehprepare-lower-vector.ll +++ test/CodeGen/Thumb/sjljehprepare-lower-vector.ll @@ -4,7 +4,7 @@ target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32" target triple = "thumbv7-apple-ios" -define i8* @foo(<4 x i32> %c) { +define i8* @foo(<4 x i32> %c) personality i8* bitcast (i32 (...)* @baz to i8*) { entry: invoke void @bar () to label %unreachable unwind label %handler @@ -13,7 +13,7 @@ unreachable handler: - %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @baz to i8*) + %tmp = landingpad { i8*, i32 } cleanup resume { i8*, i32 } undef } Index: test/CodeGen/Thumb2/constant-islands.ll =================================================================== --- test/CodeGen/Thumb2/constant-islands.ll +++ test/CodeGen/Thumb2/constant-islands.ll @@ -76,7 +76,7 @@ declare %class.btMatrix3x3* @_ZN11btTransform8getBasisEv(%class.btTransform*) nounwind inlinehint ssp align 2 -define %class.RagDoll* @_ZN7RagDollC2EP15btDynamicsWorldRK9btVector3f(%class.RagDoll* %this, %class.btDynamicsWorld* %ownerWorld, %class.btVector3* %positionOffset, float %scale) unnamed_addr ssp align 2 { +define %class.RagDoll* @_ZN7RagDollC2EP15btDynamicsWorldRK9btVector3f(%class.RagDoll* %this, %class.btDynamicsWorld* %ownerWorld, %class.btVector3* %positionOffset, float %scale) unnamed_addr ssp align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) { entry: %retval = alloca %class.RagDoll*, align 4 %this.addr = alloca %class.RagDoll*, align 4 @@ -635,7 +635,7 @@ br label %for.cond lpad: ; preds = %entry - %67 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %67 = landingpad { i8*, i32 } cleanup %68 = extractvalue { i8*, i32 } %67, 0 store i8* %68, i8** %exn.slot @@ -648,7 +648,7 @@ br label %eh.resume lpad8: ; preds = %invoke.cont - %70 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %70 = landingpad { i8*, i32 } cleanup %71 = extractvalue { i8*, i32 } %70, 0 store i8* %71, i8** %exn.slot @@ -661,7 +661,7 @@ br label %eh.resume lpad17: ; preds = %invoke.cont9 - %73 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %73 = landingpad { i8*, i32 } cleanup %74 = extractvalue { i8*, i32 } %73, 0 store i8* %74, i8** %exn.slot @@ -674,7 +674,7 @@ br label %eh.resume lpad26: ; preds = %invoke.cont18 - %76 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %76 = landingpad { i8*, i32 } cleanup %77 = extractvalue { i8*, i32 } %76, 0 store i8* %77, i8** %exn.slot @@ -687,7 +687,7 @@ br label %eh.resume lpad35: ; preds = %invoke.cont27 - %79 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %79 = landingpad { i8*, i32 } cleanup %80 = extractvalue { i8*, i32 } %79, 0 store i8* %80, i8** %exn.slot @@ -700,7 +700,7 @@ br label %eh.resume lpad44: ; preds = %invoke.cont36 - %82 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %82 = landingpad { i8*, i32 } cleanup %83 = extractvalue { i8*, i32 } %82, 0 store i8* %83, i8** %exn.slot @@ -713,7 +713,7 @@ br label %eh.resume lpad53: ; preds = %invoke.cont45 - %85 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %85 = landingpad { i8*, i32 } cleanup %86 = extractvalue { i8*, i32 } %85, 0 store i8* %86, i8** %exn.slot @@ -726,7 +726,7 @@ br label %eh.resume lpad62: ; preds = %invoke.cont54 - %88 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %88 = landingpad { i8*, i32 } cleanup %89 = extractvalue { i8*, i32 } %88, 0 store i8* %89, i8** %exn.slot @@ -739,7 +739,7 @@ br label %eh.resume lpad71: ; preds = %invoke.cont63 - %91 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %91 = landingpad { i8*, i32 } cleanup %92 = extractvalue { i8*, i32 } %91, 0 store i8* %92, i8** %exn.slot @@ -752,7 +752,7 @@ br label %eh.resume lpad80: ; preds = %invoke.cont72 - %94 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %94 = landingpad { i8*, i32 } cleanup %95 = extractvalue { i8*, i32 } %94, 0 store i8* %95, i8** %exn.slot @@ -765,7 +765,7 @@ br label %eh.resume lpad89: ; preds = %invoke.cont81 - %97 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %97 = landingpad { i8*, i32 } cleanup %98 = extractvalue { i8*, i32 } %97, 0 store i8* %98, i8** %exn.slot @@ -1264,7 +1264,7 @@ ret %class.RagDoll* %200 lpad258: ; preds = %for.end - %201 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %201 = landingpad { i8*, i32 } cleanup %202 = extractvalue { i8*, i32 } %201, 0 store i8* %202, i8** %exn.slot @@ -1274,7 +1274,7 @@ br label %eh.resume lpad284: ; preds = %invoke.cont259 - %204 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %204 = landingpad { i8*, i32 } cleanup %205 = extractvalue { i8*, i32 } %204, 0 store i8* %205, i8** %exn.slot @@ -1284,7 +1284,7 @@ br label %eh.resume lpad313: ; preds = %invoke.cont285 - %207 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %207 = landingpad { i8*, i32 } cleanup %208 = extractvalue { i8*, i32 } %207, 0 store i8* %208, i8** %exn.slot @@ -1294,7 +1294,7 @@ br label %eh.resume lpad342: ; preds = %invoke.cont314 - %210 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %210 = landingpad { i8*, i32 } cleanup %211 = extractvalue { i8*, i32 } %210, 0 store i8* %211, i8** %exn.slot @@ -1304,7 +1304,7 @@ br label %eh.resume lpad371: ; preds = %invoke.cont343 - %213 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %213 = landingpad { i8*, i32 } cleanup %214 = extractvalue { i8*, i32 } %213, 0 store i8* %214, i8** %exn.slot @@ -1314,7 +1314,7 @@ br label %eh.resume lpad400: ; preds = %invoke.cont372 - %216 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %216 = landingpad { i8*, i32 } cleanup %217 = extractvalue { i8*, i32 } %216, 0 store i8* %217, i8** %exn.slot @@ -1324,7 +1324,7 @@ br label %eh.resume lpad429: ; preds = %invoke.cont401 - %219 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %219 = landingpad { i8*, i32 } cleanup %220 = extractvalue { i8*, i32 } %219, 0 store i8* %220, i8** %exn.slot @@ -1334,7 +1334,7 @@ br label %eh.resume lpad458: ; preds = %invoke.cont430 - %222 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %222 = landingpad { i8*, i32 } cleanup %223 = extractvalue { i8*, i32 } %222, 0 store i8* %223, i8** %exn.slot @@ -1344,7 +1344,7 @@ br label %eh.resume lpad487: ; preds = %invoke.cont459 - %225 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %225 = landingpad { i8*, i32 } cleanup %226 = extractvalue { i8*, i32 } %225, 0 store i8* %226, i8** %exn.slot @@ -1354,7 +1354,7 @@ br label %eh.resume lpad516: ; preds = %invoke.cont488 - %228 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %228 = landingpad { i8*, i32 } cleanup %229 = extractvalue { i8*, i32 } %228, 0 store i8* %229, i8** %exn.slot @@ -1371,7 +1371,7 @@ resume { i8*, i32 } %lpad.val526 terminate.lpad: ; preds = %lpad89, %lpad80, %lpad71, %lpad62, %lpad53, %lpad44, %lpad35, %lpad26, %lpad17, %lpad8, %lpad - %231 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) + %231 = landingpad { i8*, i32 } catch i8* null call void @_ZSt9terminatev() noreturn nounwind unreachable Index: test/CodeGen/WinEH/cppeh-alloca-sink.ll =================================================================== --- test/CodeGen/WinEH/cppeh-alloca-sink.ll +++ test/CodeGen/WinEH/cppeh-alloca-sink.ll @@ -51,7 +51,7 @@ @llvm.eh.handlertype.H.0 = private unnamed_addr constant %eh.CatchHandlerType { i32 0, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) }, section "llvm.metadata" ; Function Attrs: uwtable -define void @sink_alloca_to_catch() #0 { +define void @sink_alloca_to_catch() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %0 = alloca i32 %only_used_in_catch = alloca i32, align 4 @@ -59,7 +59,7 @@ to label %try.cont unwind label %lpad lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %1 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 %2 = extractvalue { i8*, i32 } %1, 1 %3 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)) #3 @@ -86,7 +86,7 @@ declare void @use_catch_var(i32*) #1 ; Function Attrs: uwtable -define void @dont_sink_alloca_to_catch(i32 %n) #0 { +define void @dont_sink_alloca_to_catch(i32 %n) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %0 = alloca i32 %n.addr = alloca i32, align 4 @@ -109,7 +109,7 @@ br label %try.cont lpad: ; preds = %while.body - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*) %3 = extractvalue { i8*, i32 } %2, 0 store i8* %3, i8** %exn.slot @@ -141,7 +141,7 @@ br label %while.cond lpad1: ; preds = %catch - %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %8 = landingpad { i8*, i32 } cleanup %9 = extractvalue { i8*, i32 } %8, 0 store i8* %9, i8** %exn.slot Index: test/CodeGen/WinEH/cppeh-catch-all.ll =================================================================== --- test/CodeGen/WinEH/cppeh-catch-all.ll +++ test/CodeGen/WinEH/cppeh-catch-all.ll @@ -25,7 +25,7 @@ ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] ; Function Attrs: uwtable -define void @_Z4testv() #0 { +define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -36,13 +36,13 @@ br label %try.cont ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: catch i8* null ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @_Z4testv.catch) ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont] lpad: ; preds = %entry - %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %tmp = landingpad { i8*, i32 } catch i8* null %tmp1 = extractvalue { i8*, i32 } %tmp, 0 store i8* %tmp1, i8** %exn.slot Index: test/CodeGen/WinEH/cppeh-catch-and-throw.ll =================================================================== --- test/CodeGen/WinEH/cppeh-catch-and-throw.ll +++ test/CodeGen/WinEH/cppeh-catch-and-throw.ll @@ -50,7 +50,7 @@ ; CHECK: } ; Function Attrs: uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %o = alloca %class.Obj, align 1 %tmp = alloca i32, align 4 @@ -62,7 +62,7 @@ to label %unreachable unwind label %lpad lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %1 = landingpad { i8*, i32 } catch i8* null %2 = extractvalue { i8*, i32 } %1, 0 store i8* %2, i8** %exn.slot @@ -78,7 +78,7 @@ to label %unreachable unwind label %lpad1 lpad1: ; preds = %catch - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %4 = landingpad { i8*, i32 } cleanup %5 = extractvalue { i8*, i32 } %4, 0 store i8* %5, i8** %exn.slot @@ -113,7 +113,7 @@ ; CHECK: [[SPLIT_LABEL]] ; ; CHECK: [[LPAD_LABEL]] -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK: cleanup ; CHECK: unreachable ; CHECK: } Index: test/CodeGen/WinEH/cppeh-catch-scalar.ll =================================================================== --- test/CodeGen/WinEH/cppeh-catch-scalar.ll +++ test/CodeGen/WinEH/cppeh-catch-scalar.ll @@ -29,7 +29,7 @@ ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] ; Function Attrs: uwtable -define void @_Z4testv() #0 { +define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -41,13 +41,13 @@ br label %try.cont ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*) ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i8** @_ZTIi to i8*), i32 0, i8* (i8*, i8*)* @_Z4testv.catch) ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont] lpad: ; preds = %entry - %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %tmp = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*) %tmp1 = extractvalue { i8*, i32 } %tmp, 0 store i8* %tmp1, i8** %exn.slot Index: test/CodeGen/WinEH/cppeh-catch-unwind.ll =================================================================== --- test/CodeGen/WinEH/cppeh-catch-unwind.ll +++ test/CodeGen/WinEH/cppeh-catch-unwind.ll @@ -31,7 +31,7 @@ @"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat -; CHECK-LABEL: define void @"\01?test@@YAXXZ"() #0 { +; CHECK-LABEL: define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { ; CHECK: entry: ; CHECK: [[OBJ_PTR:\%.+]] = alloca %class.SomeClass ; CHECK: [[TMP0:\%.+]] = alloca i32, align 4 @@ -41,7 +41,7 @@ ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] ; Function Attrs: uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %obj = alloca %class.SomeClass, align 1 %0 = alloca i32, align 4 @@ -66,27 +66,27 @@ to label %try.cont unwind label %lpad3 ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: [[LPAD_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: [[LPAD_VAL:\%.+]] = landingpad { i8*, i32 } ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch") ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont15] lpad: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) %3 = extractvalue { i8*, i32 } %2, 0 %4 = extractvalue { i8*, i32 } %2, 1 br label %catch.dispatch7 ; CHECK: [[LPAD1_LABEL]]:{{[ ]+}}; preds = %invoke.cont -; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK-NEXT: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test@@YAXXZ.cleanup", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch") ; CHECK-NEXT: indirectbr i8* [[RECOVER1]], [label %try.cont15] lpad1: ; preds = %invoke.cont - %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %5 = landingpad { i8*, i32 } cleanup catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) %6 = extractvalue { i8*, i32 } %5, 0 @@ -94,14 +94,14 @@ br label %ehcleanup ; CHECK: [[LPAD3_LABEL]]:{{[ ]+}}; preds = %invoke.cont2 -; CHECK: [[LPAD3_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: [[LPAD3_VAL:\%.+]] = landingpad { i8*, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK-NEXT: [[RECOVER3:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1", i32 0, void (i8*, i8*)* @"\01?test@@YAXXZ.cleanup") ; CHECK-NEXT: indirectbr i8* [[RECOVER3]], [label %try.cont, label %try.cont15] lpad3: ; preds = %invoke.cont2 - %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %8 = landingpad { i8*, i32 } cleanup catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) %9 = extractvalue { i8*, i32 } %8, 0 @@ -128,7 +128,7 @@ ; CHECK-NOT: lpad5: lpad5: ; preds = %catch - %13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %13 = landingpad { i8*, i32 } cleanup catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) %14 = extractvalue { i8*, i32 } %13, 0 @@ -202,7 +202,7 @@ ; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont) ; ; CHECK: [[LPAD5_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: [[LPAD5_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: [[LPAD5_VAL:\%.+]] = landingpad { i8*, i32 } ; CHECK: cleanup ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK: } Index: test/CodeGen/WinEH/cppeh-cleanup-invoke.ll =================================================================== --- test/CodeGen/WinEH/cppeh-cleanup-invoke.ll +++ test/CodeGen/WinEH/cppeh-cleanup-invoke.ll @@ -26,7 +26,7 @@ @"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat @llvm.eh.handlertype.H.0 = private unnamed_addr constant %eh.CatchHandlerType { i32 0, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) }, section "llvm.metadata" -define i32 @main() { +define i32 @main() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %o = alloca %struct.HasDtor, align 1 invoke void @may_throw() @@ -37,14 +37,14 @@ br label %try.cont lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 %1 = extractvalue { i8*, i32 } %0, 0 %2 = extractvalue { i8*, i32 } %0, 1 br label %catch.dispatch lpad1: ; preds = %invoke.cont - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %3 = landingpad { i8*, i32 } cleanup catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 %4 = extractvalue { i8*, i32 } %3, 0 Index: test/CodeGen/WinEH/cppeh-demote-liveout.ll =================================================================== --- test/CodeGen/WinEH/cppeh-demote-liveout.ll +++ test/CodeGen/WinEH/cppeh-demote-liveout.ll @@ -19,14 +19,14 @@ @typeinfo.int = external global i32 -define i32 @liveout_catch(i32 %p) { +define i32 @liveout_catch(i32 %p) personality i32 (...)* @__CxxFrameHandler3 { entry: %val.entry = add i32 %p, 1 invoke void @might_throw() to label %ret unwind label %lpad lpad: - %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__CxxFrameHandler3 + %ehvals = landingpad { i8*, i32 } cleanup catch i32* @typeinfo.int %ehptr = extractvalue { i8*, i32 } %ehvals, 0 Index: test/CodeGen/WinEH/cppeh-frame-vars.ll =================================================================== --- test/CodeGen/WinEH/cppeh-frame-vars.ll +++ test/CodeGen/WinEH/cppeh-frame-vars.ll @@ -62,7 +62,7 @@ ; CHECK: br label %for.cond ; Function Attrs: uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %NumExceptions = alloca i32, align 4 %ExceptionVal = alloca [10 x i32], align 16 @@ -99,13 +99,13 @@ br label %try.cont ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %for.body -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch") ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont] lpad: ; preds = %for.body - %tmp4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %tmp4 = landingpad { i8*, i32 } catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) %tmp5 = extractvalue { i8*, i32 } %tmp4, 0 store i8* %tmp5, i8** %exn.slot Index: test/CodeGen/WinEH/cppeh-inalloca.ll =================================================================== --- test/CodeGen/WinEH/cppeh-inalloca.ll +++ test/CodeGen/WinEH/cppeh-inalloca.ll @@ -45,7 +45,7 @@ ; CHECK: invoke void @"\01?may_throw@@YAXXZ"() ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] -define i32 @"\01?test@@YAHUA@@@Z"(<{ %struct.A }>* inalloca) #0 { +define i32 @"\01?test@@YAHUA@@@Z"(<{ %struct.A }>* inalloca) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %retval = alloca i32, align 4 %exn.slot = alloca i8* @@ -59,14 +59,14 @@ br label %try.cont ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK-NEXT: [[RECOVER:\%recover.*]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAHUA@@@Z.catch", i32 0, void (i8*, i8*)* @"\01?test@@YAHUA@@@Z.cleanup") ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %cleanup] lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %1 = landingpad { i8*, i32 } cleanup catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) %2 = extractvalue { i8*, i32 } %1, 0 Index: test/CodeGen/WinEH/cppeh-min-unwind.ll =================================================================== --- test/CodeGen/WinEH/cppeh-min-unwind.ll +++ test/CodeGen/WinEH/cppeh-min-unwind.ll @@ -30,7 +30,7 @@ ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] ; Function Attrs: uwtable -define void @_Z4testv() #0 { +define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %obj = alloca %class.SomeClass, align 4 %exn.slot = alloca i8* @@ -44,13 +44,13 @@ ret void ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @_Z4testv.cleanup) ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [] lpad: ; preds = %entry - %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %tmp = landingpad { i8*, i32 } cleanup %tmp1 = extractvalue { i8*, i32 } %tmp, 0 store i8* %tmp1, i8** %exn.slot Index: test/CodeGen/WinEH/cppeh-mixed-catch-and-cleanup.ll =================================================================== --- test/CodeGen/WinEH/cppeh-mixed-catch-and-cleanup.ll +++ test/CodeGen/WinEH/cppeh-mixed-catch-and-cleanup.ll @@ -35,7 +35,7 @@ ; CHECK: } ; Function Attrs: nounwind uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %o = alloca %class.Obj, align 1 %exn.slot = alloca i8* @@ -48,7 +48,7 @@ br label %try.cont lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 store i8* %1, i8** %exn.slot Index: test/CodeGen/WinEH/cppeh-multi-catch.ll =================================================================== --- test/CodeGen/WinEH/cppeh-multi-catch.ll +++ test/CodeGen/WinEH/cppeh-multi-catch.ll @@ -45,7 +45,7 @@ @"llvm.eh.handlermapentry.reference.?AVSomeClass@@" = private unnamed_addr constant %eh.HandlerMapEntry { i32 8, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor15* @"\01??_R0?AVSomeClass@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, section "llvm.metadata" -; CHECK: define void @"\01?test@@YAXXZ"() #0 { +; CHECK: define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { ; CHECK: entry: ; CHECK: [[OBJ_PTR:\%.+]] = alloca %class.SomeClass*, align 8 ; CHECK: [[LL_PTR:\%.+]] = alloca i64, align 8 @@ -55,7 +55,7 @@ ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] ; Function Attrs: uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -69,7 +69,7 @@ br label %try.cont ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: catch %eh.HandlerMapEntry* @llvm.eh.handlermapentry.H ; CHECK-NEXT: catch %eh.HandlerMapEntry* @llvm.eh.handlermapentry._J ; CHECK-NEXT: catch %eh.HandlerMapEntry* @"llvm.eh.handlermapentry.reference.?AVSomeClass@@" @@ -82,7 +82,7 @@ ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %ret] lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch %eh.HandlerMapEntry* @llvm.eh.handlermapentry.H catch %eh.HandlerMapEntry* @llvm.eh.handlermapentry._J catch %eh.HandlerMapEntry* @"llvm.eh.handlermapentry.reference.?AVSomeClass@@" Index: test/CodeGen/WinEH/cppeh-nested-1.ll =================================================================== --- test/CodeGen/WinEH/cppeh-nested-1.ll +++ test/CodeGen/WinEH/cppeh-nested-1.ll @@ -39,7 +39,7 @@ ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] ; Function Attrs: uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -52,14 +52,14 @@ br label %try.cont ; CHECK: [[LPAD_LABEL]]: -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) ; CHECK: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch") ; CHECK: indirectbr i8* [[RECOVER]], [label %try.cont, label %try.cont10] lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) %1 = extractvalue { i8*, i32 } %0, 0 @@ -94,7 +94,7 @@ ; CHECK-NOT: lpad1: lpad1: ; preds = %catch - %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %6 = landingpad { i8*, i32 } catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) %7 = extractvalue { i8*, i32 } %6, 0 store i8* %7, i8** %exn.slot @@ -155,7 +155,7 @@ ; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont) ; ; CHECK: [[LPAD1_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) ; CHECK: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch") ; CHECK: indirectbr i8* [[RECOVER1]], [] Index: test/CodeGen/WinEH/cppeh-nested-2.ll =================================================================== --- test/CodeGen/WinEH/cppeh-nested-2.ll +++ test/CodeGen/WinEH/cppeh-nested-2.ll @@ -49,7 +49,7 @@ ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] ; Function Attrs: uwtable -define void @_Z4testv() #0 { +define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %outer = alloca %class.Outer, align 1 %exn.slot = alloca i8* @@ -91,13 +91,13 @@ br label %try.cont ; CHECK: [[LPAD_LABEL]]: -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIf to i8*) ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i8** @_ZTIf to i8*), i32 0, i8* (i8*, i8*)* @_Z4testv.catch) ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont19] lpad: ; preds = %try.cont, %entry - %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %tmp = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIf to i8*) %tmp1 = extractvalue { i8*, i32 } %tmp, 0 store i8* %tmp1, i8** %exn.slot @@ -106,7 +106,7 @@ br label %catch.dispatch11 ; CHECK: [[LPAD1_LABEL]]: -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*) ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIf to i8*) @@ -117,7 +117,7 @@ ; CHECK-NEXT: indirectbr i8* [[RECOVER1]], [label %try.cont, label %try.cont19] lpad1: ; preds = %invoke.cont4, %invoke.cont - %tmp3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %tmp3 = landingpad { i8*, i32 } cleanup catch i8* bitcast (i8** @_ZTIi to i8*) catch i8* bitcast (i8** @_ZTIf to i8*) @@ -128,7 +128,7 @@ br label %catch.dispatch ; CHECK: [[LPAD3_LABEL]]: -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: cleanup ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*) ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIf to i8*) @@ -140,7 +140,7 @@ ; CHECK-NEXT: indirectbr i8* [[RECOVER3]], [label %try.cont, label %try.cont19] lpad3: ; preds = %invoke.cont2 - %tmp6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %tmp6 = landingpad { i8*, i32 } cleanup catch i8* bitcast (i8** @_ZTIi to i8*) catch i8* bitcast (i8** @_ZTIf to i8*) @@ -189,7 +189,7 @@ ; CHECK-NOT: lpad7: lpad7: ; preds = %catch - %tmp14 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %tmp14 = landingpad { i8*, i32 } cleanup catch i8* bitcast (i8** @_ZTIf to i8*) %tmp15 = extractvalue { i8*, i32 } %tmp14, 0 @@ -263,7 +263,7 @@ ; CHECK: ret i8* blockaddress(@_Z4testv, %try.cont) ; ; CHECK: [[LPAD7_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: [[LPAD7_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: [[LPAD7_VAL:\%.+]] = landingpad { i8*, i32 } ; (FIXME) The nested handler body isn't being populated yet. ; CHECK: } Index: test/CodeGen/WinEH/cppeh-nested-3.ll =================================================================== --- test/CodeGen/WinEH/cppeh-nested-3.ll +++ test/CodeGen/WinEH/cppeh-nested-3.ll @@ -46,7 +46,7 @@ ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]] ; Function Attrs: uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -60,14 +60,14 @@ br label %try.cont10 ; CHECK: [[LPAD_LABEL]]: -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) ; CHECK: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.2", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1") ; CHECK: indirectbr i8* [[RECOVER]], [label %try.cont10, label %try.cont19] lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) %1 = extractvalue { i8*, i32 } %0, 0 @@ -97,7 +97,7 @@ ; CHECK-NOT: lpad1: lpad1: ; preds = %catch - %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %5 = landingpad { i8*, i32 } catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) %6 = extractvalue { i8*, i32 } %5, 0 @@ -139,7 +139,7 @@ ; CHECK-NOT: lpad8: lpad8: ; preds = %try.cont - %12 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %12 = landingpad { i8*, i32 } catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) %13 = extractvalue { i8*, i32 } %12, 0 store i8* %13, i8** %exn.slot @@ -212,7 +212,7 @@ ; CHECK: to label %invoke.cont9 unwind label %[[LPAD8_LABEL:lpad[0-9]*]] ; ; CHECK: [[LPAD1_LABEL]]:{{[ ]+}}; preds = %entry -; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) ; CHECK: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1") @@ -222,7 +222,7 @@ ; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont10) ; ; CHECK: [[LPAD8_LABEL]]:{{[ ]+}}; preds = %invoke.cont2 -; CHECK: [[LPAD8_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: [[LPAD8_VAL:\%.+]] = landingpad { i8*, i32 } ; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*) ; CHECK: [[RECOVER2:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1") ; CHECK: indirectbr i8* [[RECOVER2]], [] Index: test/CodeGen/WinEH/cppeh-nested-rethrow.ll =================================================================== --- test/CodeGen/WinEH/cppeh-nested-rethrow.ll +++ test/CodeGen/WinEH/cppeh-nested-rethrow.ll @@ -56,7 +56,7 @@ ; CHECK: call void (...) @llvm.frameescape ; Function Attrs: nounwind uwtable -define void @"\01?test1@@YAXXZ"() #0 { +define void @"\01?test1@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %tmp = alloca i32, align 4 %exn.slot = alloca i8* @@ -67,7 +67,7 @@ to label %unreachable unwind label %lpad lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %1 = landingpad { i8*, i32 } catch i8* null %2 = extractvalue { i8*, i32 } %1, 0 store i8* %2, i8** %exn.slot @@ -82,7 +82,7 @@ to label %unreachable unwind label %lpad1 lpad1: ; preds = %catch - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %4 = landingpad { i8*, i32 } catch i8* null %5 = extractvalue { i8*, i32 } %4, 0 store i8* %5, i8** %exn.slot @@ -124,7 +124,7 @@ ; CHECK: call void (...) @llvm.frameescape ; Function Attrs: nounwind uwtable -define void @"\01?test2@@YAXXZ"() #0 { +define void @"\01?test2@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %tmp = alloca i32, align 4 %exn.slot = alloca i8* @@ -135,7 +135,7 @@ to label %unreachable unwind label %lpad lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %1 = landingpad { i8*, i32 } catch i8* null %2 = extractvalue { i8*, i32 } %1, 0 store i8* %2, i8** %exn.slot @@ -150,7 +150,7 @@ to label %unreachable unwind label %lpad1 lpad1: ; preds = %catch - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %4 = landingpad { i8*, i32 } catch i8* null %5 = extractvalue { i8*, i32 } %4, 0 store i8* %5, i8** %exn.slot Index: test/CodeGen/WinEH/cppeh-nonalloca-frame-values.ll =================================================================== --- test/CodeGen/WinEH/cppeh-nonalloca-frame-values.ll +++ test/CodeGen/WinEH/cppeh-nonalloca-frame-values.ll @@ -72,7 +72,7 @@ ; CHECK: br label %for.body ; Function Attrs: uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %e = alloca i32, align 4 %ExceptionVal = alloca [10 x i32], align 16 @@ -112,13 +112,13 @@ br label %try.cont ; CHECK: [[LPAD_LABEL:lpad[0-9]*]]:{{[ ]+}}; preds = %for.body -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch") ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %[[SPLIT_RECOVER_BB:.*]]] lpad: ; preds = %for.body - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) %3 = extractvalue { i8*, i32 } %2, 1 %4 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)) #1 Index: test/CodeGen/WinEH/cppeh-prepared-catch-all.ll =================================================================== --- test/CodeGen/WinEH/cppeh-prepared-catch-all.ll +++ test/CodeGen/WinEH/cppeh-prepared-catch-all.ll @@ -18,13 +18,13 @@ declare void @llvm.eh.endcatch() #2 ; Function Attrs: nounwind uwtable -define void @test_catch_all() #0 { +define void @test_catch_all() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: invoke void @may_throw() to label %try.cont unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 tail call void @llvm.eh.begincatch(i8* %1, i8* null) #2 Index: test/CodeGen/WinEH/cppeh-prepared-catch-reordered.ll =================================================================== --- test/CodeGen/WinEH/cppeh-prepared-catch-reordered.ll +++ test/CodeGen/WinEH/cppeh-prepared-catch-reordered.ll @@ -43,7 +43,7 @@ declare void @_CxxThrowException(i8*, %eh.ThrowInfo*) ; Function Attrs: uwtable -define i32 @main() #1 { +define i32 @main() #1 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %tmp.i = alloca i32, align 4 %e = alloca i32, align 4 @@ -57,7 +57,7 @@ unreachable lpad1: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %1 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 %recover = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*), i32 0, i8* (i8*, i8*)* @main.catch) indirectbr i8* %recover, [label %try.cont.split] @@ -90,7 +90,7 @@ ; Function Attrs: nounwind declare i8* @llvm.eh.actions(...) #3 -define internal i8* @main.catch(i8*, i8*) #5 { +define internal i8* @main.catch(i8*, i8*) #5 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %e.i8 = call i8* @llvm.framerecover(i8* bitcast (i32 ()* @main to i8*), i8* %1, i32 0) %e = bitcast i8* %e.i8 to i32* @@ -104,7 +104,7 @@ ret i8* blockaddress(@main, %try.cont.split) stub: ; preds = %entry - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %4 = landingpad { i8*, i32 } cleanup %recover = call i8* (...) @llvm.eh.actions() unreachable Index: test/CodeGen/WinEH/cppeh-prepared-catch.ll =================================================================== --- test/CodeGen/WinEH/cppeh-prepared-catch.ll +++ test/CodeGen/WinEH/cppeh-prepared-catch.ll @@ -30,7 +30,7 @@ @"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat @llvm.eh.handlertype.H.8 = private unnamed_addr constant %eh.CatchHandlerType { i32 8, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) }, section "llvm.metadata" -define internal i8* @"\01?f@@YAXXZ.catch"(i8*, i8*) #4 { +define internal i8* @"\01?f@@YAXXZ.catch"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?f@@YAXXZ" to i8*), i8* %1, i32 0) %bc2 = bitcast i8* %.i8 to i32** @@ -42,7 +42,7 @@ ret i8* blockaddress(@"\01?f@@YAXXZ", %try.cont) lpad1: ; preds = %entry - %lp4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %lp4 = landingpad { i8*, i32 } cleanup catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0 %recover = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1") @@ -56,7 +56,7 @@ ; CHECK: .long ("$cppxdata$?f@@YAXXZ")@IMGREL -define internal i8* @"\01?f@@YAXXZ.catch1"(i8*, i8*) #4 { +define internal i8* @"\01?f@@YAXXZ.catch1"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?f@@YAXXZ" to i8*), i8* %1, i32 1) %2 = bitcast i8* %.i8 to double* @@ -68,7 +68,7 @@ ret i8* blockaddress(@"\01?f@@YAXXZ", %try.cont8) lpad: ; preds = %entry - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %4 = landingpad { i8*, i32 } cleanup %recover = call i8* (...) @llvm.eh.actions() unreachable @@ -82,7 +82,7 @@ ; CHECK: .seh_handlerdata ; CHECK: .long ("$cppxdata$?f@@YAXXZ")@IMGREL -define void @"\01?f@@YAXXZ"() #0 { +define void @"\01?f@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -96,7 +96,7 @@ br label %try.cont lpad2: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.8 catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0 %recover = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.8 to i8*), i32 0, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch", i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1") @@ -107,7 +107,7 @@ to label %try.cont8 unwind label %lpad1 lpad1: - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %3 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0 %recover2 = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1") indirectbr i8* %recover2, [label %try.cont8] Index: test/CodeGen/WinEH/cppeh-prepared-cleanups.ll =================================================================== --- test/CodeGen/WinEH/cppeh-prepared-cleanups.ll +++ test/CodeGen/WinEH/cppeh-prepared-cleanups.ll @@ -50,7 +50,7 @@ ; CHECK-NEXT: .long .Ltmp0@IMGREL ; CHECK-NEXT: .long 0 -define void @"\01?test1@@YAXXZ"() #0 { +define void @"\01?test1@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %unwindhelp = alloca i64 %tmp = alloca i32, align 4 @@ -66,7 +66,7 @@ to label %unreachable unwind label %lpad1 lpad1: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } cleanup %recover = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test1@@YAXXZ.cleanup") indirectbr i8* %recover, [] @@ -118,7 +118,7 @@ ; CHECK-NEXT: .long .Ltmp12@IMGREL ; CHECK-NEXT: .long 0 -define void @"\01?test2@@YAX_N@Z"(i1 zeroext %b) #2 { +define void @"\01?test2@@YAX_N@Z"(i1 zeroext %b) #2 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { %b.addr = alloca i8, align 1 %s = alloca %struct.S, align 1 %exn.slot = alloca i8* @@ -145,13 +145,13 @@ br label %if.end lpad1: ; preds = %entry, %if.end - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } cleanup %recover = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup") indirectbr i8* %recover, [] lpad3: ; preds = %if.then - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %3 = landingpad { i8*, i32 } cleanup %recover4 = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup1", i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup") indirectbr i8* %recover4, [] @@ -196,7 +196,7 @@ ; Function Attrs: nounwind declare void @llvm.eh.unwindhelp(i8*) #4 -define internal void @"\01?test2@@YAX_N@Z.cleanup"(i8*, i8*) #7 { +define internal void @"\01?test2@@YAX_N@Z.cleanup"(i8*, i8*) #7 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %s.i8 = call i8* @llvm.framerecover(i8* bitcast (void (i1)* @"\01?test2@@YAX_N@Z" to i8*), i8* %1, i32 0) %s = bitcast i8* %s.i8 to %struct.S* @@ -208,12 +208,12 @@ ret void stub: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } cleanup unreachable } -define internal void @"\01?test2@@YAX_N@Z.cleanup1"(i8*, i8*) #7 { +define internal void @"\01?test2@@YAX_N@Z.cleanup1"(i8*, i8*) #7 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %s1.i8 = call i8* @llvm.framerecover(i8* bitcast (void (i1)* @"\01?test2@@YAX_N@Z" to i8*), i8* %1, i32 1) %s1 = bitcast i8* %s1.i8 to %struct.S* @@ -225,7 +225,7 @@ ret void stub: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } cleanup unreachable } Index: test/CodeGen/WinEH/cppeh-shared-empty-catch.ll =================================================================== --- test/CodeGen/WinEH/cppeh-shared-empty-catch.ll +++ test/CodeGen/WinEH/cppeh-shared-empty-catch.ll @@ -34,7 +34,7 @@ ; CHECK: invoke void @"\01?g@@YAXXZ"() ; Function Attrs: nounwind -define void @"\01?f@@YAXXZ"() #0 { +define void @"\01?f@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: invoke void @"\01?g@@YAXXZ"() to label %invoke.cont unwind label %lpad @@ -48,7 +48,7 @@ to label %unreachable unwind label %lpad1 lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 br label %catch2 @@ -56,14 +56,14 @@ ; Note: Even though this landing pad has two catch clauses, it only has one action because both ; handlers do the same thing. ; CHECK: [[LPAD1_LABEL]]: -; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) +; CHECK: landingpad { i8*, i32 } ; CHECK-NEXT: catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 ; CHECK-NEXT: catch i8* null ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch") ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont4] lpad1: ; preds = %invoke.cont - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 catch i8* null %3 = extractvalue { i8*, i32 } %2, 0 Index: test/CodeGen/WinEH/cppeh-similar-catch-blocks.ll =================================================================== --- test/CodeGen/WinEH/cppeh-similar-catch-blocks.ll +++ test/CodeGen/WinEH/cppeh-similar-catch-blocks.ll @@ -91,7 +91,7 @@ ; CHECK: } ; Function Attrs: uwtable -define i32 @main() #0 { +define i32 @main() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %retval = alloca i32, align 4 %tmp = alloca i8, align 1 @@ -111,7 +111,7 @@ to label %unreachable unwind label %lpad lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %0 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0 catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 catch i8* null @@ -146,7 +146,7 @@ to label %unreachable unwind label %lpad4 lpad2: ; preds = %catch - %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %6 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 catch i8* null %7 = extractvalue { i8*, i32 } %6, 0 @@ -157,7 +157,7 @@ br label %catch.dispatch5 lpad4: ; preds = %try.cont - %9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %9 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 catch i8* null %10 = extractvalue { i8*, i32 } %9, 0 @@ -200,7 +200,7 @@ br label %try.cont19 lpad10: ; preds = %catch8 - %15 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %15 = landingpad { i8*, i32 } cleanup %16 = extractvalue { i8*, i32 } %15, 0 store i8* %16, i8** %exn.slot @@ -210,7 +210,7 @@ br label %eh.resume lpad16: ; preds = %catch13 - %18 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %18 = landingpad { i8*, i32 } cleanup %19 = extractvalue { i8*, i32 } %18, 0 store i8* %19, i8** %exn.slot @@ -220,7 +220,7 @@ br label %eh.resume lpad21: ; preds = %try.cont19 - %21 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %21 = landingpad { i8*, i32 } catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*) catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*) catch i8* null @@ -255,7 +255,7 @@ to label %unreachable unwind label %lpad35 lpad30: ; preds = %catch25 - %27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %27 = landingpad { i8*, i32 } catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*) catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*) catch i8* null @@ -267,7 +267,7 @@ br label %catch.dispatch36 lpad35: ; preds = %try.cont33 - %30 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %30 = landingpad { i8*, i32 } catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*) catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*) catch i8* null @@ -326,7 +326,7 @@ br label %try.cont60 lpad42: ; preds = %catch40 - %38 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %38 = landingpad { i8*, i32 } cleanup %39 = extractvalue { i8*, i32 } %38, 0 store i8* %39, i8** %exn.slot @@ -336,7 +336,7 @@ br label %eh.resume lpad50: ; preds = %catch45 - %41 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %41 = landingpad { i8*, i32 } cleanup %42 = extractvalue { i8*, i32 } %41, 0 store i8* %42, i8** %exn.slot @@ -346,7 +346,7 @@ br label %eh.resume lpad57: ; preds = %catch53 - %44 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %44 = landingpad { i8*, i32 } cleanup %45 = extractvalue { i8*, i32 } %44, 0 store i8* %45, i8** %exn.slot Index: test/CodeGen/WinEH/cppeh-state-calc-1.ll =================================================================== --- test/CodeGen/WinEH/cppeh-state-calc-1.ll +++ test/CodeGen/WinEH/cppeh-state-calc-1.ll @@ -68,7 +68,7 @@ @_TI1D = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%eh.CatchableTypeArray.1* @_CTA1D to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, section ".xdata", comdat ; Function Attrs: nounwind uwtable -define void @"\01?test@@YAXXZ"() #0 { +define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %tmp = alloca i32, align 4 %x = alloca i32, align 4 @@ -84,7 +84,7 @@ to label %unreachable unwind label %lpad lpad: ; preds = %entry - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %1 = landingpad { i8*, i32 } catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*) catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0 catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 @@ -99,7 +99,7 @@ to label %unreachable unwind label %lpad3 lpad3: ; preds = %try.cont - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0 catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 catch i8* null @@ -114,7 +114,7 @@ to label %unreachable unwind label %lpad12 lpad12: ; preds = %try.cont10 - %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %4 = landingpad { i8*, i32 } catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0 catch i8* null %recover2 = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch2", i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch3") @@ -164,7 +164,7 @@ ; Function Attrs: nounwind declare i8* @llvm.eh.actions(...) #3 -define internal i8* @"\01?test@@YAXXZ.catch"(i8*, i8*) #4 { +define internal i8* @"\01?test@@YAXXZ.catch"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %x.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 0) %x = bitcast i8* %x.i8 to i32* @@ -177,7 +177,7 @@ ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont) stub: ; preds = %entry - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %3 = landingpad { i8*, i32 } cleanup %recover = call i8* (...) @llvm.eh.actions() unreachable @@ -186,7 +186,7 @@ ; Function Attrs: nounwind readnone declare void @llvm.donothing() #2 -define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*) #4 { +define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: call void @"\01?catch_a@@YAXXZ"() #3 invoke void @llvm.donothing() @@ -196,13 +196,13 @@ ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont10) stub: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } cleanup %recover = call i8* (...) @llvm.eh.actions() unreachable } -define internal i8* @"\01?test@@YAXXZ.catch2"(i8*, i8*) #4 { +define internal i8* @"\01?test@@YAXXZ.catch2"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: %x21.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 2) %x21 = bitcast i8* %x21.i8 to i32* @@ -215,13 +215,13 @@ ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont22) stub: ; preds = %entry - %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %3 = landingpad { i8*, i32 } cleanup %recover = call i8* (...) @llvm.eh.actions() unreachable } -define internal i8* @"\01?test@@YAXXZ.catch3"(i8*, i8*) #4 { +define internal i8* @"\01?test@@YAXXZ.catch3"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: call void @"\01?catch_all@@YAXXZ"() #3 invoke void @llvm.donothing() @@ -231,7 +231,7 @@ ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont22) stub: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) + %2 = landingpad { i8*, i32 } cleanup %recover = call i8* (...) @llvm.eh.actions() unreachable Index: test/CodeGen/WinEH/seh-catch-all.ll =================================================================== --- test/CodeGen/WinEH/seh-catch-all.ll +++ test/CodeGen/WinEH/seh-catch-all.ll @@ -21,7 +21,7 @@ declare i8* @llvm.frameaddress(i32) ; Function Attrs: uwtable -define void @seh_catch_all() { +define void @seh_catch_all() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) { entry: %exn.slot = alloca i8* %ehselector.slot = alloca i32 @@ -32,7 +32,7 @@ br label %__try.cont lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + %0 = landingpad { i8*, i32 } catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 store i8* %1, i8** %exn.slot Index: test/CodeGen/WinEH/seh-inlined-finally.ll =================================================================== --- test/CodeGen/WinEH/seh-inlined-finally.ll +++ test/CodeGen/WinEH/seh-inlined-finally.ll @@ -19,7 +19,7 @@ declare dllimport void @EnterCriticalSection(%struct._RTL_CRITICAL_SECTION*) declare dllimport void @LeaveCriticalSection(%struct._RTL_CRITICAL_SECTION*) -define void @use_finally() { +define void @use_finally() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) { entry: invoke void @may_crash() to label %invoke.cont unwind label %lpad @@ -29,7 +29,7 @@ ret void lpad: ; preds = %entry - %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + %0 = landingpad { i8*, i32 } cleanup %call.i2 = tail call i32 @puts(i8* null) resume { i8*, i32 } %0 @@ -44,7 +44,7 @@ ; CHECK-NEXT: indirectbr i8* %recover, [] ; Function Attrs: nounwind uwtable -define i32 @call_may_crash_locked() { +define i32 @call_may_crash_locked() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) { entry: %p = alloca %struct._RTL_CRITICAL_SECTION, align 8 call void (...) @llvm.frameescape(%struct._RTL_CRITICAL_SECTION* %p) @@ -60,7 +60,7 @@ ret i32 42 lpad: ; preds = %entry - %tmp7 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + %tmp7 = landingpad { i8*, i32 } cleanup %tmp8 = call i8* @llvm.frameaddress(i32 0) %tmp9 = call i8* @llvm.framerecover(i8* bitcast (i32 ()* @call_may_crash_locked to i8*), i8* %tmp8, i32 0) Index: test/CodeGen/WinEH/seh-outlined-finally.ll =================================================================== --- test/CodeGen/WinEH/seh-outlined-finally.ll +++ test/CodeGen/WinEH/seh-outlined-finally.ll @@ -39,7 +39,7 @@ } ; Function Attrs: uwtable -define i32 @main() #1 { +define i32 @main() #1 personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) { entry: %myres = alloca i32, align 4 %exn.slot = alloca i8* @@ -59,7 +59,7 @@ ret i32 0 lpad: ; preds = %entry - %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + %2 = landingpad { i8*, i32 } cleanup %3 = extractvalue { i8*, i32 } %2, 0 store i8* %3, i8** %exn.slot @@ -70,7 +70,7 @@ to label %invoke.cont3 unwind label %lpad1 lpad1: ; preds = %lpad, %invoke.cont - %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + %6 = landingpad { i8*, i32 } cleanup %7 = extractvalue { i8*, i32 } %6, 0 store i8* %7, i8** %exn.slot Index: test/CodeGen/WinEH/seh-prepared-basic.ll =================================================================== --- test/CodeGen/WinEH/seh-prepared-basic.ll +++ test/CodeGen/WinEH/seh-prepared-basic.ll @@ -15,14 +15,14 @@ target triple = "x86_64-pc-windows-msvc" ; Function Attrs: uwtable -define void @do_except() #0 { +define void @do_except() #0 personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) { entry: call void (...) @llvm.frameescape() invoke void @g() #5 to label %__try.cont unwind label %lpad1 lpad1: ; preds = %entry - %ehvals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) + %ehvals = landingpad { i8*, i32 } catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@do_except@@" to i8*) %recover = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@do_except@@" to i8*), i32 -1, i8* blockaddress(@do_except, %__try.cont)) indirectbr i8* %recover, [label %__try.cont] Index: test/CodeGen/WinEH/seh-resume-phi.ll =================================================================== --- test/CodeGen/WinEH/seh-resume-phi.ll +++ test/CodeGen/WinEH/seh-resume-phi.ll @@ -9,13 +9,13 @@ declare i32 @__C_specific_handler(...) declare i32 @llvm.eh.typeid.for(i8*) -define void @resume_phi() { +define void @resume_phi() personality i32 (...)* @__C_specific_handler { entry: invoke void @might_crash(i8* null) to label %return unwind label %lpad1 lpad1: - %ehvals1 = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler + %ehvals1 = landingpad { i8*, i32 } catch i32 ()* @filt %ehptr1 = extractvalue { i8*, i32 } %ehvals1, 0 %ehsel1 = extractvalue { i8*, i32 } %ehvals1, 1 @@ -28,7 +28,7 @@ to label %return unwind label %lpad2 lpad2: - %ehvals2 = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler + %ehvals2 = landingpad { i8*, i32 } cleanup %ehptr2 = extractvalue { i8*, i32 } %ehvals2, 0 %ehsel2 = extractvalue { i8*, i32 } %ehvals2, 1 Index: test/CodeGen/WinEH/seh-simple.ll =================================================================== --- test/CodeGen/WinEH/seh-simple.ll +++ test/CodeGen/WinEH/seh-simple.ll @@ -12,7 +12,7 @@ declare i32 @__C_specific_handler(...) declare i32 @llvm.eh.typeid.for(i8*) -define i32 @simple_except_store() { +define i32 @simple_except_store() personality i32 (...)* @__C_specific_handler { entry: %retval = alloca i32 store i32 0, i32* %retval @@ -20,7 +20,7 @@ to label %return unwind label %lpad lpad: - %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler + %ehvals = landingpad { i8*, i32 } catch i32 ()* @filt %sel = extractvalue { i8*, i32 } %ehvals, 1 %filt_sel = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @filt to i8*)) @@ -45,7 +45,7 @@ ; CHECK-NEXT: call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i32 ()* @filt to i8*), i32 -1, i8* blockaddress(@simple_except_store, %__except)) ; CHECK-NEXT: indirectbr {{.*}} [label %__except] -define i32 @catch_all() { +define i32 @catch_all() personality i32 (...)* @__C_specific_handler { entry: %retval = alloca i32 store i32 0, i32* %retval @@ -53,7 +53,7 @@ to label %return unwind label %lpad lpad: - %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler + %ehvals = landingpad { i8*, i32 } catch i8* null store i32 1, i32* %retval br label %return @@ -73,13 +73,13 @@ ; CHECK: store i32 1, i32* %retval -define i32 @except_phi() { +define i32 @except_phi() personality i32 (...)* @__C_specific_handler { entry: invoke void @might_crash() to label %return unwind label %lpad lpad: - %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler + %ehvals = landingpad { i8*, i32 } catch i32 ()* @filt %sel = extractvalue { i8*, i32 } %ehvals, 1 %filt_sel = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @filt to i8*)) @@ -107,7 +107,7 @@ ; CHECK-NEXT: %r = phi i32 [ 0, %entry ], [ 1, %lpad.return_crit_edge ] ; CHECK-NEXT: ret i32 %r -define i32 @lpad_phi() { +define i32 @lpad_phi() personality i32 (...)* @__C_specific_handler { entry: invoke void @might_crash() to label %cont unwind label %lpad @@ -118,7 +118,7 @@ lpad: %ncalls.1 = phi i32 [ 0, %entry ], [ 1, %cont ] - %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler + %ehvals = landingpad { i8*, i32 } catch i32 ()* @filt %sel = extractvalue { i8*, i32 } %ehvals, 1 %filt_sel = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @filt to i8*)) @@ -153,13 +153,13 @@ ; CHECK-NEXT: %r = phi i32 [ 2, %cont ], [ %{{.*}}, %lpad.return_crit_edge ] ; CHECK-NEXT: ret i32 %r -define i32 @cleanup_and_except() { +define i32 @cleanup_and_except() personality i32 (...)* @__C_specific_handler { entry: invoke void @might_crash() to label %return unwind label %lpad lpad: - %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler + %ehvals = landingpad { i8*, i32 } cleanup catch i32 ()* @filt call void @cleanup() Index: test/CodeGen/X86/2007-05-05-Personality.ll =================================================================== --- test/CodeGen/X86/2007-05-05-Personality.ll +++ test/CodeGen/X86/2007-05-05-Personality.ll @@ -12,13 +12,13 @@ @error = external global i8 -define void @_ada_x() { +define void @_ada_x() personality i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*) { entry: invoke void @raise() to label %eh_then unwind label %unwind unwind: ; preds = %entry - %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*) + %eh_ptr = landingpad { i8*, i32 } catch i8* @error %eh_select = extractvalue { i8*, i32 } %eh_ptr, 1 %eh_typeid = tail call i32 @llvm.eh.typeid.for(i8* @error) Index: test/CodeGen/X86/2008-04-17-CoalescerBug.ll =================================================================== --- test/CodeGen/X86/2008-04-17-CoalescerBug.ll +++ test/CodeGen/X86/2008-04-17-CoalescerBug.ll @@ -13,7 +13,7 @@ @.str33 = external constant [29 x i32] ; <[29 x i32]*> [#uses=1] @.str89 = external constant [5 x i32] ; <[5 x i32]*> [#uses=1] -define void @_ZNK10wxDateTime6FormatEPKwRKNS_8TimeZoneE(%struct.wxString* noalias sret %agg.result, %struct.wxDateTime* %this, i32* %format, %"struct.wxDateTime::TimeZone"* %tz, i1 %foo) { +define void @_ZNK10wxDateTime6FormatEPKwRKNS_8TimeZoneE(%struct.wxString* noalias sret %agg.result, %struct.wxDateTime* %this, i32* %format, %"struct.wxDateTime::TimeZone"* %tz, i1 %foo) personality i32 (...)* @__gxx_personality_v0 { entry: br i1 %foo, label %bb116.i, label %bb115.critedge.i bb115.critedge.i: ; preds = %entry @@ -151,11 +151,11 @@ bb7834: ; preds = %bb7806, %invcont5831 br label %bb3261 lpad: ; preds = %bb7806, %bb5968, %invcont5814, %bb440.i8663, %bb155.i8541, %bb5657, %bb3306 - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} cleanup ret void lpad8185: ; preds = %invcont5831 - %exn8185 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn8185 = landingpad {i8*, i32} cleanup ret void } Index: test/CodeGen/X86/2008-05-28-LocalRegAllocBug.ll =================================================================== --- test/CodeGen/X86/2008-05-28-LocalRegAllocBug.ll +++ test/CodeGen/X86/2008-05-28-LocalRegAllocBug.ll @@ -6,7 +6,7 @@ declare i8* @__cxa_begin_catch(i8*) nounwind -define i32 @main(i32 %argc, i8** %argv) { +define i32 @main(i32 %argc, i8** %argv) personality i32 (...)* @__gxx_personality_v0 { entry: br i1 false, label %bb37, label %bb34 @@ -21,7 +21,7 @@ unreachable lpad243: ; preds = %bb37 - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} cleanup %eh_ptr244 = extractvalue { i8*, i32 } %exn, 0 store i32 (...)** getelementptr ([5 x i32 (...)*], [5 x i32 (...)*]* @_ZTVN10Evaluation10GridOutputILi3EEE, i32 0, i32 2), i32 (...)*** null, align 8 Index: test/CodeGen/X86/2009-03-13-PHIElimBug.ll =================================================================== --- test/CodeGen/X86/2009-03-13-PHIElimBug.ll +++ test/CodeGen/X86/2009-03-13-PHIElimBug.ll @@ -6,7 +6,7 @@ declare i32 @g() -define i32 @phi() { +define i32 @phi() personality i32 (...)* @__gxx_personality_v0 { entry: %a = call i32 @f() ; [#uses=1] %b = invoke i32 @g() @@ -24,7 +24,7 @@ lpad: ; preds = %cont, %entry %y = phi i32 [ %a, %entry ], [ %aa, %cont ] ; [#uses=1] - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} cleanup ret i32 %y } Index: test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll =================================================================== --- test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll +++ test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll @@ -3,7 +3,7 @@ declare i32 @f() -define i32 @phi(i32 %x) { +define i32 @phi(i32 %x) personality i32 (...)* @__gxx_personality_v0 { entry: %a = invoke i32 @f() to label %cont unwind label %lpad ; [#uses=1] @@ -17,7 +17,7 @@ lpad: ; preds = %cont, %entry %v = phi i32 [ %x, %entry ], [ %a, %cont ] ; [#uses=1] - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} cleanup ret i32 %v } Index: test/CodeGen/X86/2009-09-10-LoadFoldingBug.ll =================================================================== --- test/CodeGen/X86/2009-09-10-LoadFoldingBug.ll +++ test/CodeGen/X86/2009-09-10-LoadFoldingBug.ll @@ -9,7 +9,7 @@ %struct.ComplexType = type { i32 } -define i32 @t(i32 %clientPort, i32 %pluginID, i32 %requestID, i32 %objectID, i64 %serverIdentifier, i64 %argumentsData, i32 %argumentsLength) ssp { +define i32 @t(i32 %clientPort, i32 %pluginID, i32 %requestID, i32 %objectID, i64 %serverIdentifier, i64 %argumentsData, i32 %argumentsLength) ssp personality i32 (...)* @__gxx_personality_v0 { entry: ; CHECK: _t: ; CHECK: movl 16(%rbp), @@ -34,7 +34,7 @@ ret i32 0 lpad: ; preds = %invcont1, %invcont, %entry - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} cleanup %8 = call i32 @vm_deallocate(i32 undef, i64 0, i64 %0) ; [#uses=0] unreachable Index: test/CodeGen/X86/2009-11-25-ImpDefBug.ll =================================================================== --- test/CodeGen/X86/2009-11-25-ImpDefBug.ll +++ test/CodeGen/X86/2009-11-25-ImpDefBug.ll @@ -20,7 +20,7 @@ declare i32 @_Z17LoadObjectFromBERR8xmstreamPP10ASN1ObjectPPF10ASN1StatusP13ASN1ObjHeaderS3_E(%struct.xmstream*, %struct.ASN1Object**, i32 (%struct.ASN1ObjHeader*, %struct.ASN1Object**)**) -define i32 @_ZN8ASN1Unit4loadER8xmstreamjm18ASN1LengthEncoding(%struct.ASN1Unit* %this, %struct.xmstream* nocapture %stream, i32 %numObjects, i64 %size, i32 %lEncoding) { +define i32 @_ZN8ASN1Unit4loadER8xmstreamjm18ASN1LengthEncoding(%struct.ASN1Unit* %this, %struct.xmstream* nocapture %stream, i32 %numObjects, i64 %size, i32 %lEncoding) personality i32 (...)* @__gxx_personality_v0 { entry: br label %meshBB85 @@ -46,7 +46,7 @@ lpad: ; preds = %bb1.i.fragment.cl, %bb1.i.fragment, %bb5 %.SV10.phi807 = phi i8* [ undef, %bb1.i.fragment.cl ], [ undef, %bb1.i.fragment ], [ undef, %bb5 ] ; [#uses=1] - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} cleanup %1 = load i8, i8* %.SV10.phi807, align 8 ; [#uses=0] br i1 undef, label %meshBB81.bbcl.disp, label %bb13.fragment.bbcl.disp Index: test/CodeGen/X86/2010-04-06-SSEDomainFixCrash.ll =================================================================== --- test/CodeGen/X86/2010-04-06-SSEDomainFixCrash.ll +++ test/CodeGen/X86/2010-04-06-SSEDomainFixCrash.ll @@ -7,7 +7,7 @@ declare i32 @_ZN11HullLibrary16CreateConvexHullERK8HullDescR10HullResult(i8*, i8* nocapture, i8* nocapture) ssp align 2 -define void @_ZN17btSoftBodyHelpers4DrawEP10btSoftBodyP12btIDebugDrawi(i8* %psb, i8* %idraw, i32 %drawflags) ssp align 2 { +define void @_ZN17btSoftBodyHelpers4DrawEP10btSoftBodyP12btIDebugDrawi(i8* %psb, i8* %idraw, i32 %drawflags) ssp align 2 personality i32 (...)* @__gxx_personality_v0 { entry: br i1 undef, label %bb92, label %bb58 @@ -60,7 +60,7 @@ unreachable lpad159: ; preds = %bb58 - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + %exn = landingpad {i8*, i32} cleanup unreachable } Index: test/CodeGen/X86/2010-04-30-LocalAlloc-LandingPad.ll =================================================================== --- test/CodeGen/X86/2010-04-30-LocalAlloc-LandingPad.ll +++ test/CodeGen/X86/2010-04-30-LocalAlloc-LandingPad.ll @@ -13,7 +13,7 @@ ; CHECK: movl %esi,{{.*}}(%ebp) ; CHECK: calll __Z6throwsv -define i8* @_Z4test1SiS_(%struct.S* byval %s1, i32 %n, %struct.S* byval %s2) ssp { +define i8* @_Z4test1SiS_(%struct.S* byval %s1, i32 %n, %struct.S* byval %s2) ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: %retval = alloca i8*, align 4 ; [#uses=2] %n.addr = alloca i32, align 4 ; [#uses=1] @@ -30,13 +30,13 @@ br label %finally terminate.handler: ; preds = %match.end - %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %1 = landingpad { i8*, i32 } cleanup call void @_ZSt9terminatev() noreturn nounwind unreachable try.handler: ; preds = %entry - %exc1.ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %exc1.ptr = landingpad { i8*, i32 } catch i8* null %exc1 = extractvalue { i8*, i32 } %exc1.ptr, 0 %selector = extractvalue { i8*, i32 } %exc1.ptr, 1 @@ -57,7 +57,7 @@ br label %match.end match.handler: ; preds = %match - %exc3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %exc3 = landingpad { i8*, i32 } cleanup %7 = extractvalue { i8*, i32 } %exc3, 0 store i8* %7, i8** %_rethrow Index: test/CodeGen/X86/2010-08-04-MingWCrash.ll =================================================================== --- test/CodeGen/X86/2010-08-04-MingWCrash.ll +++ test/CodeGen/X86/2010-08-04-MingWCrash.ll @@ -1,6 +1,6 @@ ; RUN: llc < %s -mtriple=i386-pc-mingw32 -define void @func() nounwind { +define void @func() nounwind personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { invoke.cont: %call = tail call i8* @malloc() %a = invoke i32 @bar() @@ -10,7 +10,7 @@ ret void lpad: - %exn.ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %exn.ptr = landingpad { i8*, i32 } catch i8* null %exn = extractvalue { i8*, i32 } %exn.ptr, 0 %eh.selector = extractvalue { i8*, i32 } %exn.ptr, 1 Index: test/CodeGen/X86/2012-01-10-UndefExceptionEdge.ll =================================================================== --- test/CodeGen/X86/2012-01-10-UndefExceptionEdge.ll +++ test/CodeGen/X86/2012-01-10-UndefExceptionEdge.ll @@ -16,7 +16,7 @@ declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind -define void @f(i32* nocapture %arg, i32* nocapture %arg1, i32* nocapture %arg2, i32* nocapture %arg3, i32 %arg4, i32 %arg5) optsize ssp { +define void @f(i32* nocapture %arg, i32* nocapture %arg1, i32* nocapture %arg2, i32* nocapture %arg3, i32 %arg4, i32 %arg5) optsize ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { bb: br i1 undef, label %bb6, label %bb7 @@ -43,7 +43,7 @@ bb20: ; preds = %bb43, %bb41, %bb29, %bb7 %tmp21 = phi i32 [ undef, %bb7 ], [ %tmp12, %bb43 ], [ %tmp12, %bb29 ], [ %tmp12, %bb41 ] - %tmp22 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + %tmp22 = landingpad { i8*, i32 } catch i8* bitcast ({ i8*, i8* }* @Exception to i8*) br i1 undef, label %bb23, label %bb69 Index: test/CodeGen/X86/2012-05-19-CoalescerCrash.ll =================================================================== --- test/CodeGen/X86/2012-05-19-CoalescerCrash.ll +++ test/CodeGen/X86/2012-05-19-CoalescerCrash.ll @@ -7,7 +7,7 @@ target triple = "i386-pc-linux-gnu" -define void @_ZN4llvm17AsmMatcherEmitter3runERNS_11raw_ostreamE() align 2 { +define void @_ZN4llvm17AsmMatcherEmitter3runERNS_11raw_ostreamE() align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { invoke void @_ZNK4llvm13CodeGenTarget12getAsmParserEv() to label %1 unwind label %5 @@ -16,7 +16,7 @@ to label %4 unwind label %2 ;