llvm.org GIT mirror llvm / cc714e2
Move the personality function from LandingPadInst to Function The personality routine currently lives in the LandingPadInst. This isn't desirable because: - All LandingPadInsts in the same function must have the same personality routine. This means that each LandingPadInst beyond the first has an operand which produces no additional information. - There is ongoing work to introduce EH IR constructs other than LandingPadInst. Moving the personality routine off of any one particular Instruction and onto the parent function seems a lot better than have N different places a personality function can sneak onto an exceptional function. Differential Revision: http://reviews.llvm.org/D10429 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239940 91177308-0d34-0410-b5e6-96231b3b80d8 David Majnemer 4 years ago
313 changed file(s) with 1556 addition(s) and 1464 deletion(s). Raw diff Collapse all Expand all
740740 MODULE_CODE_FUNCTION Record
741741 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
742742
743 ``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prologuedata, dllstorageclass, comdat, prefixdata]``
743 ``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prologuedata, dllstorageclass, comdat, prefixdata, personalityfn]``
744744
745745 The ``FUNCTION`` record (code 8) marks the declaration or definition of a
746746 function. The operand fields are:
794794 * *prefixdata*: If non-zero, the value index of the prefix data for this function,
795795 plus 1.
796796
797 * *personalityfn*: If non-zero, the value index of the personality function for this function,
798 plus 1.
797799
798800 MODULE_CODE_ALIAS Record
799801 ^^^^^^^^^^^^^^^^^^^^^^^^
634634 an optional section, an optional alignment,
635635 an optional :ref:`comdat `,
636636 an optional :ref:`garbage collector name `, an optional :ref:`prefix `,
637 an optional :ref:`prologue `, an opening
638 curly brace, a list of basic blocks, and a closing curly brace.
637 an optional :ref:`prologue `,
638 an optional :ref:`personality `,
639 an opening curly brace, a list of basic blocks, and a closing curly brace.
639640
640641 LLVM function declarations consist of the "``declare``" keyword, an
641642 optional :ref:`linkage type `, an optional :ref:`visibility
682683 [cconv] [ret attrs]
683684 @ ([argument list])
684685 [unnamed_addr] [fn Attrs] [section "name"] [comdat [($name)]]
685 [align N] [gc] [prefix Constant] [prologue Constant] { ... }
686 [align N] [gc] [prefix Constant] [prologue Constant]
687 [personality Constant] { ... }
686688
687689 The argument list is a comma seperated sequence of arguments where each
688690 argument is of the following form
11281130 A function may have prologue data but no body. This has similar semantics
11291131 to the ``available_externally`` linkage in that the data may be used by the
11301132 optimizers but will not be emitted in the object file.
1133
1134 .. _personalityfn:
1135
1136 Personality Function
1137 -------------
1138
1139 The ``personality`` attribute permits functions to specify what function
1140 to use for exception handling.
11311141
11321142 .. _attrgrp:
11331143
72827292
72837293 ::
72847294
7285 = landingpad personality +
7286 = landingpad personality cleanup *
7295 = landingpad +
7296 = landingpad cleanup *
72877297
72887298 := catch
72897299 := filter
72957305 system `_ to specify that a basic block
72967306 is a landing pad --- one where the exception lands, and corresponds to the
72977307 code found in the ``catch`` portion of a ``try``/``catch`` sequence. It
7298 defines values supplied by the personality function (``pers_fn``) upon
7308 defines values supplied by the :ref:`personality function ` upon
72997309 re-entry to the function. The ``resultval`` has the type ``resultty``.
73007310
73017311 Arguments:
73027312 """"""""""
73037313
7304 This instruction takes a ``pers_fn`` value. This is the personality
7305 function associated with the unwinding mechanism. The optional
7314 The optional
73067315 ``cleanup`` flag indicates that the landing pad block is a cleanup.
73077316
73087317 A ``clause`` begins with the clause type --- ``catch`` or ``filter`` --- and
73177326 """"""""""
73187327
73197328 The '``landingpad``' instruction defines the values which are set by the
7320 personality function (``pers_fn``) upon re-entry to the function, and
7329 :ref:`personality function ` upon re-entry to the function, and
73217330 therefore the "result type" of the ``landingpad`` instruction. As with
73227331 calling conventions, how the personality function results are
73237332 represented in LLVM IR is target specific.
73407349 pad block.
73417350 - A basic block that is not a landing pad block may not include a
73427351 '``landingpad``' instruction.
7343 - All '``landingpad``' instructions in a function must have the same
7344 personality function.
73457352
73467353 Example:
73477354 """"""""
73497356 .. code-block:: llvm
73507357
73517358 ;; A landing pad which can catch an integer.
7352 %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
7359 %res = landingpad { i8*, i32 }
73537360 catch i8** @_ZTIi
73547361 ;; A landing pad that is a cleanup.
7355 %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
7362 %res = landingpad { i8*, i32 }
73567363 cleanup
73577364 ;; A landing pad which can catch an integer and can only throw a double.
7358 %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
7365 %res = landingpad { i8*, i32 }
73597366 catch i8** @_ZTIi
73607367 filter [1 x i8**] [@_ZTId]
73617368
205205 llvm_unreachable("invalid enum");
206206 }
207207
208 bool canSimplifyInvokeNoUnwind(const InvokeInst *II);
208 bool canSimplifyInvokeNoUnwind(const Function *F);
209209
210210 } // end namespace llvm
211211
341341 // align, vol,
342342 // ordering, synchscope]
343343 FUNC_CODE_INST_RESUME = 39, // RESUME: [opval]
344 FUNC_CODE_INST_LANDINGPAD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...]
344 FUNC_CODE_INST_LANDINGPAD_OLD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...]
345345 FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol,
346346 // ordering, synchscope]
347347 FUNC_CODE_INST_STOREATOMIC_OLD = 42, // STORE: [ptrty,ptr,val, align, vol
351351 FUNC_CODE_INST_STOREATOMIC = 45, // STORE: [ptrty,ptr,val, align, vol
352352 FUNC_CODE_INST_CMPXCHG = 46, // CMPXCHG: [ptrty,ptr,valty,cmp,new, align,
353353 // vol,ordering,synchscope]
354 FUNC_CODE_INST_LANDINGPAD = 47, // LANDINGPAD: [ty,val,num,id0,val0...]
354355 };
355356
356357 enum UseListCodes {
2424 #include "llvm/IR/BasicBlock.h"
2525 #include "llvm/IR/CallingConv.h"
2626 #include "llvm/IR/GlobalObject.h"
27 #include "llvm/IR/OperandTraits.h"
2728 #include "llvm/Support/Compiler.h"
2829
2930 namespace llvm {
118119 public:
119120 static Function *Create(FunctionType *Ty, LinkageTypes Linkage,
120121 const Twine &N = "", Module *M = nullptr) {
121 return new(0) Function(Ty, Linkage, N, M);
122 return new(1) Function(Ty, Linkage, N, M);
122123 }
123124
124125 ~Function() override;
126
127 /// \brief Provide fast operand accessors
128 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
129
130 /// \brief Get the personality function associated with this function.
131 bool hasPersonalityFn() const { return getNumOperands() != 0; }
132 Constant *getPersonalityFn() const {
133 assert(hasPersonalityFn());
134 return cast(Op<0>());
135 }
136 void setPersonalityFn(Constant *C);
125137
126138 Type *getReturnType() const; // Return the type of the ret val
127139 FunctionType *getFunctionType() const; // Return the FunctionType for me
600612 return F ? &F->getValueSymbolTable() : nullptr;
601613 }
602614
615 template <>
616 struct OperandTraits : public OptionalOperandTraits {};
617
618 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(Function, Value)
619
603620 } // End llvm namespace
604621
605622 #endif
15551555 return Insert(InsertValueInst::Create(Agg, Val, Idxs), Name);
15561556 }
15571557
1558 LandingPadInst *CreateLandingPad(Type *Ty, Value *PersFn, unsigned NumClauses,
1558 LandingPadInst *CreateLandingPad(Type *Ty, unsigned NumClauses,
15591559 const Twine &Name = "") {
1560 return Insert(LandingPadInst::Create(Ty, PersFn, NumClauses), Name);
1560 return Insert(LandingPadInst::Create(Ty, NumClauses), Name);
15611561 }
15621562
15631563 //===--------------------------------------------------------------------===//
24362436 return User::operator new(s);
24372437 }
24382438 void growOperands(unsigned Size);
2439 void init(Value *PersFn, unsigned NumReservedValues, const Twine &NameStr);
2440
2441 explicit LandingPadInst(Type *RetTy, Value *PersonalityFn,
2442 unsigned NumReservedValues, const Twine &NameStr,
2443 Instruction *InsertBefore);
2444 explicit LandingPadInst(Type *RetTy, Value *PersonalityFn,
2445 unsigned NumReservedValues, const Twine &NameStr,
2446 BasicBlock *InsertAtEnd);
2439 void init(unsigned NumReservedValues, const Twine &NameStr);
2440
2441 explicit LandingPadInst(Type *RetTy, unsigned NumReservedValues,
2442 const Twine &NameStr, Instruction *InsertBefore);
2443 explicit LandingPadInst(Type *RetTy, unsigned NumReservedValues,
2444 const Twine &NameStr, BasicBlock *InsertAtEnd);
2445
24472446 protected:
24482447 LandingPadInst *clone_impl() const override;
24492448 public:
24502449 /// Constructors - NumReservedClauses is a hint for the number of incoming
24512450 /// clauses that this landingpad will have (use 0 if you really have no idea).
2452 static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn,
2453 unsigned NumReservedClauses,
2451 static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses,
24542452 const Twine &NameStr = "",
24552453 Instruction *InsertBefore = nullptr);
2456 static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn,
2457 unsigned NumReservedClauses,
2454 static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses,
24582455 const Twine &NameStr, BasicBlock *InsertAtEnd);
24592456
24602457 /// Provide fast operand accessors
24612458 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
2462
2463 /// getPersonalityFn - Get the personality function associated with this
2464 /// landing pad.
2465 Value *getPersonalityFn() const { return getOperand(0); }
24662459
24672460 /// isCleanup - Return 'true' if this landingpad instruction is a
24682461 /// cleanup. I.e., it should be run when unwinding even if its landing pad
24812474 /// Get the value of the clause at index Idx. Use isCatch/isFilter to
24822475 /// determine what type of clause this is.
24832476 Constant *getClause(unsigned Idx) const {
2484 return cast(getOperandList()[Idx + 1]);
2477 return cast(getOperandList()[Idx]);
24852478 }
24862479
24872480 /// isCatch - Return 'true' if the clause and index Idx is a catch clause.
24882481 bool isCatch(unsigned Idx) const {
2489 return !isa(getOperandList()[Idx + 1]->getType());
2482 return !isa(getOperandList()[Idx]->getType());
24902483 }
24912484
24922485 /// isFilter - Return 'true' if the clause and index Idx is a filter clause.
24932486 bool isFilter(unsigned Idx) const {
2494 return isa(getOperandList()[Idx + 1]->getType());
2487 return isa(getOperandList()[Idx]->getType());
24952488 }
24962489
24972490 /// getNumClauses - Get the number of clauses for this landing pad.
2498 unsigned getNumClauses() const { return getNumOperands() - 1; }
2491 unsigned getNumClauses() const { return getNumOperands(); }
24992492
25002493 /// reserveClauses - Grow the size of the operand list to accommodate the new
25012494 /// number of clauses.
25112504 };
25122505
25132506 template <>
2514 struct OperandTraits : public HungoffOperandTraits<2> {
2507 struct OperandTraits : public HungoffOperandTraits<1> {
25152508 };
25162509
25172510 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(LandingPadInst, Value)
146146 /// 1 operand before delete.
147147 void setGlobalVariableNumOperands(unsigned NumOps) {
148148 assert(NumOps <= 1 && "GlobalVariable can only have 0 or 1 operands");
149 NumUserOperands = NumOps;
150 }
151
152 /// Set the number of operands on a Function.
153 ///
154 /// Function always allocates space for a single operands, but
155 /// doesn't always use it.
156 ///
157 /// FIXME: As that the number of operands is used to find the start of
158 /// the allocated memory in operator delete, we need to always think we have
159 /// 1 operand before delete.
160 void setFunctionNumOperands(unsigned NumOps) {
161 assert(NumOps <= 1 && "Function can only have 0 or 1 operands");
149162 NumUserOperands = NumOps;
150163 }
151164
7979 .Default(EHPersonality::Unknown);
8080 }
8181
82 bool llvm::canSimplifyInvokeNoUnwind(const InvokeInst *II) {
83 const LandingPadInst *LP = II->getLandingPadInst();
84 EHPersonality Personality = classifyEHPersonality(LP->getPersonalityFn());
82 bool llvm::canSimplifyInvokeNoUnwind(const Function *F) {
83 EHPersonality Personality = classifyEHPersonality(F->getPersonalityFn());
8584 // We can't simplify any invokes to nounwind functions if the personality
8685 // function wants to catch asynch exceptions. The nounwind attribute only
8786 // implies that the function does not throw synchronous exceptions.
40564056 /// FunctionHeader
40574057 /// ::= OptionalLinkage OptionalVisibility OptionalCallingConv OptRetAttrs
40584058 /// OptUnnamedAddr Type GlobalName '(' ArgList ')' OptFuncAttrs OptSection
4059 /// OptionalAlign OptGC OptionalPrefix OptionalPrologue
4059 /// OptionalAlign OptGC OptionalPrefix OptionalPrologue OptPersonalityFn
40604060 bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
40614061 // Parse the linkage.
40624062 LocTy LinkageLoc = Lex.getLoc();
41384138 LocTy UnnamedAddrLoc;
41394139 Constant *Prefix = nullptr;
41404140 Constant *Prologue = nullptr;
4141 Constant *PersonalityFn = nullptr;
41414142 Comdat *C;
41424143
41434144 if (ParseArgumentList(ArgList, isVarArg) ||
41544155 (EatIfPresent(lltok::kw_prefix) &&
41554156 ParseGlobalTypeAndValue(Prefix)) ||
41564157 (EatIfPresent(lltok::kw_prologue) &&
4157 ParseGlobalTypeAndValue(Prologue)))
4158 ParseGlobalTypeAndValue(Prologue)) ||
4159 (EatIfPresent(lltok::kw_personality) &&
4160 ParseGlobalTypeAndValue(PersonalityFn)))
41584161 return true;
41594162
41604163 if (FuncAttrs.contains(Attribute::Builtin))
42534256 Fn->setAlignment(Alignment);
42544257 Fn->setSection(Section);
42554258 Fn->setComdat(C);
4259 Fn->setPersonalityFn(PersonalityFn);
42564260 if (!GC.empty()) Fn->setGC(GC.c_str());
42574261 Fn->setPrefixData(Prefix);
42584262 Fn->setPrologueData(Prologue);
51045108 /// ::= 'filter' TypeAndValue ( ',' TypeAndValue )*
51055109 bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) {
51065110 Type *Ty = nullptr; LocTy TyLoc;
5107 Value *PersFn; LocTy PersFnLoc;
5108
5109 if (ParseType(Ty, TyLoc) ||
5110 ParseToken(lltok::kw_personality, "expected 'personality'") ||
5111 ParseTypeAndValue(PersFn, PersFnLoc, PFS))
5112 return true;
5113
5114 std::unique_ptr LP(LandingPadInst::Create(Ty, PersFn, 0));
5111
5112 if (ParseType(Ty, TyLoc))
5113 return true;
5114
5115 std::unique_ptr LP(LandingPadInst::Create(Ty, 0));
51155116 LP->setCleanup(EatIfPresent(lltok::kw_cleanup));
51165117
51175118 while (Lex.getKind() == lltok::kw_catch || Lex.getKind() == lltok::kw_filter){
149149 std::vector > AliasInits;
150150 std::vector > FunctionPrefixes;
151151 std::vector > FunctionPrologues;
152 std::vector > FunctionPersonalityFns;
152153
153154 SmallVector InstsWithTBAATag;
154155
20302031 std::vector > AliasInitWorklist;
20312032 std::vector > FunctionPrefixWorklist;
20322033 std::vector > FunctionPrologueWorklist;
2034 std::vector > FunctionPersonalityFnWorklist;
20332035
20342036 GlobalInitWorklist.swap(GlobalInits);
20352037 AliasInitWorklist.swap(AliasInits);
20362038 FunctionPrefixWorklist.swap(FunctionPrefixes);
20372039 FunctionPrologueWorklist.swap(FunctionPrologues);
2040 FunctionPersonalityFnWorklist.swap(FunctionPersonalityFns);
20382041
20392042 while (!GlobalInitWorklist.empty()) {
20402043 unsigned ValID = GlobalInitWorklist.back().second;
20902093 return error("Expected a constant");
20912094 }
20922095 FunctionPrologueWorklist.pop_back();
2096 }
2097
2098 while (!FunctionPersonalityFnWorklist.empty()) {
2099 unsigned ValID = FunctionPersonalityFnWorklist.back().second;
2100 if (ValID >= ValueList.size()) {
2101 FunctionPersonalityFns.push_back(FunctionPersonalityFnWorklist.back());
2102 } else {
2103 if (Constant *C = dyn_cast_or_null(ValueList[ValID]))
2104 FunctionPersonalityFnWorklist.back().first->setPersonalityFn(C);
2105 else
2106 return error("Expected a constant");
2107 }
2108 FunctionPersonalityFnWorklist.pop_back();
20932109 }
20942110
20952111 return std::error_code();
30223038 if (Record.size() > 13 && Record[13] != 0)
30233039 FunctionPrefixes.push_back(std::make_pair(Func, Record[13]-1));
30243040
3041 if (Record.size() > 14 && Record[14] != 0)
3042 FunctionPersonalityFns.push_back(std::make_pair(Func, Record[14] - 1));
3043
30253044 ValueList.push_back(Func);
30263045
30273046 // If this is a function with a body, remember the prototype we are
39753994 break;
39763995 }
39773996
3978 case bitc::FUNC_CODE_INST_LANDINGPAD: {
3997 case bitc::FUNC_CODE_INST_LANDINGPAD:
3998 case bitc::FUNC_CODE_INST_LANDINGPAD_OLD: {
39793999 // LANDINGPAD: [ty, val, val, num, (id0,val0 ...)?]
39804000 unsigned Idx = 0;
3981 if (Record.size() < 4)
3982 return error("Invalid record");
4001 if (BitCode == bitc::FUNC_CODE_INST_LANDINGPAD) {
4002 if (Record.size() < 3)
4003 return error("Invalid record");
4004 } else {
4005 assert(BitCode == bitc::FUNC_CODE_INST_LANDINGPAD_OLD);
4006 if (Record.size() < 4)
4007 return error("Invalid record");
4008 }
39834009 Type *Ty = getTypeByID(Record[Idx++]);
39844010 if (!Ty)
39854011 return error("Invalid record");
3986 Value *PersFn = nullptr;
3987 if (getValueTypePair(Record, Idx, NextValueNo, PersFn))
3988 return error("Invalid record");
4012 if (BitCode == bitc::FUNC_CODE_INST_LANDINGPAD_OLD) {
4013 Value *PersFn = nullptr;
4014 if (getValueTypePair(Record, Idx, NextValueNo, PersFn))
4015 return error("Invalid record");
4016
4017 if (!F->hasPersonalityFn())
4018 F->setPersonalityFn(cast(PersFn));
4019 else if (F->getPersonalityFn() != cast(PersFn))
4020 return error("Personality function mismatch");
4021 }
39894022
39904023 bool IsCleanup = !!Record[Idx++];
39914024 unsigned NumClauses = Record[Idx++];
3992 LandingPadInst *LP = LandingPadInst::Create(Ty, PersFn, NumClauses);
4025 LandingPadInst *LP = LandingPadInst::Create(Ty, NumClauses);
39934026 LP->setCleanup(IsCleanup);
39944027 for (unsigned J = 0; J != NumClauses; ++J) {
39954028 LandingPadInst::ClauseType CT =
694694 for (const Function &F : *M) {
695695 // FUNCTION: [type, callingconv, isproto, linkage, paramattrs, alignment,
696696 // section, visibility, gc, unnamed_addr, prologuedata,
697 // dllstorageclass, comdat, prefixdata]
697 // dllstorageclass, comdat, prefixdata, personalityfn]
698698 Vals.push_back(VE.getTypeID(F.getFunctionType()));
699699 Vals.push_back(F.getCallingConv());
700700 Vals.push_back(F.isDeclaration());
711711 Vals.push_back(F.hasComdat() ? VE.getComdatID(F.getComdat()) : 0);
712712 Vals.push_back(F.hasPrefixData() ? (VE.getValueID(F.getPrefixData()) + 1)
713713 : 0);
714 Vals.push_back(
715 F.hasPersonalityFn() ? (VE.getValueID(F.getPersonalityFn()) + 1) : 0);
714716
715717 unsigned AbbrevToUse = 0;
716718 Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse);
18581860 const LandingPadInst &LP = cast(I);
18591861 Code = bitc::FUNC_CODE_INST_LANDINGPAD;
18601862 Vals.push_back(VE.getTypeID(LP.getType()));
1861 PushValueAndType(LP.getPersonalityFn(), InstID, Vals, VE);
18621863 Vals.push_back(LP.isCleanup());
18631864 Vals.push_back(LP.getNumClauses());
18641865 for (unsigned I = 0, E = LP.getNumClauses(); I != E; ++I) {
9292 if (F.hasPrologueData())
9393 if (!isa(F.getPrologueData()))
9494 orderValue(F.getPrologueData(), OM);
95 if (F.hasPersonalityFn())
96 if (!isa(F.getPersonalityFn()))
97 orderValue(F.getPersonalityFn(), OM);
9598 }
9699 OM.LastGlobalConstantID = OM.size();
97100
273276 predictValueUseListOrder(F.getPrefixData(), nullptr, OM, Stack);
274277 if (F.hasPrologueData())
275278 predictValueUseListOrder(F.getPrologueData(), nullptr, OM, Stack);
279 if (F.hasPersonalityFn())
280 predictValueUseListOrder(F.getPersonalityFn(), nullptr, OM, Stack);
276281 }
277282
278283 return Stack;
324329 for (const Function &F : M)
325330 if (F.hasPrologueData())
326331 EnumerateValue(F.getPrologueData());
332
333 // Enumerate the personality functions.
334 for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I)
335 if (I->hasPersonalityFn())
336 EnumerateValue(I->getPersonalityFn());
327337
328338 // Enumerate the metadata type.
329339 //
547547 if (F->hasPrefixData())
548548 EmitGlobalConstant(F->getPrefixData());
549549
550 // Emit the personality function.
551 if (F->hasPersonalityFn())
552 EmitGlobalConstant(F->getPersonalityFn());
553
550554 // Emit the CurrentFnSym. This is a virtual function to allow targets to
551555 // do their wild and crazy things as required.
552556 EmitFunctionEntryLabel();
180180 bool DwarfEHPrepare::InsertUnwindResumeCalls(Function &Fn) {
181181 SmallVector Resumes;
182182 SmallVector CleanupLPads;
183 bool FoundLP = false;
184183 for (BasicBlock &BB : Fn) {
185184 if (auto *RI = dyn_cast(BB.getTerminator()))
186185 Resumes.push_back(RI);
187 if (auto *LP = BB.getLandingPadInst()) {
186 if (auto *LP = BB.getLandingPadInst())
188187 if (LP->isCleanup())
189188 CleanupLPads.push_back(LP);
190 // Check the personality on the first landingpad. Don't do anything if
191 // it's for MSVC.
192 if (!FoundLP) {
193 FoundLP = true;
194 EHPersonality Pers = classifyEHPersonality(LP->getPersonalityFn());
195 if (isMSVCEHPersonality(Pers))
196 return false;
197 }
198 }
199189 }
200190
201191 if (Resumes.empty())
192 return false;
193
194 // Check the personality, don't do anything if it's for MSVC.
195 EHPersonality Pers = classifyEHPersonality(Fn.getPersonalityFn());
196 if (isMSVCEHPersonality(Pers))
202197 return false;
203198
204199 LLVMContext &Ctx = Fn.getContext();
258258
259259 // If this is an MSVC EH personality, we need to do a bit more work.
260260 EHPersonality Personality = EHPersonality::Unknown;
261 if (!LPads.empty())
262 Personality = classifyEHPersonality(LPads.back()->getPersonalityFn());
261 if (Fn->hasPersonalityFn())
262 Personality = classifyEHPersonality(Fn->getPersonalityFn());
263263 if (!isMSVCEHPersonality(Personality))
264264 return;
265265
545545 /// landingpad instruction and add them to the specified machine module info.
546546 void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
547547 MachineBasicBlock *MBB) {
548 MMI.addPersonality(MBB,
549 cast(I.getPersonalityFn()->stripPointerCasts()));
548 MMI.addPersonality(
549 MBB,
550 cast(
551 I.getParent()->getParent()->getPersonalityFn()->stripPointerCasts()));
550552
551553 if (I.isCleanup())
552554 MMI.addCleanup(MBB);
937937 // pad into several BBs.
938938 const BasicBlock *LLVMBB = MBB->getBasicBlock();
939939 const LandingPadInst *LPadInst = LLVMBB->getLandingPadInst();
940 MF->getMMI().addPersonality(
941 MBB, cast(LPadInst->getPersonalityFn()->stripPointerCasts()));
940 MF->getMMI().addPersonality(MBB, cast(LPadInst->getParent()
941 ->getParent()
942 ->getPersonalityFn()
943 ->stripPointerCasts()));
942944 EHPersonality Personality = MF->getMMI().getPersonalityType();
943945
944946 if (isMSVCEHPersonality(Personality)) {
143143 BasicBlock *CleanupBB = BasicBlock::Create(C, CleanupBBName, &F);
144144 Type *ExnTy =
145145 StructType::get(Type::getInt8PtrTy(C), Type::getInt32Ty(C), nullptr);
146 Constant *PersFn = F.getParent()->getOrInsertFunction(
147 "__gcc_personality_v0", FunctionType::get(Type::getInt32Ty(C), true));
146 if (!F.hasPersonalityFn()) {
147 Constant *PersFn = F.getParent()->getOrInsertFunction(
148 "__gcc_personality_v0",
149 FunctionType::get(Type::getInt32Ty(C), true));
150 F.setPersonalityFn(PersFn);
151 }
148152 LandingPadInst *LPad =
149 LandingPadInst::Create(ExnTy, PersFn, 1, "cleanup.lpad", CleanupBB);
153 LandingPadInst::Create(ExnTy, 1, "cleanup.lpad", CleanupBB);
150154 LPad->setCleanup(true);
151155 ResumeInst *RI = ResumeInst::Create(LPad, CleanupBB);
152156
226226 // Personality function
227227 IRBuilder<> Builder(EntryBB->getTerminator());
228228 if (!PersonalityFn)
229 PersonalityFn = LPads[0]->getPersonalityFn();
229 PersonalityFn = F.getPersonalityFn();
230230 Value *PersonalityFieldPtr = Builder.CreateConstGEP2_32(
231231 FunctionContextTy, FuncCtx, 0, 3, "pers_fn_gep");
232232 Builder.CreateStore(
110110 bool outlineHandler(ActionHandler *Action, Function *SrcFn,
111111 LandingPadInst *LPad, BasicBlock *StartBB,
112112 FrameVarInfoMap &VarInfo);
113 void addStubInvokeToHandlerIfNeeded(Function *Handler, Value *PersonalityFn);
113 void addStubInvokeToHandlerIfNeeded(Function *Handler);
114114
115115 void mapLandingPadBlocks(LandingPadInst *LPad, LandingPadActions &Actions);
116116 CatchHandler *findCatchHandler(BasicBlock *BB, BasicBlock *&NextBB,
378378 return false;
379379
380380 // Classify the personality to see what kind of preparation we need.
381 Personality = classifyEHPersonality(LPads.back()->getPersonalityFn());
381 Personality = classifyEHPersonality(Fn.getPersonalityFn());
382382
383383 // Do nothing if this is not an MSVC personality.
384384 if (!isMSVCEHPersonality(Personality))
12641264 return false;
12651265 }
12661266
1267 static BasicBlock *createStubLandingPad(Function *Handler,
1268 Value *PersonalityFn) {
1267 static BasicBlock *createStubLandingPad(Function *Handler) {
12691268 // FIXME: Finish this!
12701269 LLVMContext &Context = Handler->getContext();
12711270 BasicBlock *StubBB = BasicBlock::Create(Context, "stub");
12741273 LandingPadInst *LPad = Builder.CreateLandingPad(
12751274 llvm::StructType::get(Type::getInt8PtrTy(Context),
12761275 Type::getInt32Ty(Context), nullptr),
1277 PersonalityFn, 0);
1276 0);
12781277 // Insert a call to llvm.eh.actions so that we don't try to outline this lpad.
12791278 Function *ActionIntrin =
12801279 Intrinsic::getDeclaration(Handler->getParent(), Intrinsic::eh_actions);
12891288 // landing pad if none is found. The code that generates the .xdata tables for
12901289 // the handler needs at least one landing pad to identify the parent function's
12911290 // personality.
1292 void WinEHPrepare::addStubInvokeToHandlerIfNeeded(Function *Handler,
1293 Value *PersonalityFn) {
1291 void WinEHPrepare::addStubInvokeToHandlerIfNeeded(Function *Handler) {
12941292 ReturnInst *Ret = nullptr;
12951293 UnreachableInst *Unreached = nullptr;
12961294 for (BasicBlock &BB : *Handler) {
13221320 // parent block. We want to replace that with an invoke call, so we can
13231321 // erase it now.
13241322 OldRetBB->getTerminator()->eraseFromParent();
1325 BasicBlock *StubLandingPad = createStubLandingPad(Handler, PersonalityFn);
1323 BasicBlock *StubLandingPad = createStubLandingPad(Handler);
13261324 Function *F =
13271325 Intrinsic::getDeclaration(Handler->getParent(), Intrinsic::donothing);
13281326 InvokeInst::Create(F, NewRetBB, StubLandingPad, None, "", OldRetBB);
13781376 Handler = createHandlerFunc(Type::getVoidTy(Context),
13791377 SrcFn->getName() + ".cleanup", M, ParentFP);
13801378 }
1379 Handler->setPersonalityFn(SrcFn->getPersonalityFn());
13811380 HandlerToParentFP[Handler] = ParentFP;
13821381 Handler->addFnAttr("wineh-parent", SrcFn->getName());
13831382 BasicBlock *Entry = &Handler->getEntryBlock();
14551454 ClonedEntryBB->eraseFromParent();
14561455
14571456 // Make sure we can identify the handler's personality later.
1458 addStubInvokeToHandlerIfNeeded(Handler, LPad->getPersonalityFn());
1457 addStubInvokeToHandlerIfNeeded(Handler);
14591458
14601459 if (auto *CatchAction = dyn_cast(Action)) {
14611460 WinEHCatchDirector *CatchDirector =
107107 if (F.hasPrologueData())
108108 if (!isa(F.getPrologueData()))
109109 orderValue(F.getPrologueData(), OM);
110
111 if (F.hasPersonalityFn())
112 if (!isa(F.getPersonalityFn()))
113 orderValue(F.getPersonalityFn(), OM);
110114
111115 orderValue(&F, OM);
112116
25392543 Out << " prologue ";
25402544 writeOperand(F->getPrologueData(), true);
25412545 }
2546 if (F->hasPersonalityFn()) {
2547 Out << " personality ";
2548 writeOperand(F->getPersonalityFn(), /*PrintType=*/true);
2549 }
25422550
25432551 SmallVector, 4> MDs;
25442552 F->getAllMetadata(MDs);
27812789 } else if (const LandingPadInst *LPI = dyn_cast(&I)) {
27822790 Out << ' ';
27832791 TypePrinter.print(I.getType(), Out);
2784 Out << " personality ";
2785 writeOperand(I.getOperand(0), true); Out << '\n';
2792 if (LPI->isCleanup() || LPI->getNumClauses() != 0)
2793 Out << '\n';
27862794
27872795 if (LPI->isCleanup())
27882796 Out << " cleanup";
22482248 }
22492249
22502250 LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
2251 LLVMValueRef PersFn, unsigned NumClauses,
2252 const char *Name) {
2253 return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty),
2254 cast(unwrap(PersFn)),
2255 NumClauses, Name));
2251 unsigned NumClauses, const char *Name) {
2252 return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name));
22562253 }
22572254
22582255 LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn) {
247247
248248 Function::Function(FunctionType *Ty, LinkageTypes Linkage, const Twine &name,
249249 Module *ParentModule)
250 : GlobalObject(PointerType::getUnqual(Ty), Value::FunctionVal, nullptr, 0,
251 Linkage, name),
250 : GlobalObject(PointerType::getUnqual(Ty), Value::FunctionVal,
251 OperandTraits::op_begin(this), 0, Linkage, name),
252252 Ty(Ty) {
253253 assert(FunctionType::isValidReturnType(getReturnType()) &&
254254 "invalid return type");
278278
279279 // Remove the function from the on-the-side GC table.
280280 clearGC();
281
282 // FIXME: needed by operator delete
283 setFunctionNumOperands(1);
281284 }
282285
283286 void Function::BuildLazyArguments() const {
330333
331334 // Metadata is stored in a side-table.
332335 clearMetadata();
336
337 setPersonalityFn(nullptr);
333338 }
334339
335340 void Function::addAttribute(unsigned i, Attribute::AttrKind attr) {
425430 setPrologueData(SrcF->getPrologueData());
426431 else
427432 setPrologueData(nullptr);
433 if (SrcF->hasPersonalityFn())
434 setPersonalityFn(SrcF->getPersonalityFn());
435 else
436 setPersonalityFn(nullptr);
428437 }
429438
430439 /// \brief This does the actual lookup of an intrinsic ID which
975984 }
976985 return None;
977986 }
987
988 void Function::setPersonalityFn(Constant *C) {
989 if (!C) {
990 if (hasPersonalityFn()) {
991 // Note, the num operands is used to compute the offset of the operand, so
992 // the order here matters. Clearing the operand then clearing the num
993 // operands ensures we have the correct offset to the operand.
994 Op<0>().set(nullptr);
995 setFunctionNumOperands(0);
996 }
997 } else {
998 // Note, the num operands is used to compute the offset of the operand, so
999 // the order here matters. We need to set num operands to 1 first so that
1000 // we get the correct offset to the first operand when we set it.
1001 if (!hasPersonalityFn())
1002 setFunctionNumOperands(1);
1003 Op<0>().set(C);
1004 }
1005 }
152152 // LandingPadInst Implementation
153153 //===----------------------------------------------------------------------===//
154154
155 LandingPadInst::LandingPadInst(Type *RetTy, Value *PersonalityFn,
156 unsigned NumReservedValues, const Twine &NameStr,
157 Instruction *InsertBefore)
158 : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertBefore) {
159 init(PersonalityFn, 1 + NumReservedValues, NameStr);
160 }
161
162 LandingPadInst::LandingPadInst(Type *RetTy, Value *PersonalityFn,
163 unsigned NumReservedValues, const Twine &NameStr,
164 BasicBlock *InsertAtEnd)
165 : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertAtEnd) {
166 init(PersonalityFn, 1 + NumReservedValues, NameStr);
155 LandingPadInst::LandingPadInst(Type *RetTy, unsigned NumReservedValues,
156 const Twine &NameStr, Instruction *InsertBefore)
157 : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertBefore) {
158 init(NumReservedValues, NameStr);
159 }
160
161 LandingPadInst::LandingPadInst(Type *RetTy, unsigned NumReservedValues,
162 const Twine &NameStr, BasicBlock *InsertAtEnd)
163 : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertAtEnd) {
164 init(NumReservedValues, NameStr);
167165 }
168166
169167 LandingPadInst::LandingPadInst(const LandingPadInst &LP)
179177 setCleanup(LP.isCleanup());
180178 }
181179
182 LandingPadInst *LandingPadInst::Create(Type *RetTy, Value *PersonalityFn,
183 unsigned NumReservedClauses,
180 LandingPadInst *LandingPadInst::Create(Type *RetTy, unsigned NumReservedClauses,
184181 const Twine &NameStr,
185182 Instruction *InsertBefore) {
186 return new LandingPadInst(RetTy, PersonalityFn, NumReservedClauses, NameStr,
187 InsertBefore);
188 }
189
190 LandingPadInst *LandingPadInst::Create(Type *RetTy, Value *PersonalityFn,
191 unsigned NumReservedClauses,
183 return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertBefore);
184 }
185
186 LandingPadInst *LandingPadInst::Create(Type *RetTy, unsigned NumReservedClauses,
192187 const Twine &NameStr,
193188 BasicBlock *InsertAtEnd) {
194 return new LandingPadInst(RetTy, PersonalityFn, NumReservedClauses, NameStr,
195 InsertAtEnd);
196 }
197
198 void LandingPadInst::init(Value *PersFn, unsigned NumReservedValues,
199 const Twine &NameStr) {
189 return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertAtEnd);
190 }
191
192 void LandingPadInst::init(unsigned NumReservedValues, const Twine &NameStr) {
200193 ReservedSpace = NumReservedValues;
201 setNumHungOffUseOperands(1);
194 setNumHungOffUseOperands(0);
202195 allocHungoffUses(ReservedSpace);
203 Op<0>() = PersFn;
204196 setName(NameStr);
205197 setCleanup(false);
206198 }
210202 void LandingPadInst::growOperands(unsigned Size) {
211203 unsigned e = getNumOperands();
212204 if (ReservedSpace >= e + Size) return;
213 ReservedSpace = (e + Size / 2) * 2;
205 ReservedSpace = (std::max(e, 1U) + Size / 2) * 2;
214206 growHungoffUses(ReservedSpace);
215207 }
216208
4848
4949 if (FI->hasPrologueData())
5050 incorporateValue(FI->getPrologueData());
51
52 if (FI->hasPersonalityFn())
53 incorporateValue(FI->getPersonalityFn());
5154
5255 // First incorporate the arguments.
5356 for (Function::const_arg_iterator AI = FI->arg_begin(),
180180 /// \brief Track unresolved string-based type references.
181181 SmallDenseMap UnresolvedTypeRefs;
182182
183 /// \brief The personality function referenced by the LandingPadInsts.
184 /// All LandingPadInsts within the same function must use the same
185 /// personality function.
186 const Value *PersonalityFn;
187
188183 /// \brief Whether we've seen a call to @llvm.frameescape in this function
189184 /// already.
190185 bool SawFrameEscape;
195190
196191 public:
197192 explicit Verifier(raw_ostream &OS)
198 : VerifierSupport(OS), Context(nullptr), PersonalityFn(nullptr),
199 SawFrameEscape(false) {}
193 : VerifierSupport(OS), Context(nullptr), SawFrameEscape(false) {}
200194
201195 bool verify(const Function &F) {
202196 M = F.getParent();
230224 // FIXME: We strip const here because the inst visitor strips const.
231225 visit(const_cast(F));
232226 InstsInThisBlock.clear();
233 PersonalityFn = nullptr;
234227 SawFrameEscape = false;
235228
236229 return !Broken;
17561749 "invalid linkage type for function declaration", &F);
17571750 Assert(MDs.empty(), "function without a body cannot have metadata", &F,
17581751 MDs.empty() ? nullptr : MDs.front().second);
1752 Assert(!F.hasPersonalityFn(),
1753 "Function declaration shouldn't have a personality routine", &F);
17591754 } else {
17601755 // Verify that this function (which has a body) is not named "llvm.*". It
17611756 // is not legal to define intrinsics.
27942789 &LPI);
27952790 }
27962791
2792 Function *F = LPI.getParent()->getParent();
2793 Assert(F->hasPersonalityFn(),
2794 "LandingPadInst needs to be in a function with a personality.", &LPI);
2795
27972796 // The landingpad instruction must be the first non-PHI instruction in the
27982797 // block.
27992798 Assert(LPI.getParent()->getLandingPadInst() == &LPI,
28002799 "LandingPadInst not the first non-PHI instruction in the block.",
28012800 &LPI);
28022801
2803 // The personality functions for all landingpad instructions within the same
2804 // function should match.
2805 if (PersonalityFn)
2806 Assert(LPI.getPersonalityFn() == PersonalityFn,
2807 "Personality function doesn't match others in function", &LPI);
2808 PersonalityFn = LPI.getPersonalityFn();
2809
2810 // All operands must be constants.
2811 Assert(isa(PersonalityFn), "Personality function is not constant!",
2812 &LPI);
28132802 for (unsigned i = 0, e = LPI.getNumClauses(); i < e; ++i) {
28142803 Constant *Clause = LPI.getClause(i);
28152804 if (LPI.isCatch(i)) {
11931193 Dst.setPrologueData(MapValue(Src.getPrologueData(), ValueMap, RF_None,
11941194 &TypeMap, &ValMaterializer));
11951195
1196 // Link in the personality function.
1197 if (Src.hasPersonalityFn())
1198 Dst.setPersonalityFn(MapValue(Src.getPersonalityFn(), ValueMap, RF_None,
1199 &TypeMap, &ValMaterializer));
1200
11961201 // Go through and convert function arguments over, remembering the mapping.
11971202 Function::arg_iterator DI = Dst.arg_begin();
11981203 for (Argument &Arg : Src.args()) {
145145 return false;
146146
147147 // Check the personality. Do nothing if this is not an MSVC personality.
148 LandingPadInst *LP = nullptr;
149 for (BasicBlock &BB : F) {
150 LP = BB.getLandingPadInst();
151 if (LP)
152 break;
153 }
154 if (!LP)
148 if (!F.hasPersonalityFn())
155149 return false;
156150 PersonalityFn =
157 dyn_cast(LP->getPersonalityFn()->stripPointerCasts());
151 dyn_cast(F.getPersonalityFn()->stripPointerCasts());
158152 if (!PersonalityFn)
159153 return false;
160154 Personality = classifyEHPersonality(PersonalityFn);
227227 if (F->hasPrologueData())
228228 MarkUsedGlobalsAsNeeded(F->getPrologueData());
229229
230 if (F->hasPersonalityFn())
231 MarkUsedGlobalsAsNeeded(F->getPersonalityFn());
232
230233 for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
231234 for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
232235 for (User::op_iterator U = I->op_begin(), E = I->op_end(); U != E; ++U)
176176 bool MadeChange = false;
177177 for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
178178 if (InvokeInst *II = dyn_cast(BB->getTerminator()))
179 if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(II)) {
179 if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(F)) {
180180 SmallVector Args(II->op_begin(), II->op_end() - 3);
181181 // Insert a call instruction before the invoke.
182182 CallInst *Call = CallInst::Create(II->getCalledValue(), Args, "", II);
23522352 // The logic here should be correct for any real-world personality function.
23532353 // However if that turns out not to be true, the offending logic can always
23542354 // be conditioned on the personality function, like the catch-all logic is.
2355 EHPersonality Personality = classifyEHPersonality(LI.getPersonalityFn());
2355 EHPersonality Personality =
2356 classifyEHPersonality(LI.getParent()->getParent()->getPersonalityFn());
23562357
23572358 // Simplify the list of clauses, eg by removing repeated catch clauses
23582359 // (these are often created by inlining).
26192620 // with a new one.
26202621 if (MakeNewInstruction) {
26212622 LandingPadInst *NLI = LandingPadInst::Create(LI.getType(),
2622 LI.getPersonalityFn(),
26232623 NewClauses.size());
26242624 for (unsigned i = 0, e = NewClauses.size(); i != e; ++i)
26252625 NLI->addClause(NewClauses[i]);
26902690 }
26912691
26922692 // Instruction isn't dead, see if we can constant propagate it.
2693 if (!I->use_empty() && isa(I->getOperand(0))) {
2693 if (!I->use_empty() &&
2694 (I->getNumOperands() == 0 || isa(I->getOperand(0)))) {
26942695 if (Constant *C = ConstantFoldInstruction(I, DL, TLI)) {
26952696 DEBUG(dbgs() << "IC: ConstFold to: " << *C << " from: " << *I << '\n');
26962697
28452846 }
28462847
28472848 // ConstantProp instruction if trivially constant.
2848 if (!Inst->use_empty() && isa(Inst->getOperand(0)))
2849 if (!Inst->use_empty() &&
2850 (Inst->getNumOperands() == 0 || isa(Inst->getOperand(0))))
28492851 if (Constant *C = ConstantFoldInstruction(Inst, DL, TLI)) {
28502852 DEBUG(dbgs() << "IC: ConstFold to: " << *C << " from: "
28512853 << *Inst << '\n');
948948 }
949949
950950 // Get the personality function from the callee if it contains a landing pad.
951 Value *CalleePersonality = nullptr;
952 for (Function::const_iterator I = CalledFunc->begin(), E = CalledFunc->end();
953 I != E; ++I)
954 if (const InvokeInst *II = dyn_cast(I->getTerminator())) {
955 const BasicBlock *BB = II->getUnwindDest();
956 const LandingPadInst *LP = BB->getLandingPadInst();
957 CalleePersonality = LP->getPersonalityFn();
958 break;
959 }
951 Constant *CalledPersonality =
952 CalledFunc->hasPersonalityFn() ? CalledFunc->getPersonalityFn() : nullptr;
960953
961954 // Find the personality function used by the landing pads of the caller. If it
962955 // exists, then check to see that it matches the personality function used in
963956 // the callee.
964 if (CalleePersonality) {
965 for (Function::const_iterator I = Caller->begin(), E = Caller->end();
966 I != E; ++I)
967 if (const InvokeInst *II = dyn_cast(I->getTerminator())) {
968 const BasicBlock *BB = II->getUnwindDest();
969 const LandingPadInst *LP = BB->getLandingPadInst();
970
971 // If the personality functions match, then we can perform the
972 // inlining. Otherwise, we can't inline.
973 // TODO: This isn't 100% true. Some personality functions are proper
974 // supersets of others and can be used in place of the other.
975 if (LP->getPersonalityFn() != CalleePersonality)
976 return false;
977
978 break;
979 }
957 Constant *CallerPersonality =
958 Caller->hasPersonalityFn() ? Caller->getPersonalityFn() : nullptr;
959 if (CalledPersonality) {
960 if (!CallerPersonality)
961 Caller->setPersonalityFn(CalledPersonality);
962 // If the personality functions match, then we can perform the
963 // inlining. Otherwise, we can't inline.
964 // TODO: This isn't 100% true. Some personality functions are proper
965 // supersets of others and can be used in place of the other.
966 else if (CalledPersonality != CallerPersonality)
967 return false;
980968 }
981969
982970 // Get an iterator to the last basic block in the function, which will have
11721172 II->eraseFromParent();
11731173 }
11741174
1175 static bool markAliveBlocks(BasicBlock *BB,
1175 static bool markAliveBlocks(Function &F,
11761176 SmallPtrSetImpl &Reachable) {
11771177
11781178 SmallVector Worklist;
1179 BasicBlock *BB = F.begin();
11791180 Worklist.push_back(BB);
11801181 Reachable.insert(BB);
11811182 bool Changed = false;
12461247 if (isa(Callee) || isa(Callee)) {
12471248 changeToUnreachable(II, true);
12481249 Changed = true;
1249 } else if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(II)) {
1250 } else if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(&F)) {
12501251 if (II->use_empty() && II->onlyReadsMemory()) {
12511252 // jump to the normal destination branch.
12521253 BranchInst::Create(II->getNormalDest(), II);
12711272 /// otherwise.
12721273 bool llvm::removeUnreachableBlocks(Function &F) {
12731274 SmallPtrSet Reachable;
1274 bool Changed = markAliveBlocks(F.begin(), Reachable);
1275 bool Changed = markAliveBlocks(F, Reachable);
12751276
12761277 // If there are unreachable blocks in the CFG...
12771278 if (Reachable.size() == F.size())
0 ; RUN: opt < %s -basiccg
11 ; PR13903
22
3 define void @main() {
3 define void @main() personality i8 0 {
44 invoke void @llvm.donothing()
55 to label %ret unwind label %unw
66 unw:
7 %tmp = landingpad i8 personality i8 0 cleanup
7 %tmp = landingpad i8 cleanup
88 br label %ret
99 ret:
1010 ret void
0 ; RUN: opt -verify -disable-output < %s
11 ; This tests that we handle unreachable blocks correctly
22
3 define void @f() {
3 define void @f() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
44 %v1 = invoke i32* @g()
55 to label %bb1 unwind label %bb2
66 invoke void @__dynamic_cast()
99 %Hidden = getelementptr inbounds i32, i32* %v1, i64 1
1010 ret void
1111 bb2:
12 %lpad.loopexit80 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
12 %lpad.loopexit80 = landingpad { i8*, i32 }
1313 cleanup
1414 ret void
1515 }
6262 ret void
6363 }
6464
65 define void ()* @test1(void ()** %x) {
65 define void ()* @test1(void ()** %x) personality i32 (...)* @__gxx_personality_v0 {
6666 ; CHECK-LABEL: Call edges in function: test1
6767 ; CHECK-NEXT: -> f12
6868 ; CHECK-NEXT: -> f11
9696 ret void ()* @f11
9797
9898 unwind:
99 %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
99 %res = landingpad { i8*, i32 }
100100 cleanup
101101 resume { i8*, i32 } { i8* bitcast (void ()* @f12 to i8*), i32 42 }
102102 }
1111 @_ZTIi = external constant i8*
1212
1313 ; Function Attrs: uwtable
14 define void @test_ref_clean() {
14 define void @test_ref_clean() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
1515 entry:
1616 invoke void @_Z9may_throwv()
1717 to label %try.cont unwind label %lpad
1818
1919 lpad: ; preds = %entry
20 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
20 %0 = landingpad { i8*, i32 }
2121 catch i8* bitcast (i8** @_ZTIi to i8*)
2222 %exn = extractvalue { i8*, i32 } %0, 0
2323 %sel = extractvalue { i8*, i32 } %0, 1
4242 }
4343
4444 ; Function Attrs: uwtable
45 define void @test_ref_clean_multibranch() {
45 define void @test_ref_clean_multibranch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
4646 entry:
4747 invoke void @_Z9may_throwv()
4848 to label %invoke.cont unwind label %lpad
5252 to label %invoke.cont unwind label %lpad1
5353
5454 lpad: ; preds = %entry
55 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
55 %0 = landingpad { i8*, i32 }
5656 catch i8* bitcast (i8** @_ZTIi to i8*)
5757 %exn = extractvalue { i8*, i32 } %0, 0
5858 %sel = extractvalue { i8*, i32 } %0, 1
6464 to label %try.cont unwind label %lpad
6565
6666 lpad1: ; preds = %entry
67 %l1.0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
67 %l1.0 = landingpad { i8*, i32 }
6868 cleanup
6969 catch i8* bitcast (i8** @_ZTIi to i8*)
7070 %exn1 = extractvalue { i8*, i32 } %l1.0, 0
1212 @_ZTIi = external constant i8*
1313
1414 ; Function Attrs: uwtable
15 define void @test_missing_endcatch() {
15 define void @test_missing_endcatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
1616 ; CHECK: Some paths from llvm.eh.begincatch may not reach llvm.eh.endcatch
1717 ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null)
1818 entry:
2020 to label %try.cont unwind label %lpad
2121
2222 lpad: ; preds = %entry
23 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
24 catch i8* bitcast (i8** @_ZTIi to i8*)
25 %exn = extractvalue { i8*, i32 } %0, 0
26 %sel = extractvalue { i8*, i32 } %0, 1
27 %1 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
28 %matches = icmp eq i32 %sel, %1
29 br i1 %matches, label %catch, label %eh.resume
30
31 catch: ; preds = %lpad
32 call void @llvm.eh.begincatch(i8* %exn, i8* null)
33 call void @_Z10handle_intv()
34 br label %invoke.cont2
35
36 invoke.cont2: ; preds = %catch
37 br label %try.cont
38
39 try.cont: ; preds = %invoke.cont2, %entry
40 ret void
41
42 eh.resume: ; preds = %catch.dispatch
43 resume { i8*, i32 } %0
44 }
45
46 ; Function Attrs: uwtable
47 define void @test_missing_begincatch() {
23 %0 = landingpad { i8*, i32 }
24 catch i8* bitcast (i8** @_ZTIi to i8*)
25 %exn = extractvalue { i8*, i32 } %0, 0
26 %sel = extractvalue { i8*, i32 } %0, 1
27 %1 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
28 %matches = icmp eq i32 %sel, %1
29 br i1 %matches, label %catch, label %eh.resume
30
31 catch: ; preds = %lpad
32 call void @llvm.eh.begincatch(i8* %exn, i8* null)
33 call void @_Z10handle_intv()
34 br label %invoke.cont2
35
36 invoke.cont2: ; preds = %catch
37 br label %try.cont
38
39 try.cont: ; preds = %invoke.cont2, %entry
40 ret void
41
42 eh.resume: ; preds = %catch.dispatch
43 resume { i8*, i32 } %0
44 }
45
46 ; Function Attrs: uwtable
47 define void @test_missing_begincatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
4848 ; CHECK: llvm.eh.endcatch may be reachable without passing llvm.eh.begincatch
4949 ; CHECK-NEXT: call void @llvm.eh.endcatch()
5050 entry:
5252 to label %try.cont unwind label %lpad
5353
5454 lpad: ; preds = %entry
55 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
56 catch i8* bitcast (i8** @_ZTIi to i8*)
57 %exn = extractvalue { i8*, i32 } %0, 0
58 %sel = extractvalue { i8*, i32 } %0, 1
59 %1 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
60 %matches = icmp eq i32 %sel, %1
61 br i1 %matches, label %catch, label %eh.resume
62
63 catch: ; preds = %lpad
64 call void @_Z10handle_intv()
65 br label %invoke.cont2
66
67 invoke.cont2: ; preds = %catch
68 call void @llvm.eh.endcatch()
69 br label %try.cont
70
71 try.cont: ; preds = %invoke.cont2, %entry
72 ret void
73
74 eh.resume: ; preds = %catch.dispatch
75 resume { i8*, i32 } %0
76 }
77
78 ; Function Attrs: uwtable
79 define void @test_multiple_begin() {
55 %0 = landingpad { i8*, i32 }
56 catch i8* bitcast (i8** @_ZTIi to i8*)
57 %exn = extractvalue { i8*, i32 } %0, 0
58 %sel = extractvalue { i8*, i32 } %0, 1
59 %1 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
60 %matches = icmp eq i32 %sel, %1
61 br i1 %matches, label %catch, label %eh.resume
62
63 catch: ; preds = %lpad
64 call void @_Z10handle_intv()
65 br label %invoke.cont2
66
67 invoke.cont2: ; preds = %catch
68 call void @llvm.eh.endcatch()
69 br label %try.cont
70
71 try.cont: ; preds = %invoke.cont2, %entry
72 ret void
73
74 eh.resume: ; preds = %catch.dispatch
75 resume { i8*, i32 } %0
76 }
77
78 ; Function Attrs: uwtable
79 define void @test_multiple_begin() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
8080 ; CHECK: llvm.eh.begincatch may be called a second time before llvm.eh.endcatch
8181 ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null)
8282 ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null)
8585 to label %try.cont unwind label %lpad
8686
8787 lpad: ; preds = %entry
88 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
89 catch i8* bitcast (i8** @_ZTIi to i8*)
90 %exn = extractvalue { i8*, i32 } %0, 0
91 %sel = extractvalue { i8*, i32 } %0, 1
92 %1 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
93 %matches = icmp eq i32 %sel, %1
94 br i1 %matches, label %catch, label %eh.resume
95
96 catch: ; preds = %lpad
97 call void @llvm.eh.begincatch(i8* %exn, i8* null)
98 call void @_Z10handle_intv()
99 br label %invoke.cont2
100
101 invoke.cont2: ; preds = %catch
102 call void @llvm.eh.begincatch(i8* %exn, i8* null)
103 call void @llvm.eh.endcatch()
104 br label %try.cont
105
106 try.cont: ; preds = %invoke.cont2, %entry
107 ret void
108
109 eh.resume: ; preds = %catch.dispatch
110 resume { i8*, i32 } %0
111 }
112
113 ; Function Attrs: uwtable
114 define void @test_multiple_end() {
88 %0 = landingpad { i8*, i32 }
89 catch i8* bitcast (i8** @_ZTIi to i8*)
90 %exn = extractvalue { i8*, i32 } %0, 0
91 %sel = extractvalue { i8*, i32 } %0, 1
92 %1 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
93 %matches = icmp eq i32 %sel, %1
94 br i1 %matches, label %catch, label %eh.resume
95
96 catch: ; preds = %lpad
97 call void @llvm.eh.begincatch(i8* %exn, i8* null)
98 call void @_Z10handle_intv()
99 br label %invoke.cont2
100
101 invoke.cont2: ; preds = %catch
102 call void @llvm.eh.begincatch(i8* %exn, i8* null)
103 call void @llvm.eh.endcatch()
104 br label %try.cont
105
106 try.cont: ; preds = %invoke.cont2, %entry
107 ret void
108
109 eh.resume: ; preds = %catch.dispatch
110 resume { i8*, i32 } %0
111 }
112
113 ; Function Attrs: uwtable
114 define void @test_multiple_end() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
115115 ; CHECK: llvm.eh.endcatch may be called a second time after llvm.eh.begincatch
116116 ; CHECK-NEXT: call void @llvm.eh.endcatch()
117117 ; CHECK-NEXT: call void @llvm.eh.endcatch()
120120 to label %try.cont unwind label %lpad
121121
122122 lpad: ; preds = %entry
123 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
123 %0 = landingpad { i8*, i32 }
124124 catch i8* bitcast (i8** @_ZTIi to i8*)
125125 %exn = extractvalue { i8*, i32 } %0, 0
126126 %sel = extractvalue { i8*, i32 } %0, 1
165165 }
166166
167167 ; Function Attrs: uwtable
168 define void @test_branch_to_begincatch_with_no_lpad(i32 %fake.sel) {
168 define void @test_branch_to_begincatch_with_no_lpad(i32 %fake.sel) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
169169 ; CHECK: llvm.eh.begincatch may be reachable without passing a landingpad
170170 ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn2, i8* null)
171171 entry:
174174 to label %catch unwind label %lpad
175175
176176 lpad: ; preds = %entry
177 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
177 %0 = landingpad { i8*, i32 }
178178 catch i8* bitcast (i8** @_ZTIi to i8*)
179179 %exn = extractvalue { i8*, i32 } %0, 0
180180 %sel = extractvalue { i8*, i32 } %0, 1
210210 }
211211
212212 ; Function Attrs: uwtable
213 define void @test_branch_missing_endcatch() {
213 define void @test_branch_missing_endcatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
214214 ; CHECK: Some paths from llvm.eh.begincatch may not reach llvm.eh.endcatch
215215 ; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn2, i8* null)
216216 entry:
222222 to label %invoke.cont unwind label %lpad1
223223
224224 lpad: ; preds = %entry
225 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
225 %0 = landingpad { i8*, i32 }
226226 catch i8* bitcast (i8** @_ZTIi to i8*)
227227 %exn = extractvalue { i8*, i32 } %0, 0
228228 %sel = extractvalue { i8*, i32 } %0, 1
234234 to label %try.cont unwind label %lpad
235235
236236 lpad1: ; preds = %entry
237 %l1.0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
237 %l1.0 = landingpad { i8*, i32 }
238238 cleanup
239239 catch i8* bitcast (i8** @_ZTIi to i8*)
240240 %exn1 = extractvalue { i8*, i32 } %l1.0, 0
11
22 ; CHECK: clause argument must be a constant
33
4 define void @test(i32 %in) {
5 landingpad {} personality void()* null filter i32 %in
4 define void @test(i32 %in) personality void()* null {
5 landingpad {} filter i32 %in
66 }
1212 ret i32 0
1313 }
1414
15 ; CHECK-LABEL: define void @landingpadInstr1
16 ; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
1517 define void @landingpadInstr1(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
1618 entry:
17 ; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
19 ; CHECK: %res = landingpad { i8*, i32 }
1820 %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
1921 ; CHECK: catch i8** @_ZTIi
2022 catch i8** @_ZTIi
2123 ret void
2224 }
2325
26 ; CHECK-LABEL: define void @landingpadInstr2
27 ; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
2428 define void @landingpadInstr2(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
2529 entry:
26 ; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
30 ; CHECK: %res = landingpad { i8*, i32 }
2731 %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
2832 ; CHECK: cleanup
2933 cleanup
3034 ret void
3135 }
3236
37 ; CHECK-LABEL: define void @landingpadInstr3
38 ; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
3339 define void @landingpadInstr3(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
3440 entry:
35 ; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
41 ; CHECK: %res = landingpad { i8*, i32 }
3642 %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
3743 ; CHECK: catch i8** @_ZTIi
3844 catch i8** @_ZTIi
1313 ; }
1414 ;}
1515
16 define void @_Z4testii(i32 %a, i32 %b) #0 {
16 define void @_Z4testii(i32 %a, i32 %b) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
1717 entry:
1818 invoke void @_Z3fooi(i32 %a)
1919 to label %try.cont unwind label %lpad
2020
2121 lpad: ; preds = %entry
22 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
22 %0 = landingpad { i8*, i32 }
2323 catch i8* null
2424 %1 = extractvalue { i8*, i32 } %0, 0
2525 %2 = tail call i8* @__cxa_begin_catch(i8* %1) #2
3434 ret void
3535
3636 lpad1: ; preds = %lpad
37 %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
37 %3 = landingpad { i8*, i32 }
3838 cleanup
3939 invoke void @__cxa_end_catch()
4040 to label %eh.resume unwind label %terminate.lpad
4343 resume { i8*, i32 } %3
4444
4545 terminate.lpad: ; preds = %lpad1
46 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
46 %4 = landingpad { i8*, i32 }
4747 catch i8* null
4848 %5 = extractvalue { i8*, i32 } %4, 0
4949 tail call void @__clang_call_terminate(i8* %5) #3
66 ; that case, the machine verifier, which relies on analyzing branches for this
77 ; kind of verification, is unable to check anything, so accepts the CFG.
88
9 define void @test_branch_to_landingpad() {
9 define void @test_branch_to_landingpad() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
1010 entry:
1111 br i1 undef, label %if.end50.thread, label %if.then6
1212
1313 lpad:
14 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
14 %0 = landingpad { i8*, i32 }
1515 catch %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765* @"OBJC_EHTYPE_$_NSString"
1616 catch %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765* @OBJC_EHTYPE_id
1717 catch i8* null
4545 unreachable
4646
4747 lpad40:
48 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
48 %1 = landingpad { i8*, i32 }
4949 catch i8* null
5050 br label %finally.catchall
5151
2020
2121 @_ZTIi = external constant i8*
2222
23 define i32 @_Z3barv() {
23 define i32 @_Z3barv() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2424 entry:
2525 invoke void @_Z3foov()
2626 to label %return unwind label %lpad
2727
2828 lpad: ; preds = %entry
29 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
29 %0 = landingpad { i8*, i32 }
3030 catch i8* bitcast (i8** @_ZTIi to i8*)
3131 %1 = extractvalue { i8*, i32 } %0, 1
3232 %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) nounwind
66
77 %struct.A = type { i32* }
88
9 define void @"\01-[MyFunction Name:]"() {
9 define void @"\01-[MyFunction Name:]"() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
1010 entry:
1111 %save_filt.1 = alloca i32
1212 %save_eptr.0 = alloca i8*
3838 ret void
3939
4040 lpad: ; preds = %entry
41 %exn = landingpad {i8*, i32} personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
41 %exn = landingpad {i8*, i32}
4242 cleanup
4343 %eh_ptr = extractvalue {i8*, i32} %exn, 0
4444 store i8* %eh_ptr, i8** %eh_exception
3939
4040 declare void @__cxa_throw(i8*, i8*, i8*)
4141
42 define i32 @main() ssp {
42 define i32 @main() ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
4343 entry:
4444 %puts.i = tail call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i32 0, i32 0)) ; [#uses=0]
4545 %exception.i = tail call i8* @__cxa_allocate_exception(i32 4) nounwind ; [#uses=2]
7070 ret i32 %conv
7171
7272 lpad: ; preds = %entry
73 %exn.ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
73 %exn.ptr = landingpad { i8*, i32 }
7474 catch i8* bitcast (%0* @_ZTI1A to i8*)
7575 catch i8* null
7676 %exn = extractvalue { i8*, i32 } %exn.ptr, 0
0 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin10
11 ;
22
3 define linkonce_odr arm_apcscc void @func1() {
3 define linkonce_odr arm_apcscc void @func1() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
44 entry:
55 %save_filt.936 = alloca i32 ; [#uses=2]
66 %save_eptr.935 = alloca i8* ; [#uses=2]
3333 ret void
3434
3535 lpad: ; preds = %bb
36 %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
36 %eh_ptr = landingpad { i8*, i32 }
3737 cleanup
3838 %exn = extractvalue { i8*, i32 } %eh_ptr, 0
3939 store i8* %exn, i8** %eh_exception
22 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"
33 target triple = "thumbv7-apple-darwin"
44
5 define void @func() unnamed_addr align 2 {
5 define void @func() unnamed_addr align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
66 entry:
77 br label %for.cond
88
3434 br label %for.cond
3535
3636 lpad:
37 %exn = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
37 %exn = landingpad { i8*, i32 }
3838 catch i8* null
3939 invoke void @foo()
4040 to label %eh.resume unwind label %terminate.lpad
4141
4242 lpad26:
43 %exn27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
43 %exn27 = landingpad { i8*, i32 }
4444 catch i8* null
4545 invoke void @foo()
4646 to label %eh.resume unwind label %terminate.lpad
5656 ret void
5757
5858 lpad44:
59 %exn45 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
59 %exn45 = landingpad { i8*, i32 }
6060 catch i8* null
6161 invoke void @foo()
6262 to label %eh.resume unwind label %terminate.lpad
6666 resume { i8*, i32 } %exn.slot.0
6767
6868 terminate.lpad:
69 %exn51 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
69 %exn51 = landingpad { i8*, i32 }
7070 catch i8* null
7171 tail call void @_ZSt9terminatev() noreturn nounwind
7272 unreachable
77 %0 = type opaque
88 %struct.NSConstantString = type { i32*, i32, i8*, i32 }
99
10 define i32 @asdf(i32 %a, i32 %b, i8** %c, i8* %d) {
10 define i32 @asdf(i32 %a, i32 %b, i8** %c, i8* %d) personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
1111 bb:
1212 %tmp = alloca i32, align 4
1313 %tmp1 = alloca i32, align 4
3636 unreachable
3737
3838 bb15: ; preds = %bb11, %bb
39 %tmp16 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
39 %tmp16 = landingpad { i8*, i32 }
4040 catch i8* null
4141 %tmp17 = extractvalue { i8*, i32 } %tmp16, 0
4242 store i8* %tmp17, i8** %tmp4
2424
2525 declare void @_ZSt9terminatev()
2626
27 define hidden double @t(%0* %self, i8* nocapture %_cmd) optsize ssp {
27 define hidden double @t(%0* %self, i8* nocapture %_cmd) optsize ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
2828 entry:
2929 %call = invoke double undef(%class.FunctionInterpreter.3.15.31* undef) optsize
3030 to label %try.cont unwind label %lpad
3131
3232 lpad: ; preds = %entry
33 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
33 %0 = landingpad { i8*, i32 }
3434 catch i8* bitcast ({ i8*, i8* }* @_ZTI13ParseErrorMsg to i8*)
3535 br i1 undef, label %catch, label %eh.resume
3636
4646 ret double %value.0
4747
4848 lpad1: ; preds = %catch
49 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
49 %1 = landingpad { i8*, i32 }
5050 cleanup
5151 invoke void @__cxa_end_catch()
5252 to label %eh.resume unwind label %terminate.lpad
5555 resume { i8*, i32 } undef
5656
5757 terminate.lpad: ; preds = %lpad1
58 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
58 %2 = landingpad { i8*, i32 }
5959 catch i8* null
6060 unreachable
6161 }
77
88 @_ZTIi = external constant i8*
99
10 define void @_Z3fn2v() #0 {
10 define void @_Z3fn2v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
1111 entry:
1212 invoke void @_Z3fn1v()
1313 to label %try.cont unwind label %lpad
1414
1515 lpad: ; preds = %entry
16 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
16 %0 = landingpad { i8*, i32 }
1717 catch i8* bitcast (i8** @_ZTIi to i8*)
1818 %1 = extractvalue { i8*, i32 } %0, 1
1919 %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #2
33 @_ZTS3Foo = linkonce_odr constant [5 x i8] c"3Foo\00"
44 @_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) }
55
6 define i32 @main() {
6 define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
77 entry:
88 invoke void @_Z3foov()
99 to label %return unwind label %lpad
1010
1111 lpad: ; preds = %entry
12 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
12 %0 = landingpad { i8*, i32 }
1313 catch i8* bitcast ({ i8*, i8* }* @_ZTI3Foo to i8*)
1414 %1 = extractvalue { i8*, i32 } %0, 1
1515 %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast ({ i8*, i8* }* @_ZTI3Foo to i8*)) nounwind
1313 ; }
1414 ;}
1515
16 define void @_Z4testii(i32 %a, i32 %b) #0 {
16 define void @_Z4testii(i32 %a, i32 %b) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
1717 entry:
1818 invoke void @_Z3fooi(i32 %a)
1919 to label %try.cont unwind label %lpad
2020
2121 lpad: ; preds = %entry
22 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
22 %0 = landingpad { i8*, i32 }
2323 catch i8* null
2424 %1 = extractvalue { i8*, i32 } %0, 0
2525 %2 = tail call i8* @__cxa_begin_catch(i8* %1) #2
3434 ret void
3535
3636 lpad1: ; preds = %lpad
37 %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
37 %3 = landingpad { i8*, i32 }
3838 cleanup
3939 invoke void @__cxa_end_catch()
4040 to label %eh.resume unwind label %terminate.lpad
4343 resume { i8*, i32 } %3
4444
4545 terminate.lpad: ; preds = %lpad1
46 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
46 %4 = landingpad { i8*, i32 }
4747 catch i8* null
4848 %5 = extractvalue { i8*, i32 } %4, 0
4949 tail call void @__clang_call_terminate(i8* %5) #3
7373 %A = type { %B }
7474 %B = type { i32 }
7575
76 define void @_Z3Foov() ssp {
76 define void @_Z3Foov() ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
7777 entry:
7878 br i1 true, label %exit, label %false
7979
8282 to label %exit unwind label %lpad
8383
8484 lpad:
85 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
85 %0 = landingpad { i8*, i32 }
8686 catch i8* null
8787 unreachable
8888
3333
3434 define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
3535 double %m, double %n, double %p,
36 double %q, double %r) {
36 double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
3737 entry:
3838 invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
3939 to label %try.cont unwind label %lpad
4040
4141 lpad:
4242 %0 = landingpad { i8*, i32 }
43 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
4443 catch i8* null
4544 %1 = extractvalue { i8*, i32 } %0, 0
4645 %2 = tail call i8* @__cxa_begin_catch(i8* %1)
5756
5857 lpad1:
5958 %3 = landingpad { i8*, i32 }
60 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
6159 cleanup
6260 invoke void @__cxa_end_catch()
6361 to label %eh.resume unwind label %terminate.lpad
6765
6866 terminate.lpad:
6967 %4 = landingpad { i8*, i32 }
70 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
7168 catch i8* null
7269 %5 = extractvalue { i8*, i32 } %4, 0
7370 tail call void @__clang_call_terminate(i8* %5)
7272
7373 define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
7474 double %m, double %n, double %p,
75 double %q, double %r) {
75 double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
7676 entry:
7777 invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
7878 to label %try.cont unwind label %lpad
7979
8080 lpad:
8181 %0 = landingpad { i8*, i32 }
82 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
8382 catch i8* null
8483 %1 = extractvalue { i8*, i32 } %0, 0
8584 %2 = tail call i8* @__cxa_begin_catch(i8* %1)
9695
9796 lpad1:
9897 %3 = landingpad { i8*, i32 }
99 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
10098 cleanup
10199 invoke void @__cxa_end_catch()
102100 to label %eh.resume unwind label %terminate.lpad
106104
107105 terminate.lpad:
108106 %4 = landingpad { i8*, i32 }
109 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
110107 catch i8* null
111108 %5 = extractvalue { i8*, i32 } %4, 0
112109 tail call void @__clang_call_terminate(i8* %5)
1616 @_ZTS9exception = linkonce_odr constant [11 x i8] c"9exception\00"
1717 @_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) }
1818
19 define void @f() uwtable {
19 define void @f() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2020 %1 = alloca i8*
2121 %2 = alloca i32
2222 %e = alloca %struct.exception*, align 4
2525
2626 br label %16
2727
28 %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
28 %5 = landingpad { i8*, i32 }
2929 catch i8* bitcast ({ i8*, i8* }* @_ZTI9exception to i8*)
3030 %6 = extractvalue { i8*, i32 } %5, 0
3131 store i8* %6, i8** %1
66
77 @_ZTIi = external constant i8*
88
9 define i32 @main() #0 {
9 define i32 @main() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
1010 entry:
1111 %exception = tail call i8* @__cxa_allocate_exception(i32 4) #1
1212 %0 = bitcast i8* %exception to i32*
1515 to label %unreachable unwind label %lpad
1616
1717 lpad: ; preds = %entry
18 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
18 %1 = landingpad { i8*, i32 }
1919 catch i8* null
2020 %2 = extractvalue { i8*, i32 } %1, 0
2121 %3 = tail call i8* @__cxa_begin_catch(i8* %2) #1
44
55 declare i32 @__gxx_personality_sj0(...)
66
7 define void @test0() {
7 define void @test0() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
88 entry:
99 invoke void @func()
1010 to label %cont unwind label %lpad
1313 ret void
1414
1515 lpad:
16 %exn = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
16 %exn = landingpad { i8*, i32 }
1717 cleanup
1818 resume { i8*, i32 } %exn
1919 }
1313
1414 declare void @__cxa_call_unexpected(i8*)
1515
16 define i32 @main() {
16 define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
1717 ; CHECK-LABEL: main:
1818 entry:
1919 %exception.i = tail call i8* @__cxa_allocate_exception(i32 4) nounwind
2323 to label %unreachable.i unwind label %lpad.i
2424
2525 lpad.i: ; preds = %entry
26 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
26 %1 = landingpad { i8*, i32 }
2727 filter [1 x i8*] [i8* bitcast (i8** @_ZTIi to i8*)]
2828 catch i8* bitcast (i8** @_ZTIi to i8*)
2929 ; CHECK: .long _ZTIi(target2) @ TypeInfo 1
4444 unreachable
4545
4646 lpad: ; preds = %ehspec.unexpected.i
47 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
47 %4 = landingpad { i8*, i32 }
4848 catch i8* bitcast (i8** @_ZTIi to i8*)
4949 br label %lpad.body
5050
2424
2525 declare void @__cxa_end_catch()
2626
27 define void @test1() nounwind {
27 define void @test1() nounwind personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2828 entry:
2929 invoke void @throw_exception() to label %try.cont unwind label %lpad
3030
3131 lpad:
32 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
32 %0 = landingpad { i8*, i32 }
3333 catch i8* null
3434 %1 = extractvalue { i8*, i32 } %0, 0
3535 %2 = tail call i8* @__cxa_begin_catch(i8* %1)
2222
2323 declare void @__cxa_end_catch()
2424
25 define void @test1() {
25 define void @test1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
2626 entry:
2727 invoke void @throw_exception() to label %try.cont unwind label %lpad
2828
2929 lpad:
30 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
30 %0 = landingpad { i8*, i32 }
3131 catch i8* null
3232 %1 = extractvalue { i8*, i32 } %0, 0
3333 %2 = tail call i8* @__cxa_begin_catch(i8* %1)
8888
8989 define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
9090 double %m, double %n, double %p,
91 double %q, double %r) {
91 double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
9292 entry:
9393 invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
9494 to label %try.cont unwind label %lpad
9595
9696 lpad:
9797 %0 = landingpad { i8*, i32 }
98 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
9998 catch i8* null
10099 %1 = extractvalue { i8*, i32 } %0, 0
101100 %2 = tail call i8* @__cxa_begin_catch(i8* %1)
112111
113112 lpad1:
114113 %3 = landingpad { i8*, i32 }
115 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
116114 cleanup
117115 invoke void @__cxa_end_catch()
118116 to label %eh.resume unwind label %terminate.lpad
122120
123121 terminate.lpad:
124122 %4 = landingpad { i8*, i32 }
125 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
126123 catch i8* null
127124 %5 = extractvalue { i8*, i32 } %4, 0
128125 tail call void @__clang_call_terminate(i8* %5)
1414 ; CHECK: ZTIi
1515 @_ZTIi = internal global i8* null
1616
17 define i32 @_Z9exceptioni(i32 %arg) {
17 define i32 @_Z9exceptioni(i32 %arg) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
1818 bb:
1919 %tmp = invoke i32 @_Z14throwSomethingi(i32 %arg)
2020 to label %bb9 unwind label %bb1
2121
2222 bb1: ; preds = %bb
23 %tmp2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
23 %tmp2 = landingpad { i8*, i32 }
2424 catch i8* bitcast (i8** @_ZTIi to i8*)
2525 %tmp3 = extractvalue { i8*, i32 } %tmp2, 1
2626 %tmp4 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
22
33 @Exn = external hidden unnamed_addr constant { i8*, i8* }
44
5 define hidden void @func(i32* %this, i32* %e) optsize align 2 {
5 define hidden void @func(i32* %this, i32* %e) optsize align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
66 %e.ld = load i32, i32* %e, align 4
77 %inv = invoke zeroext i1 @func2(i32* %this, i32 %e.ld) optsize
88 to label %ret unwind label %lpad
1111 ret void
1212
1313 lpad:
14 %lp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
14 %lp = landingpad { i8*, i32 }
1515 catch i8* bitcast ({ i8*, i8* }* @Exn to i8*)
1616 br label %.loopexit4
1717
33 ; &
44
55 ; CHECK: .globl _foo
6 define void @foo() {
6 define void @foo() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
77 invoke.cont:
88 invoke void @callA()
99 to label %invoke.cont25 unwind label %lpad2
1919 ret void
2020
2121 lpad2:
22 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
22 %0 = landingpad { i8*, i32 }
2323 cleanup
2424 br label %eh.resume
2525
2626 lpad15:
27 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
27 %1 = landingpad { i8*, i32 }
2828 cleanup
2929 br label %eh.resume
3030
3333 }
3434
3535 ; CHECK: .globl _bar
36 define linkonce_odr void @bar(i32* %a) {
36 define linkonce_odr void @bar(i32* %a) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
3737 if.end.i.i.i:
3838 invoke void @llvm.donothing()
3939 to label %call.i.i.i.noexc unwind label %eh.resume
5757 ret void
5858
5959 eh.resume:
60 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
60 %1 = landingpad { i8*, i32 }
6161 cleanup
6262 %2 = extractvalue { i8*, i32 } %1, 0
6363 %3 = extractvalue { i8*, i32 } %1, 1
55
66 declare void @bar(%struct.__CFString*, %struct.__CFString*)
77
8 define noalias i8* @foo(i8* nocapture %inRefURL) noreturn ssp {
8 define noalias i8* @foo(i8* nocapture %inRefURL) noreturn ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
99 entry:
1010 %call = tail call %struct.__CFString* @bar3()
1111 %call2 = invoke i8* @bar2()
1616 to label %for.cond unwind label %lpad5
1717
1818 lpad: ; preds = %entry
19 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
19 %0 = landingpad { i8*, i32 }
2020 cleanup
2121 %1 = extractvalue { i8*, i32 } %0, 0
2222 %2 = extractvalue { i8*, i32 } %0, 1
2323 br label %ehcleanup
2424
2525 lpad5: ; preds = %for.cond
26 %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
26 %3 = landingpad { i8*, i32 }
2727 cleanup
2828 %4 = extractvalue { i8*, i32 } %3, 0
2929 %5 = extractvalue { i8*, i32 } %3, 1
3131 to label %ehcleanup unwind label %terminate.lpad.i.i16
3232
3333 terminate.lpad.i.i16: ; preds = %lpad5
34 %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
34 %6 = landingpad { i8*, i32 }
3535 catch i8* null
3636 tail call void @terminatev() noreturn nounwind
3737 unreachable
4444 to label %_ZN5SmartIPK10__CFStringED1Ev.exit unwind label %terminate.lpad.i.i
4545
4646 terminate.lpad.i.i: ; preds = %ehcleanup
47 %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
47 %8 = landingpad { i8*, i32 }
4848 catch i8* null
4949 tail call void @terminatev() noreturn nounwind
5050 unreachable
8989
9090 @.str = private unnamed_addr constant [12 x i8] c"some_string\00", align 1
9191
92 define void @_Z4foo1c(i8 signext %a) {
92 define void @_Z4foo1c(i8 signext %a) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
9393 entry:
9494 %s1 = alloca %"class.std::__1::basic_string", align 4
9595 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)
130130 ret void
131131
132132 lpad.body: ; preds = %entry
133 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
133 %2 = landingpad { i8*, i32 }
134134 cleanup
135135 %3 = extractvalue { i8*, i32 } %2, 0
136136 %4 = extractvalue { i8*, i32 } %2, 1
137137 br label %ehcleanup
138138
139139 lpad2: ; preds = %invoke.cont
140 %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
140 %5 = landingpad { i8*, i32 }
141141 cleanup
142142 %6 = extractvalue { i8*, i32 } %5, 0
143143 %7 = extractvalue { i8*, i32 } %5, 1
160160 resume { i8*, i32 } %lpad.val13
161161
162162 terminate.lpad: ; preds = %ehcleanup
163 %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
163 %8 = landingpad { i8*, i32 }
164164 catch i8* null
165165 %9 = extractvalue { i8*, i32 } %8, 0
166166 call void @__clang_call_terminate(i8* %9)
99 ; __Unwind_SjLj_Register and actual @bar invocation
1010
1111
12 define i8* @foo(i8 %a, {} %c) {
12 define i8* @foo(i8 %a, {} %c) personality i8* bitcast (i32 (...)* @baz to i8*) {
1313 entry:
1414 ; CHECK: bl __Unwind_SjLj_Register
1515 ; CHECK-NEXT: {{[A-Z][a-zA-Z0-9]*}}:
2121 unreachable
2222
2323 handler:
24 %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @baz to i8*)
24 %tmp = landingpad { i8*, i32 }
2525 cleanup
2626 resume { i8*, i32 } undef
2727 }
22 ; PR1224
33
44 declare i32 @test()
5 define i32 @test2() {
5 define i32 @test2() personality i32 (...)* @__gxx_personality_v0 {
66 %A = invoke i32 @test() to label %invcont unwind label %blat
77 invcont:
88 ret i32 %A
99 blat:
10 %lpad = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
10 %lpad = landingpad { i8*, i32 }
1111 cleanup
1212 ret i32 0
1313 }
66 %"struct.std::locale::facet" = type { i32 (...)**, i32 }
77 %"struct.std::string" = type { %"struct.std::basic_string,std::allocator >::_Alloc_hider" }
88
9 define void @_ZNKSt6locale4nameEv(%"struct.std::string"* %agg.result) {
9 define void @_ZNKSt6locale4nameEv(%"struct.std::string"* %agg.result) personality i32 (...)* @__gxx_personality_v0 {
1010 entry:
1111 %tmp105 = icmp eq i8* null, null ; [#uses=1]
1212 br i1 %tmp105, label %cond_true, label %cond_true222
4444 ret void
4545
4646 cond_true1402: ; preds = %invcont282, %cond_false280, %cond_true235, %cond_true
47 %lpad = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
47 %lpad = landingpad { i8*, i32 }
4848 cleanup
4949 ret void
5050 }
0 ; RUN: llc -no-integrated-as < %s
11
2 define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() {
2 define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() personality i32 (...)* @__gxx_personality_v0 {
33 entry:
44 invoke void asm "rdtsc\0A\09movl %eax, $0\0A\09movl %edx, $1", "=*imr,=*imr,~{dirflag},~{fpsr},~{flags},~{dx},~{ax}"( i32* null, i32* null )
55 to label %.noexc unwind label %cleanup144
88 ret void
99
1010 cleanup144: ; preds = %entry
11 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
11 %exn = landingpad {i8*, i32}
1212 cleanup
1313 resume { i8*, i32 } %exn
1414 }
44 %struct.__type_info_pseudo = type { i8*, i8* }
55 @_ZTI2e1 = external constant %struct.__class_type_info_pseudo ; <%struct.__class_type_info_pseudo*> [#uses=1]
66
7 define void @_Z7ex_testv() {
7 define void @_Z7ex_testv() personality i32 (...)* @__gxx_personality_v0 {
88 entry:
99 invoke void @__cxa_throw( i8* null, i8* bitcast (%struct.__class_type_info_pseudo* @_ZTI2e1 to i8*), void (i8*)* null ) noreturn
1010 to label %UnifiedUnreachableBlock unwind label %lpad
1313 unreachable
1414
1515 lpad: ; preds = %entry
16 %lpad1 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
16 %lpad1 = landingpad { i8*, i32 }
1717 catch i8* null
1818 invoke void @__cxa_end_catch( )
1919 to label %bb14 unwind label %lpad17
2020
2121 lpad17: ; preds = %lpad
22 %lpad2 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
22 %lpad2 = landingpad { i8*, i32 }
2323 catch i8* null
2424 unreachable
2525
1818
1919 declare %"struct.std::ctype"* @_ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale(%"struct.std::locale"*)
2020
21 define %"struct.std::basic_istream >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(%"struct.std::basic_istream >"* %__in, i8* nocapture %__s) {
21 define %"struct.std::basic_istream >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(%"struct.std::basic_istream >"* %__in, i8* nocapture %__s) personality i32 (...)* @__gxx_personality_v0 {
2222 entry:
2323 %0 = invoke %"struct.std::ctype"* @_ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale(%"struct.std::locale"* undef)
2424 to label %invcont8 unwind label %lpad74 ; <%"struct.std::ctype"*> [#uses=0]
6161
6262 lpad: ; preds = %bb.i93, %invcont24, %bb1.i, %invcont8
6363 %__extracted.1 = phi i32 [ 0, %invcont8 ], [ %2, %bb1.i ], [ undef, %bb.i93 ], [ undef, %invcont24 ] ; [#uses=0]
64 %lpad1 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
64 %lpad1 = landingpad { i8*, i32 }
6565 catch i8* null
6666 %eh_ptr = extractvalue { i8*, i32 } %lpad1, 0
6767 %6 = call i8* @__cxa_begin_catch(i8* %eh_ptr) nounwind ; [#uses=0]
6868 unreachable
6969
7070 lpad74: ; preds = %entry
71 %lpad2 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
71 %lpad2 = landingpad { i8*, i32 }
7272 cleanup
7373 unreachable
7474 }
44 declare void @llvm.donothing() readnone
55
66 ; CHECK: f1
7 define void @f1() nounwind uwtable ssp {
7 define void @f1() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
88 entry:
99 ; CHECK-NOT: donothing
1010 invoke void @llvm.donothing()
1414 ret void
1515
1616 lpad:
17 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
17 %0 = landingpad { i8*, i32 }
1818 filter [0 x i8*] zeroinitializer
1919 %1 = extractvalue { i8*, i32 } %0, 0
2020 tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind
11 ; PR10733
22 declare void @_Znam()
33
4 define void @_ZNK14gIndexOdometer15AfterExcisionOfERi() uwtable align 2 {
4 define void @_ZNK14gIndexOdometer15AfterExcisionOfERi() uwtable align 2 personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
55 _ZN6Gambit5ArrayIiEC2Ej.exit36:
66 br label %"9"
77
1818
1919 lpad27: ; preds = %"10", %"9"
2020 %0 = phi i32 [ undef, %"9" ], [ %tmp, %"10" ]
21 %1 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
21 %1 = landingpad { i8*, i32 }
2222 cleanup
2323 resume { i8*, i32 } zeroinitializer
2424 }
11 ; XFAIL: hexagon
22 declare { i64, double } @wild()
33
4 define void @foo(i64* %p, double* %q) nounwind {
4 define void @foo(i64* %p, double* %q) nounwind personality i32 (...)* @__gxx_personality_v0 {
55 %t = invoke { i64, double } @wild() to label %normal unwind label %handler
66
77 normal:
1212 ret void
1313
1414 handler:
15 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
15 %exn = landingpad {i8*, i32}
1616 catch i8* null
1717 ret void
1818 }
33 @g1 = global double 0.000000e+00, align 8
44 @_ZTId = external constant i8*
55
6 define void @_Z1fd(double %i2) {
6 define void @_Z1fd(double %i2) personality i32 (...)* @__gxx_personality_v0 {
77 entry:
88 ; CHECK-EL: addiu $sp, $sp
99 ; CHECK-EL: .cfi_def_cfa_offset
2525 ; CHECK-EL: # %lpad
2626 ; CHECK-EL: bne $5
2727
28 %exn.val = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
28 %exn.val = landingpad { i8*, i32 }
2929 cleanup
3030 catch i8* bitcast (i8** @_ZTId to i8*)
3131 %exn = extractvalue { i8*, i32 } %exn.val, 0
66
77 @_ZTISt9exception = external constant i8*
88
9 define i32 @main() {
9 define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
1010 ; ALL: .cfi_startproc
1111 ; ALL: .cfi_personality 128, DW.ref.__gxx_personality_v0
1212
1616 ; ALL: jalr
1717
1818 lpad:
19 %0 = landingpad { i8*, i32 } personality i8*
20 bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
19 %0 = landingpad { i8*, i32 }
2120 catch i8* null
2221 catch i8* bitcast (i8** @_ZTISt9exception to i8*)
2322 ret i32 0
77 declare i32 @foo(...)
88 declare void @bar()
99
10 define void @main() {
10 define void @main() personality i8* bitcast (i32 (...)* @foo to i8*) {
1111 entry:
1212 invoke void @bar() #0
1313 to label %unreachable unwind label %return
1818 unreachable
1919
2020 return:
21 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @foo to i8*)
21 %0 = landingpad { i8*, i32 }
2222 catch i8* null
2323 ret void
2424 }
88 @_ZTIi = external constant i8*
99 @.str1 = private unnamed_addr constant [15 x i8] c"exception %i \0A\00", align 1
1010
11 define i32 @main() {
11 define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
1212 entry:
1313 %retval = alloca i32, align 4
1414 %exn.slot = alloca i8*
2323 to label %unreachable unwind label %lpad
2424
2525 lpad: ; preds = %entry
26 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
26 %1 = landingpad { i8*, i32 }
2727 catch i8* bitcast (i8** @_ZTIi to i8*)
2828 %2 = extractvalue { i8*, i32 } %1, 0
2929 store i8* %2, i8** %exn.slot
5555 ret i32 0
5656
5757 lpad1: ; preds = %catch
58 %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
58 %8 = landingpad { i8*, i32 }
5959 cleanup
6060 %9 = extractvalue { i8*, i32 } %8, 0
6161 store i8* %9, i8** %exn.slot
1818 ; CHECK: .cfi_endproc
1919
2020
21 define void @Bork(i64 %range.0.0, i64 %range.0.1, i64 %size) {
21 define void @Bork(i64 %range.0.0, i64 %range.0.1, i64 %size) personality i32 (...)* @__gxx_personality_v0 {
2222 entry:
2323 %effectiveRange = alloca %struct.Range, align 8 ; <%struct.Range*> [#uses=2]
2424 %tmp4 = call i8* @llvm.stacksave() ; [#uses=1]
3232 br label %bb30
3333
3434 unwind: ; preds = %cond_true, %entry
35 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
35 %exn = landingpad {i8*, i32}
3636 catch i8* null
3737 call void @llvm.stackrestore(i8* %tmp4)
3838 resume { i8*, i32 } %exn
6060 @.str28 = external unnamed_addr constant [7 x i8], align 1
6161 @_ZN4Foam4PoutE = external global %"class.Foam::prefixOSstream.27", align 8
6262
63 define void @_ZN4Foam13checkTopologyERKNS_8polyMeshEbb(i1 zeroext %allTopology) #0 {
63 define void @_ZN4Foam13checkTopologyERKNS_8polyMeshEbb(i1 zeroext %allTopology) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
6464 entry:
6565 br i1 undef, label %for.body, label %for.cond.cleanup
6666
123123 to label %_ZN4Foam4wordC2EPKcb.exit unwind label %lpad.i
124124
125125 lpad.i: ; preds = %_ZNK4Foam8ZoneMeshINS_9pointZoneENS_8polyMeshEE15checkDefinitionEb.exit
126 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
126 %0 = landingpad { i8*, i32 }
127127 cleanup
128128 resume { i8*, i32 } %0
129129
156156 br i1 undef, label %if.then121, label %if.else
157157
158158 lpad: ; preds = %_ZN4Foam4wordC2EPKcb.exit
159 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
159 %1 = landingpad { i8*, i32 }
160160 cleanup
161161 br i1 undef, label %_ZNSsD2Ev.exit1578, label %if.then.i.i1570, !prof !1
162162
180180 to label %_ZN4Foam4wordC2EPKcb.exit1701 unwind label %lpad.i1689
181181
182182 lpad.i1689: ; preds = %if.else
183 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
183 %2 = landingpad { i8*, i32 }
184184 cleanup
185185 unreachable
186186
199199 unreachable
200200
201201 lpad165: ; preds = %_ZN4Foam4wordC2EPKcb.exit1701
202 %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
202 %3 = landingpad { i8*, i32 }
203203 cleanup
204204 unreachable
205205
206206 lpad175: ; preds = %invoke.cont169
207 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
207 %4 = landingpad { i8*, i32 }
208208 cleanup
209209 invoke void @_ZN4Foam8pointSetD1Ev()
210210 to label %eh.resume unwind label %terminate.lpad
214214 to label %_ZN4Foam4wordC2EPKcb.exit1777 unwind label %lpad.i1765
215215
216216 lpad.i1765: ; preds = %if.end213
217 %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
217 %5 = landingpad { i8*, i32 }
218218 cleanup
219219 br i1 undef, label %eh.resume.i1776, label %if.then.i.i.i1767, !prof !1
220220
246246 to label %invoke.cont243 unwind label %lpad230
247247
248248 lpad217: ; preds = %_ZN4Foam4wordC2EPKcb.exit1777
249 %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
249 %6 = landingpad { i8*, i32 }
250250 cleanup
251251 br label %eh.resume
252252
253253 lpad230: ; preds = %invoke.cont231, %_ZNSsD2Ev.exit1792
254 %7 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
254 %7 = landingpad { i8*, i32 }
255255 cleanup
256256 invoke void @_ZN4Foam7faceSetD1Ev()
257257 to label %eh.resume unwind label %terminate.lpad
261261 to label %_ZN4Foam4wordC2EPKcb.exit1862 unwind label %lpad.i1850
262262
263263 lpad.i1850: ; preds = %invoke.cont243
264 %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
264 %8 = landingpad { i8*, i32 }
265265 cleanup
266266 unreachable
267267
282282 unreachable
283283
284284 lpad276: ; preds = %_ZN4Foam4wordC2EPKcb.exit1862
285 %9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
285 %9 = landingpad { i8*, i32 }
286286 cleanup
287287 unreachable
288288
313313 to label %if.end878 unwind label %lpad663
314314
315315 lpad663: ; preds = %invoke.cont670, %if.end660, %invoke.cont668, %invoke.cont674, %invoke.cont676
316 %10 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
316 %10 = landingpad { i8*, i32 }
317317 cleanup
318318 br i1 undef, label %_ZN4Foam4ListIiED2Ev.exit.i3073, label %delete.notnull.i.i3071
319319
341341 to label %_ZN4Foam4wordC2EPKcb.exit3098 unwind label %lpad.i3086
342342
343343 lpad.i3086: ; preds = %if.else888
344 %11 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
344 %11 = landingpad { i8*, i32 }
345345 cleanup
346346 unreachable
347347
370370 unreachable
371371
372372 lpad898: ; preds = %_ZN4Foam4wordC2EPKcb.exit3098
373 %12 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
373 %12 = landingpad { i8*, i32 }
374374 cleanup
375375 br i1 undef, label %_ZNSsD2Ev.exit3204, label %if.then.i.i3196, !prof !1
376376
381381 unreachable
382382
383383 lpad905.loopexit.split-lp: ; preds = %call.i3116.noexc, %_ZNSsD2Ev.exit3113
384 %lpad.loopexit.split-lp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
384 %lpad.loopexit.split-lp = landingpad { i8*, i32 }
385385 cleanup
386386 invoke void @_ZN4Foam8pointSetD1Ev()
387387 to label %eh.resume unwind label %terminate.lpad
390390 resume { i8*, i32 } undef
391391
392392 terminate.lpad: ; preds = %_ZN4Foam4ListIiED2Ev.exit.i3073, %lpad230, %lpad175, %lpad905.loopexit.split-lp
393 %13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
393 %13 = landingpad { i8*, i32 }
394394 catch i8* null
395395 unreachable
396396 }
88 %"class.boost::serialization::extended_type_info.129.150" = type { i32 (...)**, i32, i8* }
99
1010 ; Function Attrs: noinline
11 define void @_ZN5boost13serialization18extended_type_info4findEPKc() #0 align 2 {
11 define void @_ZN5boost13serialization18extended_type_info4findEPKc() #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
1212 entry:
1313 br i1 undef, label %cond.true, label %cond.false
1414
4141 br label %cleanup
4242
4343 lpad: ; preds = %cond.end
44 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
44 %2 = landingpad { i8*, i32 }
4545 cleanup
4646 br label %eh.resume
4747
1616 declare i32 @__gxx_personality_v0(...)
1717
1818 ; Function Attrs: optsize
19 define void @_ZNSt3__117__assoc_sub_state4copyEv(%"class.std::__1::__assoc_sub_state"* %this) #0 align 2 {
19 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*) {
2020 entry:
2121 %__lk = alloca %"class.std::__1::unique_lock", align 8
2222 %ref.tmp = alloca %"class.std::__exception_ptr::exception_ptr", align 8
4949 unreachable
5050
5151 lpad: ; preds = %entry
52 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
52 %1 = landingpad { i8*, i32 }
5353 cleanup
5454 %2 = extractvalue { i8*, i32 } %1, 0
5555 %3 = extractvalue { i8*, i32 } %1, 1
5656 br label %ehcleanup
5757
5858 lpad3: ; preds = %if.then
59 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
59 %4 = landingpad { i8*, i32 }
6060 cleanup
6161 %5 = extractvalue { i8*, i32 } %4, 0
6262 %6 = extractvalue { i8*, i32 } %4, 1
4545 ; Function Attrs: inlinehint
4646 declare void @_ZN4Foam8fileName12stripInvalidEv() #2 align 2
4747
48 define void @_ZN4Foam3CSVINS_6VectorIdEEE4readEv() #0 align 2 {
48 define void @_ZN4Foam3CSVINS_6VectorIdEEE4readEv() #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
4949 entry:
5050 invoke void @_ZN4Foam6string6expandEb()
5151 to label %invoke.cont unwind label %lpad
6565 to label %invoke.cont2 unwind label %lpad.i
6666
6767 lpad.i: ; preds = %_ZN4Foam6stringC2ERKS0_.exit.i
68 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
68 %0 = landingpad { i8*, i32 }
6969 cleanup
7070 br label %ehcleanup142
7171
8989 to label %if.end unwind label %lpad5
9090
9191 lpad: ; preds = %if.then.i.i.i.i176, %entry
92 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
92 %1 = landingpad { i8*, i32 }
9393 cleanup
9494 br label %ehcleanup142
9595
9696 lpad3: ; preds = %invoke.cont2
97 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
97 %2 = landingpad { i8*, i32 }
9898 cleanup
9999 br label %ehcleanup142
100100
101101 lpad5: ; preds = %memptr.end.i, %invoke.cont8, %if.then
102 %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
102 %3 = landingpad { i8*, i32 }
103103 cleanup
104104 br label %ehcleanup142
105105
118118 unreachable
119119
120120 lpad.i.i.i: ; preds = %.noexc205
121 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
121 %4 = landingpad { i8*, i32 }
122122 cleanup
123123 br label %ehcleanup142
124124
125125 lpad19: ; preds = %for.body
126 %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
126 %5 = landingpad { i8*, i32 }
127127 cleanup
128128 br label %ehcleanup142
129129
1010
1111 declare i32 @__gxx_personality_v0(...)
1212
13 define void @_Z11GetPasswordP13CStdOutStreamb() {
13 define void @_Z11GetPasswordP13CStdOutStreamb() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
1414 entry:
1515 br label %for.cond.i.i
1616
4040 br label %for.cond.i.i30
4141
4242 lpad: ; preds = %invoke.cont4, %invoke.cont, %_ZN11CStringBaseIcEC2EPKc.exit.critedge
43 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
43 %1 = landingpad { i8*, i32 }
4444 cleanup
4545 resume { i8*, i32 } undef
4646 }
7070 ; V9PIC: .L_ZTIi.DW.stub:
7171 ; V9PIC-NEXT: .xword _ZTIi
7272
73 define i32 @main(i32 %argc, i8** nocapture readnone %argv) unnamed_addr #0 {
73 define i32 @main(i32 %argc, i8** nocapture readnone %argv) unnamed_addr #0 personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
7474 entry:
7575 %0 = icmp eq i32 %argc, 2
7676 %1 = tail call i8* @__cxa_allocate_exception(i32 4) #1
101101 ret i32 %6
102102
103103 "8": ; preds = %"4", %"3"
104 %exc = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
104 %exc = landingpad { i8*, i32 }
105105 catch %struct.__fundamental_type_info_pseudo* @_ZTIi
106106 catch %struct.__fundamental_type_info_pseudo* @_ZTIf
107107 %exc_ptr12 = extractvalue { i8*, i32 } %exc, 0
33 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"
44 target triple = "thumbv7-apple-ios"
55
6 define i8* @foo(<4 x i32> %c) {
6 define i8* @foo(<4 x i32> %c) personality i8* bitcast (i32 (...)* @baz to i8*) {
77 entry:
88 invoke void @bar ()
99 to label %unreachable unwind label %handler
1212 unreachable
1313
1414 handler:
15 %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @baz to i8*)
15 %tmp = landingpad { i8*, i32 }
1616 cleanup
1717 resume { i8*, i32 } undef
1818 }
7575
7676 declare %class.btMatrix3x3* @_ZN11btTransform8getBasisEv(%class.btTransform*) nounwind inlinehint ssp align 2
7777
78 define %class.RagDoll* @_ZN7RagDollC2EP15btDynamicsWorldRK9btVector3f(%class.RagDoll* %this, %class.btDynamicsWorld* %ownerWorld, %class.btVector3* %positionOffset, float %scale) unnamed_addr ssp align 2 {
78 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*) {
7979 entry:
8080 %retval = alloca %class.RagDoll*, align 4
8181 %this.addr = alloca %class.RagDoll*, align 4
634634 br label %for.cond
635635
636636 lpad: ; preds = %entry
637 %67 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
637 %67 = landingpad { i8*, i32 }
638638 cleanup
639639 %68 = extractvalue { i8*, i32 } %67, 0
640640 store i8* %68, i8** %exn.slot
647647 br label %eh.resume
648648
649649 lpad8: ; preds = %invoke.cont
650 %70 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
650 %70 = landingpad { i8*, i32 }
651651 cleanup
652652 %71 = extractvalue { i8*, i32 } %70, 0
653653 store i8* %71, i8** %exn.slot
660660 br label %eh.resume
661661
662662 lpad17: ; preds = %invoke.cont9
663 %73 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
663 %73 = landingpad { i8*, i32 }
664664 cleanup
665665 %74 = extractvalue { i8*, i32 } %73, 0
666666 store i8* %74, i8** %exn.slot
673673 br label %eh.resume
674674
675675 lpad26: ; preds = %invoke.cont18
676 %76 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
676 %76 = landingpad { i8*, i32 }
677677 cleanup
678678 %77 = extractvalue { i8*, i32 } %76, 0
679679 store i8* %77, i8** %exn.slot
686686 br label %eh.resume
687687
688688 lpad35: ; preds = %invoke.cont27
689 %79 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
689 %79 = landingpad { i8*, i32 }
690690 cleanup
691691 %80 = extractvalue { i8*, i32 } %79, 0
692692 store i8* %80, i8** %exn.slot
699699 br label %eh.resume
700700
701701 lpad44: ; preds = %invoke.cont36
702 %82 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
702 %82 = landingpad { i8*, i32 }
703703 cleanup
704704 %83 = extractvalue { i8*, i32 } %82, 0
705705 store i8* %83, i8** %exn.slot
712712 br label %eh.resume
713713
714714 lpad53: ; preds = %invoke.cont45
715 %85 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
715 %85 = landingpad { i8*, i32 }
716716 cleanup
717717 %86 = extractvalue { i8*, i32 } %85, 0
718718 store i8* %86, i8** %exn.slot
725725 br label %eh.resume
726726
727727 lpad62: ; preds = %invoke.cont54
728 %88 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
728 %88 = landingpad { i8*, i32 }
729729 cleanup
730730 %89 = extractvalue { i8*, i32 } %88, 0
731731 store i8* %89, i8** %exn.slot
738738 br label %eh.resume
739739
740740 lpad71: ; preds = %invoke.cont63
741 %91 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
741 %91 = landingpad { i8*, i32 }
742742 cleanup
743743 %92 = extractvalue { i8*, i32 } %91, 0
744744 store i8* %92, i8** %exn.slot
751751 br label %eh.resume
752752
753753 lpad80: ; preds = %invoke.cont72
754 %94 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
754 %94 = landingpad { i8*, i32 }
755755 cleanup
756756 %95 = extractvalue { i8*, i32 } %94, 0
757757 store i8* %95, i8** %exn.slot
764764 br label %eh.resume
765765
766766 lpad89: ; preds = %invoke.cont81
767 %97 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
767 %97 = landingpad { i8*, i32 }
768768 cleanup
769769 %98 = extractvalue { i8*, i32 } %97, 0
770770 store i8* %98, i8** %exn.slot
12631263 ret %class.RagDoll* %200
12641264
12651265 lpad258: ; preds = %for.end
1266 %201 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1266 %201 = landingpad { i8*, i32 }
12671267 cleanup
12681268 %202 = extractvalue { i8*, i32 } %201, 0
12691269 store i8* %202, i8** %exn.slot
12731273 br label %eh.resume
12741274
12751275 lpad284: ; preds = %invoke.cont259
1276 %204 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1276 %204 = landingpad { i8*, i32 }
12771277 cleanup
12781278 %205 = extractvalue { i8*, i32 } %204, 0
12791279 store i8* %205, i8** %exn.slot
12831283 br label %eh.resume
12841284
12851285 lpad313: ; preds = %invoke.cont285
1286 %207 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1286 %207 = landingpad { i8*, i32 }
12871287 cleanup
12881288 %208 = extractvalue { i8*, i32 } %207, 0
12891289 store i8* %208, i8** %exn.slot
12931293 br label %eh.resume
12941294
12951295 lpad342: ; preds = %invoke.cont314
1296 %210 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1296 %210 = landingpad { i8*, i32 }
12971297 cleanup
12981298 %211 = extractvalue { i8*, i32 } %210, 0
12991299 store i8* %211, i8** %exn.slot
13031303 br label %eh.resume
13041304
13051305 lpad371: ; preds = %invoke.cont343
1306 %213 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1306 %213 = landingpad { i8*, i32 }
13071307 cleanup
13081308 %214 = extractvalue { i8*, i32 } %213, 0
13091309 store i8* %214, i8** %exn.slot
13131313 br label %eh.resume
13141314
13151315 lpad400: ; preds = %invoke.cont372
1316 %216 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1316 %216 = landingpad { i8*, i32 }
13171317 cleanup
13181318 %217 = extractvalue { i8*, i32 } %216, 0
13191319 store i8* %217, i8** %exn.slot
13231323 br label %eh.resume
13241324
13251325 lpad429: ; preds = %invoke.cont401
1326 %219 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1326 %219 = landingpad { i8*, i32 }
13271327 cleanup
13281328 %220 = extractvalue { i8*, i32 } %219, 0
13291329 store i8* %220, i8** %exn.slot
13331333 br label %eh.resume
13341334
13351335 lpad458: ; preds = %invoke.cont430
1336 %222 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1336 %222 = landingpad { i8*, i32 }
13371337 cleanup
13381338 %223 = extractvalue { i8*, i32 } %222, 0
13391339 store i8* %223, i8** %exn.slot
13431343 br label %eh.resume
13441344
13451345 lpad487: ; preds = %invoke.cont459
1346 %225 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1346 %225 = landingpad { i8*, i32 }
13471347 cleanup
13481348 %226 = extractvalue { i8*, i32 } %225, 0
13491349 store i8* %226, i8** %exn.slot
13531353 br label %eh.resume
13541354
13551355 lpad516: ; preds = %invoke.cont488
1356 %228 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1356 %228 = landingpad { i8*, i32 }
13571357 cleanup
13581358 %229 = extractvalue { i8*, i32 } %228, 0
13591359 store i8* %229, i8** %exn.slot
13701370 resume { i8*, i32 } %lpad.val526
13711371
13721372 terminate.lpad: ; preds = %lpad89, %lpad80, %lpad71, %lpad62, %lpad53, %lpad44, %lpad35, %lpad26, %lpad17, %lpad8, %lpad
1373 %231 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
1373 %231 = landingpad { i8*, i32 }
13741374 catch i8* null
13751375 call void @_ZSt9terminatev() noreturn nounwind
13761376 unreachable
5050 @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"
5151
5252 ; Function Attrs: uwtable
53 define void @sink_alloca_to_catch() #0 {
53 define void @sink_alloca_to_catch() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
5454 entry:
5555 %0 = alloca i32
5656 %only_used_in_catch = alloca i32, align 4
5858 to label %try.cont unwind label %lpad
5959
6060 lpad: ; preds = %entry
61 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
61 %1 = landingpad { i8*, i32 }
6262 catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
6363 %2 = extractvalue { i8*, i32 } %1, 1
6464 %3 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)) #3
8585 declare void @use_catch_var(i32*) #1
8686
8787 ; Function Attrs: uwtable
88 define void @dont_sink_alloca_to_catch(i32 %n) #0 {
88 define void @dont_sink_alloca_to_catch(i32 %n) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
8989 entry:
9090 %0 = alloca i32
9191 %n.addr = alloca i32, align 4
108108 br label %try.cont
109109
110110 lpad: ; preds = %while.body
111 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
111 %2 = landingpad { i8*, i32 }
112112 catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
113113 %3 = extractvalue { i8*, i32 } %2, 0
114114 store i8* %3, i8** %exn.slot
140140 br label %while.cond
141141
142142 lpad1: ; preds = %catch
143 %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
143 %8 = landingpad { i8*, i32 }
144144 cleanup
145145 %9 = extractvalue { i8*, i32 } %8, 0
146146 store i8* %9, i8** %exn.slot
2424 ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
2525
2626 ; Function Attrs: uwtable
27 define void @_Z4testv() #0 {
27 define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
2828 entry:
2929 %exn.slot = alloca i8*
3030 %ehselector.slot = alloca i32
3535 br label %try.cont
3636
3737 ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
38 ; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
38 ; CHECK: landingpad { i8*, i32 }
3939 ; CHECK-NEXT: catch i8* null
4040 ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @_Z4testv.catch)
4141 ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont]
4242
4343 lpad: ; preds = %entry
44 %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
44 %tmp = landingpad { i8*, i32 }
4545 catch i8* null
4646 %tmp1 = extractvalue { i8*, i32 } %tmp, 0
4747 store i8* %tmp1, i8** %exn.slot
4949 ; CHECK: }
5050
5151 ; Function Attrs: uwtable
52 define void @"\01?test@@YAXXZ"() #0 {
52 define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
5353 entry:
5454 %o = alloca %class.Obj, align 1
5555 %tmp = alloca i32, align 4
6161 to label %unreachable unwind label %lpad
6262
6363 lpad: ; preds = %entry
64 %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
64 %1 = landingpad { i8*, i32 }
6565 catch i8* null
6666 %2 = extractvalue { i8*, i32 } %1, 0
6767 store i8* %2, i8** %exn.slot
7777 to label %unreachable unwind label %lpad1
7878
7979 lpad1: ; preds = %catch
80 %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
80 %4 = landingpad { i8*, i32 }
8181 cleanup
8282 %5 = extractvalue { i8*, i32 } %4, 0
8383 store i8* %5, i8** %exn.slot
112112 ; CHECK: [[SPLIT_LABEL]]
113113 ;
114114 ; CHECK: [[LPAD_LABEL]]
115 ; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
115 ; CHECK: landingpad { i8*, i32 }
116116 ; CHECK: cleanup
117117 ; CHECK: unreachable
118118 ; CHECK: }
2828 ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
2929
3030 ; Function Attrs: uwtable
31 define void @_Z4testv() #0 {
31 define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
3232 entry:
3333 %exn.slot = alloca i8*
3434 %ehselector.slot = alloca i32
4040 br label %try.cont
4141
4242 ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
43 ; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
43 ; CHECK: landingpad { i8*, i32 }
4444 ; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
4545 ; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i8** @_ZTIi to i8*), i32 0, i8* (i8*, i8*)* @_Z4testv.catch)
4646 ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont]
4747
4848 lpad: ; preds = %entry
49 %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
49 %tmp = landingpad { i8*, i32 }
5050 catch i8* bitcast (i8** @_ZTIi to i8*)
5151 %tmp1 = extractvalue { i8*, i32 } %tmp, 0
5252 store i8* %tmp1, i8** %exn.slot
3030 @"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
3131
3232
33 ; CHECK-LABEL: define void @"\01?test@@YAXXZ"() #0 {
33 ; CHECK-LABEL: define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
3434 ; CHECK: entry:
3535 ; CHECK: [[OBJ_PTR:\%.+]] = alloca %class.SomeClass
3636 ; CHECK: [[TMP0:\%.+]] = alloca i32, align 4
4040 ; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
4141
4242 ; Function Attrs: uwtable
43 define void @"\01?test@@YAXXZ"() #0 {
43 define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
4444 entry:
4545 %obj = alloca %class.SomeClass, align 1
4646 %0 = alloca i32, align 4
6565 to label %try.cont unwind label %lpad3
6666
6767 ; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
68 ; CHECK: [[LPAD_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
68 ; CHECK: [[LPAD_VAL:\%.+]] = landingpad { i8*, i32 }
6969 ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
7070 ; 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")
7171 ; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont15]
7272
7373 lpad: ; preds = %entry
74 %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
74 %2 = landingpad { i8*, i32 }
7575 catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
7676 %3 = extractvalue { i8*, i32 } %2, 0
7777 %4 = extractvalue { i8*, i32 } %2, 1
7878 br label %catch.dispatch7
7979
8080 ; CHECK: [[LPAD1_LABEL]]:{{[ ]+}}; preds = %invoke.cont
81 ; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
81 ; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 }
8282 ; CHECK-NEXT: cleanup
8383 ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
8484 ; 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")
8585 ; CHECK-NEXT: indirectbr i8* [[RECOVER1]], [label %try.cont15]
8686
8787 lpad1: ; preds = %invoke.cont
88 %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
88 %5 = landingpad { i8*, i32 }
8989 cleanup
9090 catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
9191 %6 = extractvalue { i8*, i32 } %5, 0
9393 br label %ehcleanup
9494
9595 ; CHECK: [[LPAD3_LABEL]]:{{[ ]+}}; preds = %invoke.cont2
96 ; CHECK: [[LPAD3_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
96 ; CHECK: [[LPAD3_VAL:\%.+]] = landingpad { i8*, i32 }
9797 ; CHECK-NEXT: cleanup
9898 ; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
9999 ; 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")
100100 ; CHECK-NEXT: indirectbr i8* [[RECOVER3]], [label %try.cont, label %try.cont15]
101101
102102 lpad3: ; preds = %invoke.cont2
103 %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
103