MODULE_CODE_FUNCTION Record
^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prologuedata, dllstorageclass, comdat, prefixdata]``
+``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prologuedata, dllstorageclass, comdat, prefixdata, personalityfn]``
The ``FUNCTION`` record (code 8) marks the declaration or definition of a
function. The operand fields are:
* *prefixdata*: If non-zero, the value index of the prefix data for this function,
plus 1.
+* *personalityfn*: If non-zero, the value index of the personality function for this function,
+ plus 1.
MODULE_CODE_ALIAS Record
^^^^^^^^^^^^^^^^^^^^^^^^
an optional section, an optional alignment,
an optional :ref:`comdat <langref_comdats>`,
an optional :ref:`garbage collector name <gc>`, an optional :ref:`prefix <prefixdata>`,
-an optional :ref:`prologue <prologuedata>`, an opening
-curly brace, a list of basic blocks, and a closing curly brace.
+an optional :ref:`prologue <prologuedata>`,
+an optional :ref:`personality <personalityfn>`,
+an opening curly brace, a list of basic blocks, and a closing curly brace.
LLVM function declarations consist of the "``declare``" keyword, an
optional :ref:`linkage type <linkage>`, an optional :ref:`visibility
[cconv] [ret attrs]
<ResultType> @<FunctionName> ([argument list])
[unnamed_addr] [fn Attrs] [section "name"] [comdat [($name)]]
- [align N] [gc] [prefix Constant] [prologue Constant] { ... }
+ [align N] [gc] [prefix Constant] [prologue Constant]
+ [personality Constant] { ... }
The argument list is a comma seperated sequence of arguments where each
argument is of the following form
to the ``available_externally`` linkage in that the data may be used by the
optimizers but will not be emitted in the object file.
+.. _personalityfn:
+
+Personality Function
+-------------
+
+The ``personality`` attribute permits functions to specify what function
+to use for exception handling.
+
.. _attrgrp:
Attribute Groups
::
- <resultval> = landingpad <resultty> personality <type> <pers_fn> <clause>+
- <resultval> = landingpad <resultty> personality <type> <pers_fn> cleanup <clause>*
+ <resultval> = landingpad <resultty> <clause>+
+ <resultval> = landingpad <resultty> cleanup <clause>*
<clause> := catch <type> <value>
<clause> := filter <array constant type> <array constant>
system <ExceptionHandling.html#overview>`_ to specify that a basic block
is a landing pad --- one where the exception lands, and corresponds to the
code found in the ``catch`` portion of a ``try``/``catch`` sequence. It
-defines values supplied by the personality function (``pers_fn``) upon
+defines values supplied by the :ref:`personality function <personalityfn>` upon
re-entry to the function. The ``resultval`` has the type ``resultty``.
Arguments:
""""""""""
-This instruction takes a ``pers_fn`` value. This is the personality
-function associated with the unwinding mechanism. The optional
+The optional
``cleanup`` flag indicates that the landing pad block is a cleanup.
A ``clause`` begins with the clause type --- ``catch`` or ``filter`` --- and
""""""""""
The '``landingpad``' instruction defines the values which are set by the
-personality function (``pers_fn``) upon re-entry to the function, and
+:ref:`personality function <personalityfn>` upon re-entry to the function, and
therefore the "result type" of the ``landingpad`` instruction. As with
calling conventions, how the personality function results are
represented in LLVM IR is target specific.
pad block.
- A basic block that is not a landing pad block may not include a
'``landingpad``' instruction.
-- All '``landingpad``' instructions in a function must have the same
- personality function.
Example:
""""""""
.. code-block:: llvm
;; A landing pad which can catch an integer.
- %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %res = landingpad { i8*, i32 }
catch i8** @_ZTIi
;; A landing pad that is a cleanup.
- %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %res = landingpad { i8*, i32 }
cleanup
;; A landing pad which can catch an integer and can only throw a double.
- %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %res = landingpad { i8*, i32 }
catch i8** @_ZTIi
filter [1 x i8**] [@_ZTId]
llvm_unreachable("invalid enum");
}
- bool canSimplifyInvokeNoUnwind(const InvokeInst *II);
+ bool canSimplifyInvokeNoUnwind(const Function *F);
} // end namespace llvm
// align, vol,
// ordering, synchscope]
FUNC_CODE_INST_RESUME = 39, // RESUME: [opval]
- FUNC_CODE_INST_LANDINGPAD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...]
+ FUNC_CODE_INST_LANDINGPAD_OLD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...]
FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol,
// ordering, synchscope]
FUNC_CODE_INST_STOREATOMIC_OLD = 42, // STORE: [ptrty,ptr,val, align, vol
FUNC_CODE_INST_STOREATOMIC = 45, // STORE: [ptrty,ptr,val, align, vol
FUNC_CODE_INST_CMPXCHG = 46, // CMPXCHG: [ptrty,ptr,valty,cmp,new, align,
// vol,ordering,synchscope]
+ FUNC_CODE_INST_LANDINGPAD = 47, // LANDINGPAD: [ty,val,num,id0,val0...]
};
enum UseListCodes {
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/GlobalObject.h"
+#include "llvm/IR/OperandTraits.h"
#include "llvm/Support/Compiler.h"
namespace llvm {
public:
static Function *Create(FunctionType *Ty, LinkageTypes Linkage,
const Twine &N = "", Module *M = nullptr) {
- return new(0) Function(Ty, Linkage, N, M);
+ return new(1) Function(Ty, Linkage, N, M);
}
~Function() override;
+ /// \brief Provide fast operand accessors
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+
+ /// \brief Get the personality function associated with this function.
+ bool hasPersonalityFn() const { return getNumOperands() != 0; }
+ Constant *getPersonalityFn() const {
+ assert(hasPersonalityFn());
+ return cast<Constant>(Op<0>());
+ }
+ void setPersonalityFn(Constant *C);
+
Type *getReturnType() const; // Return the type of the ret val
FunctionType *getFunctionType() const; // Return the FunctionType for me
return F ? &F->getValueSymbolTable() : nullptr;
}
+template <>
+struct OperandTraits<Function> : public OptionalOperandTraits<Function> {};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(Function, Value)
+
} // End llvm namespace
#endif
return Insert(InsertValueInst::Create(Agg, Val, Idxs), Name);
}
- LandingPadInst *CreateLandingPad(Type *Ty, Value *PersFn, unsigned NumClauses,
+ LandingPadInst *CreateLandingPad(Type *Ty, unsigned NumClauses,
const Twine &Name = "") {
- return Insert(LandingPadInst::Create(Ty, PersFn, NumClauses), Name);
+ return Insert(LandingPadInst::Create(Ty, NumClauses), Name);
}
//===--------------------------------------------------------------------===//
return User::operator new(s);
}
void growOperands(unsigned Size);
- void init(Value *PersFn, unsigned NumReservedValues, const Twine &NameStr);
+ void init(unsigned NumReservedValues, const Twine &NameStr);
+
+ explicit LandingPadInst(Type *RetTy, unsigned NumReservedValues,
+ const Twine &NameStr, Instruction *InsertBefore);
+ explicit LandingPadInst(Type *RetTy, unsigned NumReservedValues,
+ const Twine &NameStr, BasicBlock *InsertAtEnd);
- explicit LandingPadInst(Type *RetTy, Value *PersonalityFn,
- unsigned NumReservedValues, const Twine &NameStr,
- Instruction *InsertBefore);
- explicit LandingPadInst(Type *RetTy, Value *PersonalityFn,
- unsigned NumReservedValues, const Twine &NameStr,
- BasicBlock *InsertAtEnd);
protected:
LandingPadInst *clone_impl() const override;
public:
/// Constructors - NumReservedClauses is a hint for the number of incoming
/// clauses that this landingpad will have (use 0 if you really have no idea).
- static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn,
- unsigned NumReservedClauses,
+ static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses,
const Twine &NameStr = "",
Instruction *InsertBefore = nullptr);
- static LandingPadInst *Create(Type *RetTy, Value *PersonalityFn,
- unsigned NumReservedClauses,
+ static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses,
const Twine &NameStr, BasicBlock *InsertAtEnd);
/// Provide fast operand accessors
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
- /// getPersonalityFn - Get the personality function associated with this
- /// landing pad.
- Value *getPersonalityFn() const { return getOperand(0); }
-
/// isCleanup - Return 'true' if this landingpad instruction is a
/// cleanup. I.e., it should be run when unwinding even if its landing pad
/// doesn't catch the exception.
/// Get the value of the clause at index Idx. Use isCatch/isFilter to
/// determine what type of clause this is.
Constant *getClause(unsigned Idx) const {
- return cast<Constant>(getOperandList()[Idx + 1]);
+ return cast<Constant>(getOperandList()[Idx]);
}
/// isCatch - Return 'true' if the clause and index Idx is a catch clause.
bool isCatch(unsigned Idx) const {
- return !isa<ArrayType>(getOperandList()[Idx + 1]->getType());
+ return !isa<ArrayType>(getOperandList()[Idx]->getType());
}
/// isFilter - Return 'true' if the clause and index Idx is a filter clause.
bool isFilter(unsigned Idx) const {
- return isa<ArrayType>(getOperandList()[Idx + 1]->getType());
+ return isa<ArrayType>(getOperandList()[Idx]->getType());
}
/// getNumClauses - Get the number of clauses for this landing pad.
- unsigned getNumClauses() const { return getNumOperands() - 1; }
+ unsigned getNumClauses() const { return getNumOperands(); }
/// reserveClauses - Grow the size of the operand list to accommodate the new
/// number of clauses.
};
template <>
-struct OperandTraits<LandingPadInst> : public HungoffOperandTraits<2> {
+struct OperandTraits<LandingPadInst> : public HungoffOperandTraits<1> {
};
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(LandingPadInst, Value)
NumUserOperands = NumOps;
}
+ /// Set the number of operands on a Function.
+ ///
+ /// Function always allocates space for a single operands, but
+ /// doesn't always use it.
+ ///
+ /// FIXME: As that the number of operands is used to find the start of
+ /// the allocated memory in operator delete, we need to always think we have
+ /// 1 operand before delete.
+ void setFunctionNumOperands(unsigned NumOps) {
+ assert(NumOps <= 1 && "Function can only have 0 or 1 operands");
+ NumUserOperands = NumOps;
+ }
+
/// \brief Subclasses with hung off uses need to manage the operand count
/// themselves. In these instances, the operand count isn't used to find the
/// OperandList, so there's no issue in having the operand count change.
.Default(EHPersonality::Unknown);
}
-bool llvm::canSimplifyInvokeNoUnwind(const InvokeInst *II) {
- const LandingPadInst *LP = II->getLandingPadInst();
- EHPersonality Personality = classifyEHPersonality(LP->getPersonalityFn());
+bool llvm::canSimplifyInvokeNoUnwind(const Function *F) {
+ EHPersonality Personality = classifyEHPersonality(F->getPersonalityFn());
// We can't simplify any invokes to nounwind functions if the personality
// function wants to catch asynch exceptions. The nounwind attribute only
// implies that the function does not throw synchronous exceptions.
/// FunctionHeader
/// ::= OptionalLinkage OptionalVisibility OptionalCallingConv OptRetAttrs
/// OptUnnamedAddr Type GlobalName '(' ArgList ')' OptFuncAttrs OptSection
-/// OptionalAlign OptGC OptionalPrefix OptionalPrologue
+/// OptionalAlign OptGC OptionalPrefix OptionalPrologue OptPersonalityFn
bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
// Parse the linkage.
LocTy LinkageLoc = Lex.getLoc();
LocTy UnnamedAddrLoc;
Constant *Prefix = nullptr;
Constant *Prologue = nullptr;
+ Constant *PersonalityFn = nullptr;
Comdat *C;
if (ParseArgumentList(ArgList, isVarArg) ||
(EatIfPresent(lltok::kw_prefix) &&
ParseGlobalTypeAndValue(Prefix)) ||
(EatIfPresent(lltok::kw_prologue) &&
- ParseGlobalTypeAndValue(Prologue)))
+ ParseGlobalTypeAndValue(Prologue)) ||
+ (EatIfPresent(lltok::kw_personality) &&
+ ParseGlobalTypeAndValue(PersonalityFn)))
return true;
if (FuncAttrs.contains(Attribute::Builtin))
Fn->setAlignment(Alignment);
Fn->setSection(Section);
Fn->setComdat(C);
+ Fn->setPersonalityFn(PersonalityFn);
if (!GC.empty()) Fn->setGC(GC.c_str());
Fn->setPrefixData(Prefix);
Fn->setPrologueData(Prologue);
/// ::= 'filter' TypeAndValue ( ',' TypeAndValue )*
bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) {
Type *Ty = nullptr; LocTy TyLoc;
- Value *PersFn; LocTy PersFnLoc;
- if (ParseType(Ty, TyLoc) ||
- ParseToken(lltok::kw_personality, "expected 'personality'") ||
- ParseTypeAndValue(PersFn, PersFnLoc, PFS))
+ if (ParseType(Ty, TyLoc))
return true;
- std::unique_ptr<LandingPadInst> LP(LandingPadInst::Create(Ty, PersFn, 0));
+ std::unique_ptr<LandingPadInst> LP(LandingPadInst::Create(Ty, 0));
LP->setCleanup(EatIfPresent(lltok::kw_cleanup));
while (Lex.getKind() == lltok::kw_catch || Lex.getKind() == lltok::kw_filter){
std::vector<std::pair<GlobalAlias*, unsigned> > AliasInits;
std::vector<std::pair<Function*, unsigned> > FunctionPrefixes;
std::vector<std::pair<Function*, unsigned> > FunctionPrologues;
+ std::vector<std::pair<Function*, unsigned> > FunctionPersonalityFns;
SmallVector<Instruction*, 64> InstsWithTBAATag;
std::vector<std::pair<GlobalAlias*, unsigned> > AliasInitWorklist;
std::vector<std::pair<Function*, unsigned> > FunctionPrefixWorklist;
std::vector<std::pair<Function*, unsigned> > FunctionPrologueWorklist;
+ std::vector<std::pair<Function*, unsigned> > FunctionPersonalityFnWorklist;
GlobalInitWorklist.swap(GlobalInits);
AliasInitWorklist.swap(AliasInits);
FunctionPrefixWorklist.swap(FunctionPrefixes);
FunctionPrologueWorklist.swap(FunctionPrologues);
+ FunctionPersonalityFnWorklist.swap(FunctionPersonalityFns);
while (!GlobalInitWorklist.empty()) {
unsigned ValID = GlobalInitWorklist.back().second;
FunctionPrologueWorklist.pop_back();
}
+ while (!FunctionPersonalityFnWorklist.empty()) {
+ unsigned ValID = FunctionPersonalityFnWorklist.back().second;
+ if (ValID >= ValueList.size()) {
+ FunctionPersonalityFns.push_back(FunctionPersonalityFnWorklist.back());
+ } else {
+ if (Constant *C = dyn_cast_or_null<Constant>(ValueList[ValID]))
+ FunctionPersonalityFnWorklist.back().first->setPersonalityFn(C);
+ else
+ return error("Expected a constant");
+ }
+ FunctionPersonalityFnWorklist.pop_back();
+ }
+
return std::error_code();
}
if (Record.size() > 13 && Record[13] != 0)
FunctionPrefixes.push_back(std::make_pair(Func, Record[13]-1));
+ if (Record.size() > 14 && Record[14] != 0)
+ FunctionPersonalityFns.push_back(std::make_pair(Func, Record[14] - 1));
+
ValueList.push_back(Func);
// If this is a function with a body, remember the prototype we are
break;
}
- case bitc::FUNC_CODE_INST_LANDINGPAD: {
+ case bitc::FUNC_CODE_INST_LANDINGPAD:
+ case bitc::FUNC_CODE_INST_LANDINGPAD_OLD: {
// LANDINGPAD: [ty, val, val, num, (id0,val0 ...)?]
unsigned Idx = 0;
- if (Record.size() < 4)
- return error("Invalid record");
+ if (BitCode == bitc::FUNC_CODE_INST_LANDINGPAD) {
+ if (Record.size() < 3)
+ return error("Invalid record");
+ } else {
+ assert(BitCode == bitc::FUNC_CODE_INST_LANDINGPAD_OLD);
+ if (Record.size() < 4)
+ return error("Invalid record");
+ }
Type *Ty = getTypeByID(Record[Idx++]);
if (!Ty)
return error("Invalid record");
- Value *PersFn = nullptr;
- if (getValueTypePair(Record, Idx, NextValueNo, PersFn))
- return error("Invalid record");
+ if (BitCode == bitc::FUNC_CODE_INST_LANDINGPAD_OLD) {
+ Value *PersFn = nullptr;
+ if (getValueTypePair(Record, Idx, NextValueNo, PersFn))
+ return error("Invalid record");
+
+ if (!F->hasPersonalityFn())
+ F->setPersonalityFn(cast<Constant>(PersFn));
+ else if (F->getPersonalityFn() != cast<Constant>(PersFn))
+ return error("Personality function mismatch");
+ }
bool IsCleanup = !!Record[Idx++];
unsigned NumClauses = Record[Idx++];
- LandingPadInst *LP = LandingPadInst::Create(Ty, PersFn, NumClauses);
+ LandingPadInst *LP = LandingPadInst::Create(Ty, NumClauses);
LP->setCleanup(IsCleanup);
for (unsigned J = 0; J != NumClauses; ++J) {
LandingPadInst::ClauseType CT =
for (const Function &F : *M) {
// FUNCTION: [type, callingconv, isproto, linkage, paramattrs, alignment,
// section, visibility, gc, unnamed_addr, prologuedata,
- // dllstorageclass, comdat, prefixdata]
+ // dllstorageclass, comdat, prefixdata, personalityfn]
Vals.push_back(VE.getTypeID(F.getFunctionType()));
Vals.push_back(F.getCallingConv());
Vals.push_back(F.isDeclaration());
Vals.push_back(F.hasComdat() ? VE.getComdatID(F.getComdat()) : 0);
Vals.push_back(F.hasPrefixData() ? (VE.getValueID(F.getPrefixData()) + 1)
: 0);
+ Vals.push_back(
+ F.hasPersonalityFn() ? (VE.getValueID(F.getPersonalityFn()) + 1) : 0);
unsigned AbbrevToUse = 0;
Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse);
const LandingPadInst &LP = cast<LandingPadInst>(I);
Code = bitc::FUNC_CODE_INST_LANDINGPAD;
Vals.push_back(VE.getTypeID(LP.getType()));
- PushValueAndType(LP.getPersonalityFn(), InstID, Vals, VE);
Vals.push_back(LP.isCleanup());
Vals.push_back(LP.getNumClauses());
for (unsigned I = 0, E = LP.getNumClauses(); I != E; ++I) {
if (F.hasPrologueData())
if (!isa<GlobalValue>(F.getPrologueData()))
orderValue(F.getPrologueData(), OM);
+ if (F.hasPersonalityFn())
+ if (!isa<GlobalValue>(F.getPersonalityFn()))
+ orderValue(F.getPersonalityFn(), OM);
}
OM.LastGlobalConstantID = OM.size();
predictValueUseListOrder(F.getPrefixData(), nullptr, OM, Stack);
if (F.hasPrologueData())
predictValueUseListOrder(F.getPrologueData(), nullptr, OM, Stack);
+ if (F.hasPersonalityFn())
+ predictValueUseListOrder(F.getPersonalityFn(), nullptr, OM, Stack);
}
return Stack;
if (F.hasPrologueData())
EnumerateValue(F.getPrologueData());
+ // Enumerate the personality functions.
+ for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I)
+ if (I->hasPersonalityFn())
+ EnumerateValue(I->getPersonalityFn());
+
// Enumerate the metadata type.
//
// TODO: Move this to ValueEnumerator::EnumerateOperandType() once bitcode
if (F->hasPrefixData())
EmitGlobalConstant(F->getPrefixData());
+ // Emit the personality function.
+ if (F->hasPersonalityFn())
+ EmitGlobalConstant(F->getPersonalityFn());
+
// Emit the CurrentFnSym. This is a virtual function to allow targets to
// do their wild and crazy things as required.
EmitFunctionEntryLabel();
bool DwarfEHPrepare::InsertUnwindResumeCalls(Function &Fn) {
SmallVector<ResumeInst*, 16> Resumes;
SmallVector<LandingPadInst*, 16> CleanupLPads;
- bool FoundLP = false;
for (BasicBlock &BB : Fn) {
if (auto *RI = dyn_cast<ResumeInst>(BB.getTerminator()))
Resumes.push_back(RI);
- if (auto *LP = BB.getLandingPadInst()) {
+ if (auto *LP = BB.getLandingPadInst())
if (LP->isCleanup())
CleanupLPads.push_back(LP);
- // Check the personality on the first landingpad. Don't do anything if
- // it's for MSVC.
- if (!FoundLP) {
- FoundLP = true;
- EHPersonality Pers = classifyEHPersonality(LP->getPersonalityFn());
- if (isMSVCEHPersonality(Pers))
- return false;
- }
- }
}
if (Resumes.empty())
return false;
+ // Check the personality, don't do anything if it's for MSVC.
+ EHPersonality Pers = classifyEHPersonality(Fn.getPersonalityFn());
+ if (isMSVCEHPersonality(Pers))
+ return false;
+
LLVMContext &Ctx = Fn.getContext();
size_t ResumesLeft = pruneUnreachableResumes(Fn, Resumes, CleanupLPads);
// If this is an MSVC EH personality, we need to do a bit more work.
EHPersonality Personality = EHPersonality::Unknown;
- if (!LPads.empty())
- Personality = classifyEHPersonality(LPads.back()->getPersonalityFn());
+ if (Fn->hasPersonalityFn())
+ Personality = classifyEHPersonality(Fn->getPersonalityFn());
if (!isMSVCEHPersonality(Personality))
return;
/// landingpad instruction and add them to the specified machine module info.
void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
MachineBasicBlock *MBB) {
- MMI.addPersonality(MBB,
- cast<Function>(I.getPersonalityFn()->stripPointerCasts()));
+ MMI.addPersonality(
+ MBB,
+ cast<Function>(
+ I.getParent()->getParent()->getPersonalityFn()->stripPointerCasts()));
if (I.isCleanup())
MMI.addCleanup(MBB);
// pad into several BBs.
const BasicBlock *LLVMBB = MBB->getBasicBlock();
const LandingPadInst *LPadInst = LLVMBB->getLandingPadInst();
- MF->getMMI().addPersonality(
- MBB, cast<Function>(LPadInst->getPersonalityFn()->stripPointerCasts()));
+ MF->getMMI().addPersonality(MBB, cast<Function>(LPadInst->getParent()
+ ->getParent()
+ ->getPersonalityFn()
+ ->stripPointerCasts()));
EHPersonality Personality = MF->getMMI().getPersonalityType();
if (isMSVCEHPersonality(Personality)) {
BasicBlock *CleanupBB = BasicBlock::Create(C, CleanupBBName, &F);
Type *ExnTy =
StructType::get(Type::getInt8PtrTy(C), Type::getInt32Ty(C), nullptr);
- Constant *PersFn = F.getParent()->getOrInsertFunction(
- "__gcc_personality_v0", FunctionType::get(Type::getInt32Ty(C), true));
+ if (!F.hasPersonalityFn()) {
+ Constant *PersFn = F.getParent()->getOrInsertFunction(
+ "__gcc_personality_v0",
+ FunctionType::get(Type::getInt32Ty(C), true));
+ F.setPersonalityFn(PersFn);
+ }
LandingPadInst *LPad =
- LandingPadInst::Create(ExnTy, PersFn, 1, "cleanup.lpad", CleanupBB);
+ LandingPadInst::Create(ExnTy, 1, "cleanup.lpad", CleanupBB);
LPad->setCleanup(true);
ResumeInst *RI = ResumeInst::Create(LPad, CleanupBB);
// Personality function
IRBuilder<> Builder(EntryBB->getTerminator());
if (!PersonalityFn)
- PersonalityFn = LPads[0]->getPersonalityFn();
+ PersonalityFn = F.getPersonalityFn();
Value *PersonalityFieldPtr = Builder.CreateConstGEP2_32(
FunctionContextTy, FuncCtx, 0, 3, "pers_fn_gep");
Builder.CreateStore(
bool outlineHandler(ActionHandler *Action, Function *SrcFn,
LandingPadInst *LPad, BasicBlock *StartBB,
FrameVarInfoMap &VarInfo);
- void addStubInvokeToHandlerIfNeeded(Function *Handler, Value *PersonalityFn);
+ void addStubInvokeToHandlerIfNeeded(Function *Handler);
void mapLandingPadBlocks(LandingPadInst *LPad, LandingPadActions &Actions);
CatchHandler *findCatchHandler(BasicBlock *BB, BasicBlock *&NextBB,
return false;
// Classify the personality to see what kind of preparation we need.
- Personality = classifyEHPersonality(LPads.back()->getPersonalityFn());
+ Personality = classifyEHPersonality(Fn.getPersonalityFn());
// Do nothing if this is not an MSVC personality.
if (!isMSVCEHPersonality(Personality))
return false;
}
-static BasicBlock *createStubLandingPad(Function *Handler,
- Value *PersonalityFn) {
+static BasicBlock *createStubLandingPad(Function *Handler) {
// FIXME: Finish this!
LLVMContext &Context = Handler->getContext();
BasicBlock *StubBB = BasicBlock::Create(Context, "stub");
LandingPadInst *LPad = Builder.CreateLandingPad(
llvm::StructType::get(Type::getInt8PtrTy(Context),
Type::getInt32Ty(Context), nullptr),
- PersonalityFn, 0);
+ 0);
// Insert a call to llvm.eh.actions so that we don't try to outline this lpad.
Function *ActionIntrin =
Intrinsic::getDeclaration(Handler->getParent(), Intrinsic::eh_actions);
// landing pad if none is found. The code that generates the .xdata tables for
// the handler needs at least one landing pad to identify the parent function's
// personality.
-void WinEHPrepare::addStubInvokeToHandlerIfNeeded(Function *Handler,
- Value *PersonalityFn) {
+void WinEHPrepare::addStubInvokeToHandlerIfNeeded(Function *Handler) {
ReturnInst *Ret = nullptr;
UnreachableInst *Unreached = nullptr;
for (BasicBlock &BB : *Handler) {
// parent block. We want to replace that with an invoke call, so we can
// erase it now.
OldRetBB->getTerminator()->eraseFromParent();
- BasicBlock *StubLandingPad = createStubLandingPad(Handler, PersonalityFn);
+ BasicBlock *StubLandingPad = createStubLandingPad(Handler);
Function *F =
Intrinsic::getDeclaration(Handler->getParent(), Intrinsic::donothing);
InvokeInst::Create(F, NewRetBB, StubLandingPad, None, "", OldRetBB);
Handler = createHandlerFunc(Type::getVoidTy(Context),
SrcFn->getName() + ".cleanup", M, ParentFP);
}
+ Handler->setPersonalityFn(SrcFn->getPersonalityFn());
HandlerToParentFP[Handler] = ParentFP;
Handler->addFnAttr("wineh-parent", SrcFn->getName());
BasicBlock *Entry = &Handler->getEntryBlock();
ClonedEntryBB->eraseFromParent();
// Make sure we can identify the handler's personality later.
- addStubInvokeToHandlerIfNeeded(Handler, LPad->getPersonalityFn());
+ addStubInvokeToHandlerIfNeeded(Handler);
if (auto *CatchAction = dyn_cast<CatchHandler>(Action)) {
WinEHCatchDirector *CatchDirector =
if (!isa<GlobalValue>(F.getPrologueData()))
orderValue(F.getPrologueData(), OM);
+ if (F.hasPersonalityFn())
+ if (!isa<GlobalValue>(F.getPersonalityFn()))
+ orderValue(F.getPersonalityFn(), OM);
+
orderValue(&F, OM);
if (F.isDeclaration())
Out << " prologue ";
writeOperand(F->getPrologueData(), true);
}
+ if (F->hasPersonalityFn()) {
+ Out << " personality ";
+ writeOperand(F->getPersonalityFn(), /*PrintType=*/true);
+ }
SmallVector<std::pair<unsigned, MDNode *>, 4> MDs;
F->getAllMetadata(MDs);
} else if (const LandingPadInst *LPI = dyn_cast<LandingPadInst>(&I)) {
Out << ' ';
TypePrinter.print(I.getType(), Out);
- Out << " personality ";
- writeOperand(I.getOperand(0), true); Out << '\n';
+ if (LPI->isCleanup() || LPI->getNumClauses() != 0)
+ Out << '\n';
if (LPI->isCleanup())
Out << " cleanup";
}
LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
- LLVMValueRef PersFn, unsigned NumClauses,
- const char *Name) {
- return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty),
- cast<Function>(unwrap(PersFn)),
- NumClauses, Name));
+ unsigned NumClauses, const char *Name) {
+ return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name));
}
LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn) {
Function::Function(FunctionType *Ty, LinkageTypes Linkage, const Twine &name,
Module *ParentModule)
- : GlobalObject(PointerType::getUnqual(Ty), Value::FunctionVal, nullptr, 0,
- Linkage, name),
+ : GlobalObject(PointerType::getUnqual(Ty), Value::FunctionVal,
+ OperandTraits<Function>::op_begin(this), 0, Linkage, name),
Ty(Ty) {
assert(FunctionType::isValidReturnType(getReturnType()) &&
"invalid return type");
// Remove the function from the on-the-side GC table.
clearGC();
+
+ // FIXME: needed by operator delete
+ setFunctionNumOperands(1);
}
void Function::BuildLazyArguments() const {
// Metadata is stored in a side-table.
clearMetadata();
+
+ setPersonalityFn(nullptr);
}
void Function::addAttribute(unsigned i, Attribute::AttrKind attr) {
setPrologueData(SrcF->getPrologueData());
else
setPrologueData(nullptr);
+ if (SrcF->hasPersonalityFn())
+ setPersonalityFn(SrcF->getPersonalityFn());
+ else
+ setPersonalityFn(nullptr);
}
/// \brief This does the actual lookup of an intrinsic ID which
}
return None;
}
+
+void Function::setPersonalityFn(Constant *C) {
+ if (!C) {
+ if (hasPersonalityFn()) {
+ // Note, the num operands is used to compute the offset of the operand, so
+ // the order here matters. Clearing the operand then clearing the num
+ // operands ensures we have the correct offset to the operand.
+ Op<0>().set(nullptr);
+ setFunctionNumOperands(0);
+ }
+ } else {
+ // Note, the num operands is used to compute the offset of the operand, so
+ // the order here matters. We need to set num operands to 1 first so that
+ // we get the correct offset to the first operand when we set it.
+ if (!hasPersonalityFn())
+ setFunctionNumOperands(1);
+ Op<0>().set(C);
+ }
+}
// LandingPadInst Implementation
//===----------------------------------------------------------------------===//
-LandingPadInst::LandingPadInst(Type *RetTy, Value *PersonalityFn,
- unsigned NumReservedValues, const Twine &NameStr,
- Instruction *InsertBefore)
- : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertBefore) {
- init(PersonalityFn, 1 + NumReservedValues, NameStr);
+LandingPadInst::LandingPadInst(Type *RetTy, unsigned NumReservedValues,
+ const Twine &NameStr, Instruction *InsertBefore)
+ : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertBefore) {
+ init(NumReservedValues, NameStr);
}
-LandingPadInst::LandingPadInst(Type *RetTy, Value *PersonalityFn,
- unsigned NumReservedValues, const Twine &NameStr,
- BasicBlock *InsertAtEnd)
- : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertAtEnd) {
- init(PersonalityFn, 1 + NumReservedValues, NameStr);
+LandingPadInst::LandingPadInst(Type *RetTy, unsigned NumReservedValues,
+ const Twine &NameStr, BasicBlock *InsertAtEnd)
+ : Instruction(RetTy, Instruction::LandingPad, nullptr, 0, InsertAtEnd) {
+ init(NumReservedValues, NameStr);
}
LandingPadInst::LandingPadInst(const LandingPadInst &LP)
setCleanup(LP.isCleanup());
}
-LandingPadInst *LandingPadInst::Create(Type *RetTy, Value *PersonalityFn,
- unsigned NumReservedClauses,
+LandingPadInst *LandingPadInst::Create(Type *RetTy, unsigned NumReservedClauses,
const Twine &NameStr,
Instruction *InsertBefore) {
- return new LandingPadInst(RetTy, PersonalityFn, NumReservedClauses, NameStr,
- InsertBefore);
+ return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertBefore);
}
-LandingPadInst *LandingPadInst::Create(Type *RetTy, Value *PersonalityFn,
- unsigned NumReservedClauses,
+LandingPadInst *LandingPadInst::Create(Type *RetTy, unsigned NumReservedClauses,
const Twine &NameStr,
BasicBlock *InsertAtEnd) {
- return new LandingPadInst(RetTy, PersonalityFn, NumReservedClauses, NameStr,
- InsertAtEnd);
+ return new LandingPadInst(RetTy, NumReservedClauses, NameStr, InsertAtEnd);
}
-void LandingPadInst::init(Value *PersFn, unsigned NumReservedValues,
- const Twine &NameStr) {
+void LandingPadInst::init(unsigned NumReservedValues, const Twine &NameStr) {
ReservedSpace = NumReservedValues;
- setNumHungOffUseOperands(1);
+ setNumHungOffUseOperands(0);
allocHungoffUses(ReservedSpace);
- Op<0>() = PersFn;
setName(NameStr);
setCleanup(false);
}
void LandingPadInst::growOperands(unsigned Size) {
unsigned e = getNumOperands();
if (ReservedSpace >= e + Size) return;
- ReservedSpace = (e + Size / 2) * 2;
+ ReservedSpace = (std::max(e, 1U) + Size / 2) * 2;
growHungoffUses(ReservedSpace);
}
if (FI->hasPrologueData())
incorporateValue(FI->getPrologueData());
+ if (FI->hasPersonalityFn())
+ incorporateValue(FI->getPersonalityFn());
+
// First incorporate the arguments.
for (Function::const_arg_iterator AI = FI->arg_begin(),
AE = FI->arg_end(); AI != AE; ++AI)
/// \brief Track unresolved string-based type references.
SmallDenseMap<const MDString *, const MDNode *, 32> UnresolvedTypeRefs;
- /// \brief The personality function referenced by the LandingPadInsts.
- /// All LandingPadInsts within the same function must use the same
- /// personality function.
- const Value *PersonalityFn;
-
/// \brief Whether we've seen a call to @llvm.frameescape in this function
/// already.
bool SawFrameEscape;
public:
explicit Verifier(raw_ostream &OS)
- : VerifierSupport(OS), Context(nullptr), PersonalityFn(nullptr),
- SawFrameEscape(false) {}
+ : VerifierSupport(OS), Context(nullptr), SawFrameEscape(false) {}
bool verify(const Function &F) {
M = F.getParent();
// FIXME: We strip const here because the inst visitor strips const.
visit(const_cast<Function &>(F));
InstsInThisBlock.clear();
- PersonalityFn = nullptr;
SawFrameEscape = false;
return !Broken;
"invalid linkage type for function declaration", &F);
Assert(MDs.empty(), "function without a body cannot have metadata", &F,
MDs.empty() ? nullptr : MDs.front().second);
+ Assert(!F.hasPersonalityFn(),
+ "Function declaration shouldn't have a personality routine", &F);
} else {
// Verify that this function (which has a body) is not named "llvm.*". It
// is not legal to define intrinsics.
&LPI);
}
+ Function *F = LPI.getParent()->getParent();
+ Assert(F->hasPersonalityFn(),
+ "LandingPadInst needs to be in a function with a personality.", &LPI);
+
// The landingpad instruction must be the first non-PHI instruction in the
// block.
Assert(LPI.getParent()->getLandingPadInst() == &LPI,
"LandingPadInst not the first non-PHI instruction in the block.",
&LPI);
- // The personality functions for all landingpad instructions within the same
- // function should match.
- if (PersonalityFn)
- Assert(LPI.getPersonalityFn() == PersonalityFn,
- "Personality function doesn't match others in function", &LPI);
- PersonalityFn = LPI.getPersonalityFn();
-
- // All operands must be constants.
- Assert(isa<Constant>(PersonalityFn), "Personality function is not constant!",
- &LPI);
for (unsigned i = 0, e = LPI.getNumClauses(); i < e; ++i) {
Constant *Clause = LPI.getClause(i);
if (LPI.isCatch(i)) {
Dst.setPrologueData(MapValue(Src.getPrologueData(), ValueMap, RF_None,
&TypeMap, &ValMaterializer));
+ // Link in the personality function.
+ if (Src.hasPersonalityFn())
+ Dst.setPersonalityFn(MapValue(Src.getPersonalityFn(), ValueMap, RF_None,
+ &TypeMap, &ValMaterializer));
+
// Go through and convert function arguments over, remembering the mapping.
Function::arg_iterator DI = Dst.arg_begin();
for (Argument &Arg : Src.args()) {
return false;
// Check the personality. Do nothing if this is not an MSVC personality.
- LandingPadInst *LP = nullptr;
- for (BasicBlock &BB : F) {
- LP = BB.getLandingPadInst();
- if (LP)
- break;
- }
- if (!LP)
+ if (!F.hasPersonalityFn())
return false;
PersonalityFn =
- dyn_cast<Function>(LP->getPersonalityFn()->stripPointerCasts());
+ dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts());
if (!PersonalityFn)
return false;
Personality = classifyEHPersonality(PersonalityFn);
if (F->hasPrologueData())
MarkUsedGlobalsAsNeeded(F->getPrologueData());
+ if (F->hasPersonalityFn())
+ MarkUsedGlobalsAsNeeded(F->getPersonalityFn());
+
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
for (User::op_iterator U = I->op_begin(), E = I->op_end(); U != E; ++U)
bool MadeChange = false;
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator()))
- if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(II)) {
+ if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(F)) {
SmallVector<Value*, 8> Args(II->op_begin(), II->op_end() - 3);
// Insert a call instruction before the invoke.
CallInst *Call = CallInst::Create(II->getCalledValue(), Args, "", II);
// The logic here should be correct for any real-world personality function.
// However if that turns out not to be true, the offending logic can always
// be conditioned on the personality function, like the catch-all logic is.
- EHPersonality Personality = classifyEHPersonality(LI.getPersonalityFn());
+ EHPersonality Personality =
+ classifyEHPersonality(LI.getParent()->getParent()->getPersonalityFn());
// Simplify the list of clauses, eg by removing repeated catch clauses
// (these are often created by inlining).
// with a new one.
if (MakeNewInstruction) {
LandingPadInst *NLI = LandingPadInst::Create(LI.getType(),
- LI.getPersonalityFn(),
NewClauses.size());
for (unsigned i = 0, e = NewClauses.size(); i != e; ++i)
NLI->addClause(NewClauses[i]);
}
// Instruction isn't dead, see if we can constant propagate it.
- if (!I->use_empty() && isa<Constant>(I->getOperand(0))) {
+ if (!I->use_empty() &&
+ (I->getNumOperands() == 0 || isa<Constant>(I->getOperand(0)))) {
if (Constant *C = ConstantFoldInstruction(I, DL, TLI)) {
DEBUG(dbgs() << "IC: ConstFold to: " << *C << " from: " << *I << '\n');
}
// ConstantProp instruction if trivially constant.
- if (!Inst->use_empty() && isa<Constant>(Inst->getOperand(0)))
+ if (!Inst->use_empty() &&
+ (Inst->getNumOperands() == 0 || isa<Constant>(Inst->getOperand(0))))
if (Constant *C = ConstantFoldInstruction(Inst, DL, TLI)) {
DEBUG(dbgs() << "IC: ConstFold to: " << *C << " from: "
<< *Inst << '\n');
}
// Get the personality function from the callee if it contains a landing pad.
- Value *CalleePersonality = nullptr;
- for (Function::const_iterator I = CalledFunc->begin(), E = CalledFunc->end();
- I != E; ++I)
- if (const InvokeInst *II = dyn_cast<InvokeInst>(I->getTerminator())) {
- const BasicBlock *BB = II->getUnwindDest();
- const LandingPadInst *LP = BB->getLandingPadInst();
- CalleePersonality = LP->getPersonalityFn();
- break;
- }
+ Constant *CalledPersonality =
+ CalledFunc->hasPersonalityFn() ? CalledFunc->getPersonalityFn() : nullptr;
// Find the personality function used by the landing pads of the caller. If it
// exists, then check to see that it matches the personality function used in
// the callee.
- if (CalleePersonality) {
- for (Function::const_iterator I = Caller->begin(), E = Caller->end();
- I != E; ++I)
- if (const InvokeInst *II = dyn_cast<InvokeInst>(I->getTerminator())) {
- const BasicBlock *BB = II->getUnwindDest();
- const LandingPadInst *LP = BB->getLandingPadInst();
-
- // If the personality functions match, then we can perform the
- // inlining. Otherwise, we can't inline.
- // TODO: This isn't 100% true. Some personality functions are proper
- // supersets of others and can be used in place of the other.
- if (LP->getPersonalityFn() != CalleePersonality)
- return false;
-
- break;
- }
+ Constant *CallerPersonality =
+ Caller->hasPersonalityFn() ? Caller->getPersonalityFn() : nullptr;
+ if (CalledPersonality) {
+ if (!CallerPersonality)
+ Caller->setPersonalityFn(CalledPersonality);
+ // If the personality functions match, then we can perform the
+ // inlining. Otherwise, we can't inline.
+ // TODO: This isn't 100% true. Some personality functions are proper
+ // supersets of others and can be used in place of the other.
+ else if (CalledPersonality != CallerPersonality)
+ return false;
}
// Get an iterator to the last basic block in the function, which will have
II->eraseFromParent();
}
-static bool markAliveBlocks(BasicBlock *BB,
+static bool markAliveBlocks(Function &F,
SmallPtrSetImpl<BasicBlock*> &Reachable) {
SmallVector<BasicBlock*, 128> Worklist;
+ BasicBlock *BB = F.begin();
Worklist.push_back(BB);
Reachable.insert(BB);
bool Changed = false;
if (isa<ConstantPointerNull>(Callee) || isa<UndefValue>(Callee)) {
changeToUnreachable(II, true);
Changed = true;
- } else if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(II)) {
+ } else if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(&F)) {
if (II->use_empty() && II->onlyReadsMemory()) {
// jump to the normal destination branch.
BranchInst::Create(II->getNormalDest(), II);
/// otherwise.
bool llvm::removeUnreachableBlocks(Function &F) {
SmallPtrSet<BasicBlock*, 128> Reachable;
- bool Changed = markAliveBlocks(F.begin(), Reachable);
+ bool Changed = markAliveBlocks(F, Reachable);
// If there are unreachable blocks in the CFG...
if (Reachable.size() == F.size())
; RUN: opt < %s -basiccg
; PR13903
-define void @main() {
+define void @main() personality i8 0 {
invoke void @llvm.donothing()
to label %ret unwind label %unw
unw:
- %tmp = landingpad i8 personality i8 0 cleanup
+ %tmp = landingpad i8 cleanup
br label %ret
ret:
ret void
; RUN: opt -verify -disable-output < %s
; This tests that we handle unreachable blocks correctly
-define void @f() {
+define void @f() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
%v1 = invoke i32* @g()
to label %bb1 unwind label %bb2
invoke void @__dynamic_cast()
%Hidden = getelementptr inbounds i32, i32* %v1, i64 1
ret void
bb2:
- %lpad.loopexit80 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %lpad.loopexit80 = landingpad { i8*, i32 }
cleanup
ret void
}
ret void
}
-define void ()* @test1(void ()** %x) {
+define void ()* @test1(void ()** %x) personality i32 (...)* @__gxx_personality_v0 {
; CHECK-LABEL: Call edges in function: test1
; CHECK-NEXT: -> f12
; CHECK-NEXT: -> f11
ret void ()* @f11
unwind:
- %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %res = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } { i8* bitcast (void ()* @f12 to i8*), i32 42 }
}
@_ZTIi = external constant i8*
; Function Attrs: uwtable
-define void @test_ref_clean() {
+define void @test_ref_clean() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
invoke void @_Z9may_throwv()
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn = extractvalue { i8*, i32 } %0, 0
%sel = extractvalue { i8*, i32 } %0, 1
}
; Function Attrs: uwtable
-define void @test_ref_clean_multibranch() {
+define void @test_ref_clean_multibranch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
invoke void @_Z9may_throwv()
to label %invoke.cont unwind label %lpad
to label %invoke.cont unwind label %lpad1
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn = extractvalue { i8*, i32 } %0, 0
%sel = extractvalue { i8*, i32 } %0, 1
to label %try.cont unwind label %lpad
lpad1: ; preds = %entry
- %l1.0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %l1.0 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn1 = extractvalue { i8*, i32 } %l1.0, 0
@_ZTIi = external constant i8*
; Function Attrs: uwtable
-define void @test_missing_endcatch() {
+define void @test_missing_endcatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK: Some paths from llvm.eh.begincatch may not reach llvm.eh.endcatch
; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null)
entry:
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn = extractvalue { i8*, i32 } %0, 0
%sel = extractvalue { i8*, i32 } %0, 1
}
; Function Attrs: uwtable
-define void @test_missing_begincatch() {
+define void @test_missing_begincatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK: llvm.eh.endcatch may be reachable without passing llvm.eh.begincatch
; CHECK-NEXT: call void @llvm.eh.endcatch()
entry:
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn = extractvalue { i8*, i32 } %0, 0
%sel = extractvalue { i8*, i32 } %0, 1
}
; Function Attrs: uwtable
-define void @test_multiple_begin() {
+define void @test_multiple_begin() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK: llvm.eh.begincatch may be called a second time before llvm.eh.endcatch
; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null)
; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn, i8* null)
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn = extractvalue { i8*, i32 } %0, 0
%sel = extractvalue { i8*, i32 } %0, 1
}
; Function Attrs: uwtable
-define void @test_multiple_end() {
+define void @test_multiple_end() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK: llvm.eh.endcatch may be called a second time after llvm.eh.begincatch
; CHECK-NEXT: call void @llvm.eh.endcatch()
; CHECK-NEXT: call void @llvm.eh.endcatch()
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn = extractvalue { i8*, i32 } %0, 0
%sel = extractvalue { i8*, i32 } %0, 1
}
; Function Attrs: uwtable
-define void @test_branch_to_begincatch_with_no_lpad(i32 %fake.sel) {
+define void @test_branch_to_begincatch_with_no_lpad(i32 %fake.sel) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK: llvm.eh.begincatch may be reachable without passing a landingpad
; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn2, i8* null)
entry:
to label %catch unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn = extractvalue { i8*, i32 } %0, 0
%sel = extractvalue { i8*, i32 } %0, 1
}
; Function Attrs: uwtable
-define void @test_branch_missing_endcatch() {
+define void @test_branch_missing_endcatch() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK: Some paths from llvm.eh.begincatch may not reach llvm.eh.endcatch
; CHECK-NEXT: call void @llvm.eh.begincatch(i8* %exn2, i8* null)
entry:
to label %invoke.cont unwind label %lpad1
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn = extractvalue { i8*, i32 } %0, 0
%sel = extractvalue { i8*, i32 } %0, 1
to label %try.cont unwind label %lpad
lpad1: ; preds = %entry
- %l1.0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %l1.0 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTIi to i8*)
%exn1 = extractvalue { i8*, i32 } %l1.0, 0
; CHECK: clause argument must be a constant
-define void @test(i32 %in) {
- landingpad {} personality void()* null filter i32 %in
+define void @test(i32 %in) personality void()* null {
+ landingpad {} filter i32 %in
}
ret i32 0
}
+; CHECK-LABEL: define void @landingpadInstr1
+; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
define void @landingpadInstr1(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
entry:
-; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: %res = landingpad { i8*, i32 }
%res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
; CHECK: catch i8** @_ZTIi
catch i8** @_ZTIi
ret void
}
+; CHECK-LABEL: define void @landingpadInstr2
+; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
define void @landingpadInstr2(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
entry:
-; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: %res = landingpad { i8*, i32 }
%res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
; CHECK: cleanup
cleanup
ret void
}
+; CHECK-LABEL: define void @landingpadInstr3
+; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
define void @landingpadInstr3(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
entry:
-; CHECK: %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: %res = landingpad { i8*, i32 }
%res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
; CHECK: catch i8** @_ZTIi
catch i8** @_ZTIi
; }
;}
-define void @_Z4testii(i32 %a, i32 %b) #0 {
+define void @_Z4testii(i32 %a, i32 %b) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z3fooi(i32 %a)
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = tail call i8* @__cxa_begin_catch(i8* %1) #2
ret void
lpad1: ; preds = %lpad
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
invoke void @__cxa_end_catch()
to label %eh.resume unwind label %terminate.lpad
resume { i8*, i32 } %3
terminate.lpad: ; preds = %lpad1
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %4 = landingpad { i8*, i32 }
catch i8* null
%5 = extractvalue { i8*, i32 } %4, 0
tail call void @__clang_call_terminate(i8* %5) #3
; that case, the machine verifier, which relies on analyzing branches for this
; kind of verification, is unable to check anything, so accepts the CFG.
-define void @test_branch_to_landingpad() {
+define void @test_branch_to_landingpad() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
br i1 undef, label %if.end50.thread, label %if.then6
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765* @"OBJC_EHTYPE_$_NSString"
catch %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765* @OBJC_EHTYPE_id
catch i8* null
unreachable
lpad40:
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* null
br label %finally.catchall
@_ZTIi = external constant i8*
-define i32 @_Z3barv() {
+define i32 @_Z3barv() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z3foov()
to label %return unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%1 = extractvalue { i8*, i32 } %0, 1
%2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) nounwind
%struct.A = type { i32* }
-define void @"\01-[MyFunction Name:]"() {
+define void @"\01-[MyFunction Name:]"() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%save_filt.1 = alloca i32
%save_eptr.0 = alloca i8*
ret void
lpad: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %exn = landingpad {i8*, i32}
cleanup
%eh_ptr = extractvalue {i8*, i32} %exn, 0
store i8* %eh_ptr, i8** %eh_exception
declare void @__cxa_throw(i8*, i8*, i8*)
-define i32 @main() ssp {
+define i32 @main() ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%puts.i = tail call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i32 0, i32 0)) ; <i32> [#uses=0]
%exception.i = tail call i8* @__cxa_allocate_exception(i32 4) nounwind ; <i8*> [#uses=2]
ret i32 %conv
lpad: ; preds = %entry
- %exn.ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %exn.ptr = landingpad { i8*, i32 }
catch i8* bitcast (%0* @_ZTI1A to i8*)
catch i8* null
%exn = extractvalue { i8*, i32 } %exn.ptr, 0
; RUN: llc < %s -mtriple=thumbv7-apple-darwin10
; <rdar://problem/8264008>
-define linkonce_odr arm_apcscc void @func1() {
+define linkonce_odr arm_apcscc void @func1() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%save_filt.936 = alloca i32 ; <i32*> [#uses=2]
%save_eptr.935 = alloca i8* ; <i8**> [#uses=2]
ret void
lpad: ; preds = %bb
- %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %eh_ptr = landingpad { i8*, i32 }
cleanup
%exn = extractvalue { i8*, i32 } %eh_ptr, 0
store i8* %exn, i8** %eh_exception
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
target triple = "thumbv7-apple-darwin"
-define void @func() unnamed_addr align 2 {
+define void @func() unnamed_addr align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
br label %for.cond
br label %for.cond
lpad:
- %exn = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %exn = landingpad { i8*, i32 }
catch i8* null
invoke void @foo()
to label %eh.resume unwind label %terminate.lpad
lpad26:
- %exn27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %exn27 = landingpad { i8*, i32 }
catch i8* null
invoke void @foo()
to label %eh.resume unwind label %terminate.lpad
ret void
lpad44:
- %exn45 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %exn45 = landingpad { i8*, i32 }
catch i8* null
invoke void @foo()
to label %eh.resume unwind label %terminate.lpad
resume { i8*, i32 } %exn.slot.0
terminate.lpad:
- %exn51 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %exn51 = landingpad { i8*, i32 }
catch i8* null
tail call void @_ZSt9terminatev() noreturn nounwind
unreachable
%0 = type opaque
%struct.NSConstantString = type { i32*, i32, i8*, i32 }
-define i32 @asdf(i32 %a, i32 %b, i8** %c, i8* %d) {
+define i32 @asdf(i32 %a, i32 %b, i8** %c, i8* %d) personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
bb:
%tmp = alloca i32, align 4
%tmp1 = alloca i32, align 4
unreachable
bb15: ; preds = %bb11, %bb
- %tmp16 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %tmp16 = landingpad { i8*, i32 }
catch i8* null
%tmp17 = extractvalue { i8*, i32 } %tmp16, 0
store i8* %tmp17, i8** %tmp4
declare void @_ZSt9terminatev()
-define hidden double @t(%0* %self, i8* nocapture %_cmd) optsize ssp {
+define hidden double @t(%0* %self, i8* nocapture %_cmd) optsize ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%call = invoke double undef(%class.FunctionInterpreter.3.15.31* undef) optsize
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast ({ i8*, i8* }* @_ZTI13ParseErrorMsg to i8*)
br i1 undef, label %catch, label %eh.resume
ret double %value.0
lpad1: ; preds = %catch
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
invoke void @__cxa_end_catch()
to label %eh.resume unwind label %terminate.lpad
resume { i8*, i32 } undef
terminate.lpad: ; preds = %lpad1
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %2 = landingpad { i8*, i32 }
catch i8* null
unreachable
}
@_ZTIi = external constant i8*
-define void @_Z3fn2v() #0 {
+define void @_Z3fn2v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z3fn1v()
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%1 = extractvalue { i8*, i32 } %0, 1
%2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #2
@_ZTS3Foo = linkonce_odr constant [5 x i8] c"3Foo\00"
@_ZTI3Foo = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @_ZTS3Foo, i32 0, i32 0) }
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z3foov()
to label %return unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast ({ i8*, i8* }* @_ZTI3Foo to i8*)
%1 = extractvalue { i8*, i32 } %0, 1
%2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast ({ i8*, i8* }* @_ZTI3Foo to i8*)) nounwind
; }
;}
-define void @_Z4testii(i32 %a, i32 %b) #0 {
+define void @_Z4testii(i32 %a, i32 %b) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z3fooi(i32 %a)
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = tail call i8* @__cxa_begin_catch(i8* %1) #2
ret void
lpad1: ; preds = %lpad
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
invoke void @__cxa_end_catch()
to label %eh.resume unwind label %terminate.lpad
resume { i8*, i32 } %3
terminate.lpad: ; preds = %lpad1
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %4 = landingpad { i8*, i32 }
catch i8* null
%5 = extractvalue { i8*, i32 } %4, 0
tail call void @__clang_call_terminate(i8* %5) #3
%A = type { %B }
%B = type { i32 }
-define void @_Z3Foov() ssp {
+define void @_Z3Foov() ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
br i1 true, label %exit, label %false
to label %exit unwind label %lpad
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
unreachable
define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
double %m, double %n, double %p,
- double %q, double %r) {
+ double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
to label %try.cont unwind label %lpad
lpad:
%0 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = tail call i8* @__cxa_begin_catch(i8* %1)
lpad1:
%3 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
cleanup
invoke void @__cxa_end_catch()
to label %eh.resume unwind label %terminate.lpad
terminate.lpad:
%4 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
catch i8* null
%5 = extractvalue { i8*, i32 } %4, 0
tail call void @__clang_call_terminate(i8* %5)
define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
double %m, double %n, double %p,
- double %q, double %r) {
+ double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
to label %try.cont unwind label %lpad
lpad:
%0 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = tail call i8* @__cxa_begin_catch(i8* %1)
lpad1:
%3 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
cleanup
invoke void @__cxa_end_catch()
to label %eh.resume unwind label %terminate.lpad
terminate.lpad:
%4 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
catch i8* null
%5 = extractvalue { i8*, i32 } %4, 0
tail call void @__clang_call_terminate(i8* %5)
@_ZTS9exception = linkonce_odr constant [11 x i8] c"9exception\00"
@_ZTI9exception = linkonce_odr unnamed_addr constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @_ZTS9exception, i32 0, i32 0) }
-define void @f() uwtable {
+define void @f() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
%1 = alloca i8*
%2 = alloca i32
%e = alloca %struct.exception*, align 4
br label %16
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %5 = landingpad { i8*, i32 }
catch i8* bitcast ({ i8*, i8* }* @_ZTI9exception to i8*)
%6 = extractvalue { i8*, i32 } %5, 0
store i8* %6, i8** %1
@_ZTIi = external constant i8*
-define i32 @main() #0 {
+define i32 @main() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%exception = tail call i8* @__cxa_allocate_exception(i32 4) #1
%0 = bitcast i8* %exception to i32*
to label %unreachable unwind label %lpad
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* null
%2 = extractvalue { i8*, i32 } %1, 0
%3 = tail call i8* @__cxa_begin_catch(i8* %2) #1
declare i32 @__gxx_personality_sj0(...)
-define void @test0() {
+define void @test0() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
invoke void @func()
to label %cont unwind label %lpad
ret void
lpad:
- %exn = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %exn = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } %exn
}
declare void @__cxa_call_unexpected(i8*)
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; CHECK-LABEL: main:
entry:
%exception.i = tail call i8* @__cxa_allocate_exception(i32 4) nounwind
to label %unreachable.i unwind label %lpad.i
lpad.i: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
filter [1 x i8*] [i8* bitcast (i8** @_ZTIi to i8*)]
catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK: .long _ZTIi(target2) @ TypeInfo 1
unreachable
lpad: ; preds = %ehspec.unexpected.i
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %4 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
br label %lpad.body
declare void @__cxa_end_catch()
-define void @test1() nounwind {
+define void @test1() nounwind personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throw_exception() to label %try.cont unwind label %lpad
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = tail call i8* @__cxa_begin_catch(i8* %1)
declare void @__cxa_end_catch()
-define void @test1() {
+define void @test1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throw_exception() to label %try.cont unwind label %lpad
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = tail call i8* @__cxa_begin_catch(i8* %1)
define void @_Z4testiiiiiddddd(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e,
double %m, double %n, double %p,
- double %q, double %r) {
+ double %q, double %r) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z5printiiiii(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e)
to label %try.cont unwind label %lpad
lpad:
%0 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = tail call i8* @__cxa_begin_catch(i8* %1)
lpad1:
%3 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
cleanup
invoke void @__cxa_end_catch()
to label %eh.resume unwind label %terminate.lpad
terminate.lpad:
%4 = landingpad { i8*, i32 }
- personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
catch i8* null
%5 = extractvalue { i8*, i32 } %4, 0
tail call void @__clang_call_terminate(i8* %5)
; CHECK: ZTIi
@_ZTIi = internal global i8* null
-define i32 @_Z9exceptioni(i32 %arg) {
+define i32 @_Z9exceptioni(i32 %arg) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
bb:
%tmp = invoke i32 @_Z14throwSomethingi(i32 %arg)
to label %bb9 unwind label %bb1
bb1: ; preds = %bb
- %tmp2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp2 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%tmp3 = extractvalue { i8*, i32 } %tmp2, 1
%tmp4 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
@Exn = external hidden unnamed_addr constant { i8*, i8* }
-define hidden void @func(i32* %this, i32* %e) optsize align 2 {
+define hidden void @func(i32* %this, i32* %e) optsize align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
%e.ld = load i32, i32* %e, align 4
%inv = invoke zeroext i1 @func2(i32* %this, i32 %e.ld) optsize
to label %ret unwind label %lpad
ret void
lpad:
- %lp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %lp = landingpad { i8*, i32 }
catch i8* bitcast ({ i8*, i8* }* @Exn to i8*)
br label %.loopexit4
; <rdar://problem/13228754> & <rdar://problem/13316637>
; CHECK: .globl _foo
-define void @foo() {
+define void @foo() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
invoke.cont:
invoke void @callA()
to label %invoke.cont25 unwind label %lpad2
ret void
lpad2:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
br label %eh.resume
lpad15:
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
br label %eh.resume
}
; CHECK: .globl _bar
-define linkonce_odr void @bar(i32* %a) {
+define linkonce_odr void @bar(i32* %a) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
if.end.i.i.i:
invoke void @llvm.donothing()
to label %call.i.i.i.noexc unwind label %eh.resume
ret void
eh.resume:
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
%2 = extractvalue { i8*, i32 } %1, 0
%3 = extractvalue { i8*, i32 } %1, 1
declare void @bar(%struct.__CFString*, %struct.__CFString*)
-define noalias i8* @foo(i8* nocapture %inRefURL) noreturn ssp {
+define noalias i8* @foo(i8* nocapture %inRefURL) noreturn ssp personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%call = tail call %struct.__CFString* @bar3()
%call2 = invoke i8* @bar2()
to label %for.cond unwind label %lpad5
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
%1 = extractvalue { i8*, i32 } %0, 0
%2 = extractvalue { i8*, i32 } %0, 1
br label %ehcleanup
lpad5: ; preds = %for.cond
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
%4 = extractvalue { i8*, i32 } %3, 0
%5 = extractvalue { i8*, i32 } %3, 1
to label %ehcleanup unwind label %terminate.lpad.i.i16
terminate.lpad.i.i16: ; preds = %lpad5
- %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %6 = landingpad { i8*, i32 }
catch i8* null
tail call void @terminatev() noreturn nounwind
unreachable
to label %_ZN5SmartIPK10__CFStringED1Ev.exit unwind label %terminate.lpad.i.i
terminate.lpad.i.i: ; preds = %ehcleanup
- %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %8 = landingpad { i8*, i32 }
catch i8* null
tail call void @terminatev() noreturn nounwind
unreachable
@.str = private unnamed_addr constant [12 x i8] c"some_string\00", align 1
-define void @_Z4foo1c(i8 signext %a) {
+define void @_Z4foo1c(i8 signext %a) personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%s1 = alloca %"class.std::__1::basic_string", align 4
call void @_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(%"class.std::__1::basic_string"* %s1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32 11)
ret void
lpad.body: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
%3 = extractvalue { i8*, i32 } %2, 0
%4 = extractvalue { i8*, i32 } %2, 1
br label %ehcleanup
lpad2: ; preds = %invoke.cont
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %5 = landingpad { i8*, i32 }
cleanup
%6 = extractvalue { i8*, i32 } %5, 0
%7 = extractvalue { i8*, i32 } %5, 1
resume { i8*, i32 } %lpad.val13
terminate.lpad: ; preds = %ehcleanup
- %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %8 = landingpad { i8*, i32 }
catch i8* null
%9 = extractvalue { i8*, i32 } %8, 0
call void @__clang_call_terminate(i8* %9)
; __Unwind_SjLj_Register and actual @bar invocation
-define i8* @foo(i8 %a, {} %c) {
+define i8* @foo(i8 %a, {} %c) personality i8* bitcast (i32 (...)* @baz to i8*) {
entry:
; CHECK: bl __Unwind_SjLj_Register
; CHECK-NEXT: {{[A-Z][a-zA-Z0-9]*}}:
unreachable
handler:
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @baz to i8*)
+ %tmp = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } undef
}
; PR1224
declare i32 @test()
-define i32 @test2() {
+define i32 @test2() personality i32 (...)* @__gxx_personality_v0 {
%A = invoke i32 @test() to label %invcont unwind label %blat
invcont:
ret i32 %A
blat:
- %lpad = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpad = landingpad { i8*, i32 }
cleanup
ret i32 0
}
%"struct.std::locale::facet" = type { i32 (...)**, i32 }
%"struct.std::string" = type { %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider" }
-define void @_ZNKSt6locale4nameEv(%"struct.std::string"* %agg.result) {
+define void @_ZNKSt6locale4nameEv(%"struct.std::string"* %agg.result) personality i32 (...)* @__gxx_personality_v0 {
entry:
%tmp105 = icmp eq i8* null, null ; <i1> [#uses=1]
br i1 %tmp105, label %cond_true, label %cond_true222
ret void
cond_true1402: ; preds = %invcont282, %cond_false280, %cond_true235, %cond_true
- %lpad = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpad = landingpad { i8*, i32 }
cleanup
ret void
}
; RUN: llc -no-integrated-as < %s
-define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() {
+define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void asm "rdtsc\0A\09movl %eax, $0\0A\09movl %edx, $1", "=*imr,=*imr,~{dirflag},~{fpsr},~{flags},~{dx},~{ax}"( i32* null, i32* null )
to label %.noexc unwind label %cleanup144
ret void
cleanup144: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
resume { i8*, i32 } %exn
}
%struct.__type_info_pseudo = type { i8*, i8* }
@_ZTI2e1 = external constant %struct.__class_type_info_pseudo ; <%struct.__class_type_info_pseudo*> [#uses=1]
-define void @_Z7ex_testv() {
+define void @_Z7ex_testv() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @__cxa_throw( i8* null, i8* bitcast (%struct.__class_type_info_pseudo* @_ZTI2e1 to i8*), void (i8*)* null ) noreturn
to label %UnifiedUnreachableBlock unwind label %lpad
unreachable
lpad: ; preds = %entry
- %lpad1 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpad1 = landingpad { i8*, i32 }
catch i8* null
invoke void @__cxa_end_catch( )
to label %bb14 unwind label %lpad17
lpad17: ; preds = %lpad
- %lpad2 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpad2 = landingpad { i8*, i32 }
catch i8* null
unreachable
declare %"struct.std::ctype<char>"* @_ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale(%"struct.std::locale"*)
-define %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(%"struct.std::basic_istream<char,std::char_traits<char> >"* %__in, i8* nocapture %__s) {
+define %"struct.std::basic_istream<char,std::char_traits<char> >"* @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(%"struct.std::basic_istream<char,std::char_traits<char> >"* %__in, i8* nocapture %__s) personality i32 (...)* @__gxx_personality_v0 {
entry:
%0 = invoke %"struct.std::ctype<char>"* @_ZSt9use_facetISt5ctypeIcEERKT_RKSt6locale(%"struct.std::locale"* undef)
to label %invcont8 unwind label %lpad74 ; <%"struct.std::ctype<char>"*> [#uses=0]
lpad: ; preds = %bb.i93, %invcont24, %bb1.i, %invcont8
%__extracted.1 = phi i32 [ 0, %invcont8 ], [ %2, %bb1.i ], [ undef, %bb.i93 ], [ undef, %invcont24 ] ; <i32> [#uses=0]
- %lpad1 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpad1 = landingpad { i8*, i32 }
catch i8* null
%eh_ptr = extractvalue { i8*, i32 } %lpad1, 0
%6 = call i8* @__cxa_begin_catch(i8* %eh_ptr) nounwind ; <i8*> [#uses=0]
unreachable
lpad74: ; preds = %entry
- %lpad2 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpad2 = landingpad { i8*, i32 }
cleanup
unreachable
}
declare void @llvm.donothing() readnone
; CHECK: f1
-define void @f1() nounwind uwtable ssp {
+define void @f1() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK-NOT: donothing
invoke void @llvm.donothing()
ret void
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%1 = extractvalue { i8*, i32 } %0, 0
tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind
; PR10733
declare void @_Znam()
-define void @_ZNK14gIndexOdometer15AfterExcisionOfERi() uwtable align 2 {
+define void @_ZNK14gIndexOdometer15AfterExcisionOfERi() uwtable align 2 personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
_ZN6Gambit5ArrayIiEC2Ej.exit36:
br label %"9"
lpad27: ; preds = %"10", %"9"
%0 = phi i32 [ undef, %"9" ], [ %tmp, %"10" ]
- %1 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %1 = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } zeroinitializer
}
; XFAIL: hexagon
declare { i64, double } @wild()
-define void @foo(i64* %p, double* %q) nounwind {
+define void @foo(i64* %p, double* %q) nounwind personality i32 (...)* @__gxx_personality_v0 {
%t = invoke { i64, double } @wild() to label %normal unwind label %handler
normal:
ret void
handler:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
ret void
}
@g1 = global double 0.000000e+00, align 8
@_ZTId = external constant i8*
-define void @_Z1fd(double %i2) {
+define void @_Z1fd(double %i2) personality i32 (...)* @__gxx_personality_v0 {
entry:
; CHECK-EL: addiu $sp, $sp
; CHECK-EL: .cfi_def_cfa_offset
; CHECK-EL: # %lpad
; CHECK-EL: bne $5
- %exn.val = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %exn.val = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTId to i8*)
%exn = extractvalue { i8*, i32 } %exn.val, 0
@_ZTISt9exception = external constant i8*
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; ALL: .cfi_startproc
; ALL: .cfi_personality 128, DW.ref.__gxx_personality_v0
; ALL: jalr
lpad:
- %0 = landingpad { i8*, i32 } personality i8*
- bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
catch i8* bitcast (i8** @_ZTISt9exception to i8*)
ret i32 0
declare i32 @foo(...)
declare void @bar()
-define void @main() {
+define void @main() personality i8* bitcast (i32 (...)* @foo to i8*) {
entry:
invoke void @bar() #0
to label %unreachable unwind label %return
unreachable
return:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @foo to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret void
}
@_ZTIi = external constant i8*
@.str1 = private unnamed_addr constant [15 x i8] c"exception %i \0A\00", align 1
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%retval = alloca i32, align 4
%exn.slot = alloca i8*
to label %unreachable unwind label %lpad
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%2 = extractvalue { i8*, i32 } %1, 0
store i8* %2, i8** %exn.slot
ret i32 0
lpad1: ; preds = %catch
- %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %8 = landingpad { i8*, i32 }
cleanup
%9 = extractvalue { i8*, i32 } %8, 0
store i8* %9, i8** %exn.slot
; CHECK: .cfi_endproc
-define void @Bork(i64 %range.0.0, i64 %range.0.1, i64 %size) {
+define void @Bork(i64 %range.0.0, i64 %range.0.1, i64 %size) personality i32 (...)* @__gxx_personality_v0 {
entry:
%effectiveRange = alloca %struct.Range, align 8 ; <%struct.Range*> [#uses=2]
%tmp4 = call i8* @llvm.stacksave() ; <i8*> [#uses=1]
br label %bb30
unwind: ; preds = %cond_true, %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
call void @llvm.stackrestore(i8* %tmp4)
resume { i8*, i32 } %exn
@.str28 = external unnamed_addr constant [7 x i8], align 1
@_ZN4Foam4PoutE = external global %"class.Foam::prefixOSstream.27", align 8
-define void @_ZN4Foam13checkTopologyERKNS_8polyMeshEbb(i1 zeroext %allTopology) #0 {
+define void @_ZN4Foam13checkTopologyERKNS_8polyMeshEbb(i1 zeroext %allTopology) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
br i1 undef, label %for.body, label %for.cond.cleanup
to label %_ZN4Foam4wordC2EPKcb.exit unwind label %lpad.i
lpad.i: ; preds = %_ZNK4Foam8ZoneMeshINS_9pointZoneENS_8polyMeshEE15checkDefinitionEb.exit
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } %0
br i1 undef, label %if.then121, label %if.else
lpad: ; preds = %_ZN4Foam4wordC2EPKcb.exit
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
br i1 undef, label %_ZNSsD2Ev.exit1578, label %if.then.i.i1570, !prof !1
to label %_ZN4Foam4wordC2EPKcb.exit1701 unwind label %lpad.i1689
lpad.i1689: ; preds = %if.else
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
unreachable
unreachable
lpad165: ; preds = %_ZN4Foam4wordC2EPKcb.exit1701
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
unreachable
lpad175: ; preds = %invoke.cont169
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %4 = landingpad { i8*, i32 }
cleanup
invoke void @_ZN4Foam8pointSetD1Ev()
to label %eh.resume unwind label %terminate.lpad
to label %_ZN4Foam4wordC2EPKcb.exit1777 unwind label %lpad.i1765
lpad.i1765: ; preds = %if.end213
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %5 = landingpad { i8*, i32 }
cleanup
br i1 undef, label %eh.resume.i1776, label %if.then.i.i.i1767, !prof !1
to label %invoke.cont243 unwind label %lpad230
lpad217: ; preds = %_ZN4Foam4wordC2EPKcb.exit1777
- %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %6 = landingpad { i8*, i32 }
cleanup
br label %eh.resume
lpad230: ; preds = %invoke.cont231, %_ZNSsD2Ev.exit1792
- %7 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %7 = landingpad { i8*, i32 }
cleanup
invoke void @_ZN4Foam7faceSetD1Ev()
to label %eh.resume unwind label %terminate.lpad
to label %_ZN4Foam4wordC2EPKcb.exit1862 unwind label %lpad.i1850
lpad.i1850: ; preds = %invoke.cont243
- %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %8 = landingpad { i8*, i32 }
cleanup
unreachable
unreachable
lpad276: ; preds = %_ZN4Foam4wordC2EPKcb.exit1862
- %9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %9 = landingpad { i8*, i32 }
cleanup
unreachable
to label %if.end878 unwind label %lpad663
lpad663: ; preds = %invoke.cont670, %if.end660, %invoke.cont668, %invoke.cont674, %invoke.cont676
- %10 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %10 = landingpad { i8*, i32 }
cleanup
br i1 undef, label %_ZN4Foam4ListIiED2Ev.exit.i3073, label %delete.notnull.i.i3071
to label %_ZN4Foam4wordC2EPKcb.exit3098 unwind label %lpad.i3086
lpad.i3086: ; preds = %if.else888
- %11 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %11 = landingpad { i8*, i32 }
cleanup
unreachable
unreachable
lpad898: ; preds = %_ZN4Foam4wordC2EPKcb.exit3098
- %12 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %12 = landingpad { i8*, i32 }
cleanup
br i1 undef, label %_ZNSsD2Ev.exit3204, label %if.then.i.i3196, !prof !1
unreachable
lpad905.loopexit.split-lp: ; preds = %call.i3116.noexc, %_ZNSsD2Ev.exit3113
- %lpad.loopexit.split-lp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %lpad.loopexit.split-lp = landingpad { i8*, i32 }
cleanup
invoke void @_ZN4Foam8pointSetD1Ev()
to label %eh.resume unwind label %terminate.lpad
resume { i8*, i32 } undef
terminate.lpad: ; preds = %_ZN4Foam4ListIiED2Ev.exit.i3073, %lpad230, %lpad175, %lpad905.loopexit.split-lp
- %13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %13 = landingpad { i8*, i32 }
catch i8* null
unreachable
}
%"class.boost::serialization::extended_type_info.129.150" = type { i32 (...)**, i32, i8* }
; Function Attrs: noinline
-define void @_ZN5boost13serialization18extended_type_info4findEPKc() #0 align 2 {
+define void @_ZN5boost13serialization18extended_type_info4findEPKc() #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
br i1 undef, label %cond.true, label %cond.false
br label %cleanup
lpad: ; preds = %cond.end
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
br label %eh.resume
declare i32 @__gxx_personality_v0(...)
; Function Attrs: optsize
-define void @_ZNSt3__117__assoc_sub_state4copyEv(%"class.std::__1::__assoc_sub_state"* %this) #0 align 2 {
+define void @_ZNSt3__117__assoc_sub_state4copyEv(%"class.std::__1::__assoc_sub_state"* %this) #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%__lk = alloca %"class.std::__1::unique_lock", align 8
%ref.tmp = alloca %"class.std::__exception_ptr::exception_ptr", align 8
unreachable
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
%2 = extractvalue { i8*, i32 } %1, 0
%3 = extractvalue { i8*, i32 } %1, 1
br label %ehcleanup
lpad3: ; preds = %if.then
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %4 = landingpad { i8*, i32 }
cleanup
%5 = extractvalue { i8*, i32 } %4, 0
%6 = extractvalue { i8*, i32 } %4, 1
; Function Attrs: inlinehint
declare void @_ZN4Foam8fileName12stripInvalidEv() #2 align 2
-define void @_ZN4Foam3CSVINS_6VectorIdEEE4readEv() #0 align 2 {
+define void @_ZN4Foam3CSVINS_6VectorIdEEE4readEv() #0 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_ZN4Foam6string6expandEb()
to label %invoke.cont unwind label %lpad
to label %invoke.cont2 unwind label %lpad.i
lpad.i: ; preds = %_ZN4Foam6stringC2ERKS0_.exit.i
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup142
to label %if.end unwind label %lpad5
lpad: ; preds = %if.then.i.i.i.i176, %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup142
lpad3: ; preds = %invoke.cont2
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup142
lpad5: ; preds = %memptr.end.i, %invoke.cont8, %if.then
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup142
unreachable
lpad.i.i.i: ; preds = %.noexc205
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %4 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup142
lpad19: ; preds = %for.body
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %5 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup142
declare i32 @__gxx_personality_v0(...)
-define void @_Z11GetPasswordP13CStdOutStreamb() {
+define void @_Z11GetPasswordP13CStdOutStreamb() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
br label %for.cond.i.i
br label %for.cond.i.i30
lpad: ; preds = %invoke.cont4, %invoke.cont, %_ZN11CStringBaseIcEC2EPKc.exit.critedge
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } undef
}
; V9PIC: .L_ZTIi.DW.stub:
; V9PIC-NEXT: .xword _ZTIi
-define i32 @main(i32 %argc, i8** nocapture readnone %argv) unnamed_addr #0 {
+define i32 @main(i32 %argc, i8** nocapture readnone %argv) unnamed_addr #0 personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
entry:
%0 = icmp eq i32 %argc, 2
%1 = tail call i8* @__cxa_allocate_exception(i32 4) #1
ret i32 %6
"8": ; preds = %"4", %"3"
- %exc = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %exc = landingpad { i8*, i32 }
catch %struct.__fundamental_type_info_pseudo* @_ZTIi
catch %struct.__fundamental_type_info_pseudo* @_ZTIf
%exc_ptr12 = extractvalue { i8*, i32 } %exc, 0
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
target triple = "thumbv7-apple-ios"
-define i8* @foo(<4 x i32> %c) {
+define i8* @foo(<4 x i32> %c) personality i8* bitcast (i32 (...)* @baz to i8*) {
entry:
invoke void @bar ()
to label %unreachable unwind label %handler
unreachable
handler:
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @baz to i8*)
+ %tmp = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } undef
}
declare %class.btMatrix3x3* @_ZN11btTransform8getBasisEv(%class.btTransform*) nounwind inlinehint ssp align 2
-define %class.RagDoll* @_ZN7RagDollC2EP15btDynamicsWorldRK9btVector3f(%class.RagDoll* %this, %class.btDynamicsWorld* %ownerWorld, %class.btVector3* %positionOffset, float %scale) unnamed_addr ssp align 2 {
+define %class.RagDoll* @_ZN7RagDollC2EP15btDynamicsWorldRK9btVector3f(%class.RagDoll* %this, %class.btDynamicsWorld* %ownerWorld, %class.btVector3* %positionOffset, float %scale) unnamed_addr ssp align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%retval = alloca %class.RagDoll*, align 4
%this.addr = alloca %class.RagDoll*, align 4
br label %for.cond
lpad: ; preds = %entry
- %67 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %67 = landingpad { i8*, i32 }
cleanup
%68 = extractvalue { i8*, i32 } %67, 0
store i8* %68, i8** %exn.slot
br label %eh.resume
lpad8: ; preds = %invoke.cont
- %70 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %70 = landingpad { i8*, i32 }
cleanup
%71 = extractvalue { i8*, i32 } %70, 0
store i8* %71, i8** %exn.slot
br label %eh.resume
lpad17: ; preds = %invoke.cont9
- %73 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %73 = landingpad { i8*, i32 }
cleanup
%74 = extractvalue { i8*, i32 } %73, 0
store i8* %74, i8** %exn.slot
br label %eh.resume
lpad26: ; preds = %invoke.cont18
- %76 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %76 = landingpad { i8*, i32 }
cleanup
%77 = extractvalue { i8*, i32 } %76, 0
store i8* %77, i8** %exn.slot
br label %eh.resume
lpad35: ; preds = %invoke.cont27
- %79 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %79 = landingpad { i8*, i32 }
cleanup
%80 = extractvalue { i8*, i32 } %79, 0
store i8* %80, i8** %exn.slot
br label %eh.resume
lpad44: ; preds = %invoke.cont36
- %82 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %82 = landingpad { i8*, i32 }
cleanup
%83 = extractvalue { i8*, i32 } %82, 0
store i8* %83, i8** %exn.slot
br label %eh.resume
lpad53: ; preds = %invoke.cont45
- %85 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %85 = landingpad { i8*, i32 }
cleanup
%86 = extractvalue { i8*, i32 } %85, 0
store i8* %86, i8** %exn.slot
br label %eh.resume
lpad62: ; preds = %invoke.cont54
- %88 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %88 = landingpad { i8*, i32 }
cleanup
%89 = extractvalue { i8*, i32 } %88, 0
store i8* %89, i8** %exn.slot
br label %eh.resume
lpad71: ; preds = %invoke.cont63
- %91 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %91 = landingpad { i8*, i32 }
cleanup
%92 = extractvalue { i8*, i32 } %91, 0
store i8* %92, i8** %exn.slot
br label %eh.resume
lpad80: ; preds = %invoke.cont72
- %94 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %94 = landingpad { i8*, i32 }
cleanup
%95 = extractvalue { i8*, i32 } %94, 0
store i8* %95, i8** %exn.slot
br label %eh.resume
lpad89: ; preds = %invoke.cont81
- %97 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %97 = landingpad { i8*, i32 }
cleanup
%98 = extractvalue { i8*, i32 } %97, 0
store i8* %98, i8** %exn.slot
ret %class.RagDoll* %200
lpad258: ; preds = %for.end
- %201 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %201 = landingpad { i8*, i32 }
cleanup
%202 = extractvalue { i8*, i32 } %201, 0
store i8* %202, i8** %exn.slot
br label %eh.resume
lpad284: ; preds = %invoke.cont259
- %204 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %204 = landingpad { i8*, i32 }
cleanup
%205 = extractvalue { i8*, i32 } %204, 0
store i8* %205, i8** %exn.slot
br label %eh.resume
lpad313: ; preds = %invoke.cont285
- %207 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %207 = landingpad { i8*, i32 }
cleanup
%208 = extractvalue { i8*, i32 } %207, 0
store i8* %208, i8** %exn.slot
br label %eh.resume
lpad342: ; preds = %invoke.cont314
- %210 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %210 = landingpad { i8*, i32 }
cleanup
%211 = extractvalue { i8*, i32 } %210, 0
store i8* %211, i8** %exn.slot
br label %eh.resume
lpad371: ; preds = %invoke.cont343
- %213 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %213 = landingpad { i8*, i32 }
cleanup
%214 = extractvalue { i8*, i32 } %213, 0
store i8* %214, i8** %exn.slot
br label %eh.resume
lpad400: ; preds = %invoke.cont372
- %216 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %216 = landingpad { i8*, i32 }
cleanup
%217 = extractvalue { i8*, i32 } %216, 0
store i8* %217, i8** %exn.slot
br label %eh.resume
lpad429: ; preds = %invoke.cont401
- %219 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %219 = landingpad { i8*, i32 }
cleanup
%220 = extractvalue { i8*, i32 } %219, 0
store i8* %220, i8** %exn.slot
br label %eh.resume
lpad458: ; preds = %invoke.cont430
- %222 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %222 = landingpad { i8*, i32 }
cleanup
%223 = extractvalue { i8*, i32 } %222, 0
store i8* %223, i8** %exn.slot
br label %eh.resume
lpad487: ; preds = %invoke.cont459
- %225 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %225 = landingpad { i8*, i32 }
cleanup
%226 = extractvalue { i8*, i32 } %225, 0
store i8* %226, i8** %exn.slot
br label %eh.resume
lpad516: ; preds = %invoke.cont488
- %228 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %228 = landingpad { i8*, i32 }
cleanup
%229 = extractvalue { i8*, i32 } %228, 0
store i8* %229, i8** %exn.slot
resume { i8*, i32 } %lpad.val526
terminate.lpad: ; preds = %lpad89, %lpad80, %lpad71, %lpad62, %lpad53, %lpad44, %lpad35, %lpad26, %lpad17, %lpad8, %lpad
- %231 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %231 = landingpad { i8*, i32 }
catch i8* null
call void @_ZSt9terminatev() noreturn nounwind
unreachable
@llvm.eh.handlertype.H.0 = private unnamed_addr constant %eh.CatchHandlerType { i32 0, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) }, section "llvm.metadata"
; Function Attrs: uwtable
-define void @sink_alloca_to_catch() #0 {
+define void @sink_alloca_to_catch() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%0 = alloca i32
%only_used_in_catch = alloca i32, align 4
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %1 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
%2 = extractvalue { i8*, i32 } %1, 1
%3 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)) #3
declare void @use_catch_var(i32*) #1
; Function Attrs: uwtable
-define void @dont_sink_alloca_to_catch(i32 %n) #0 {
+define void @dont_sink_alloca_to_catch(i32 %n) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%0 = alloca i32
%n.addr = alloca i32, align 4
br label %try.cont
lpad: ; preds = %while.body
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
%3 = extractvalue { i8*, i32 } %2, 0
store i8* %3, i8** %exn.slot
br label %while.cond
lpad1: ; preds = %catch
- %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %8 = landingpad { i8*, i32 }
cleanup
%9 = extractvalue { i8*, i32 } %8, 0
store i8* %9, i8** %exn.slot
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
; Function Attrs: uwtable
-define void @_Z4testv() #0 {
+define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %try.cont
; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* null
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @_Z4testv.catch)
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont]
lpad: ; preds = %entry
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %tmp = landingpad { i8*, i32 }
catch i8* null
%tmp1 = extractvalue { i8*, i32 } %tmp, 0
store i8* %tmp1, i8** %exn.slot
; CHECK: }
; Function Attrs: uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%o = alloca %class.Obj, align 1
%tmp = alloca i32, align 4
to label %unreachable unwind label %lpad
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* null
%2 = extractvalue { i8*, i32 } %1, 0
store i8* %2, i8** %exn.slot
to label %unreachable unwind label %lpad1
lpad1: ; preds = %catch
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %4 = landingpad { i8*, i32 }
cleanup
%5 = extractvalue { i8*, i32 } %4, 0
store i8* %5, i8** %exn.slot
; CHECK: [[SPLIT_LABEL]]
;
; CHECK: [[LPAD_LABEL]]
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK: cleanup
; CHECK: unreachable
; CHECK: }
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
; Function Attrs: uwtable
-define void @_Z4testv() #0 {
+define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %try.cont
; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i8** @_ZTIi to i8*), i32 0, i8* (i8*, i8*)* @_Z4testv.catch)
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont]
lpad: ; preds = %entry
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %tmp = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%tmp1 = extractvalue { i8*, i32 } %tmp, 0
store i8* %tmp1, i8** %exn.slot
@"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
-; CHECK-LABEL: define void @"\01?test@@YAXXZ"() #0 {
+; CHECK-LABEL: define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK: entry:
; CHECK: [[OBJ_PTR:\%.+]] = alloca %class.SomeClass
; CHECK: [[TMP0:\%.+]] = alloca i32, align 4
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
; Function Attrs: uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%obj = alloca %class.SomeClass, align 1
%0 = alloca i32, align 4
to label %try.cont unwind label %lpad3
; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: [[LPAD_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: [[LPAD_VAL:\%.+]] = landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch")
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont15]
lpad: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
%3 = extractvalue { i8*, i32 } %2, 0
%4 = extractvalue { i8*, i32 } %2, 1
br label %catch.dispatch7
; CHECK: [[LPAD1_LABEL]]:{{[ ]+}}; preds = %invoke.cont
-; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK-NEXT: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test@@YAXXZ.cleanup", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch")
; CHECK-NEXT: indirectbr i8* [[RECOVER1]], [label %try.cont15]
lpad1: ; preds = %invoke.cont
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %5 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
%6 = extractvalue { i8*, i32 } %5, 0
br label %ehcleanup
; CHECK: [[LPAD3_LABEL]]:{{[ ]+}}; preds = %invoke.cont2
-; CHECK: [[LPAD3_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: [[LPAD3_VAL:\%.+]] = landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK-NEXT: [[RECOVER3:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1", i32 0, void (i8*, i8*)* @"\01?test@@YAXXZ.cleanup")
; CHECK-NEXT: indirectbr i8* [[RECOVER3]], [label %try.cont, label %try.cont15]
lpad3: ; preds = %invoke.cont2
- %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %8 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
%9 = extractvalue { i8*, i32 } %8, 0
; CHECK-NOT: lpad5:
lpad5: ; preds = %catch
- %13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %13 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
%14 = extractvalue { i8*, i32 } %13, 0
; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont)
;
; CHECK: [[LPAD5_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: [[LPAD5_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: [[LPAD5_VAL:\%.+]] = landingpad { i8*, i32 }
; CHECK: cleanup
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK: }
@"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
@llvm.eh.handlertype.H.0 = private unnamed_addr constant %eh.CatchHandlerType { i32 0, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) }, section "llvm.metadata"
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%o = alloca %struct.HasDtor, align 1
invoke void @may_throw()
br label %try.cont
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
%1 = extractvalue { i8*, i32 } %0, 0
%2 = extractvalue { i8*, i32 } %0, 1
br label %catch.dispatch
lpad1: ; preds = %invoke.cont
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
%4 = extractvalue { i8*, i32 } %3, 0
@typeinfo.int = external global i32
-define i32 @liveout_catch(i32 %p) {
+define i32 @liveout_catch(i32 %p) personality i32 (...)* @__CxxFrameHandler3 {
entry:
%val.entry = add i32 %p, 1
invoke void @might_throw()
to label %ret unwind label %lpad
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__CxxFrameHandler3
+ %ehvals = landingpad { i8*, i32 }
cleanup
catch i32* @typeinfo.int
%ehptr = extractvalue { i8*, i32 } %ehvals, 0
; CHECK: br label %for.cond
; Function Attrs: uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%NumExceptions = alloca i32, align 4
%ExceptionVal = alloca [10 x i32], align 16
br label %try.cont
; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %for.body
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch")
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont]
lpad: ; preds = %for.body
- %tmp4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %tmp4 = landingpad { i8*, i32 }
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
%tmp5 = extractvalue { i8*, i32 } %tmp4, 0
store i8* %tmp5, i8** %exn.slot
; CHECK: invoke void @"\01?may_throw@@YAXXZ"()
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
-define i32 @"\01?test@@YAHUA@@@Z"(<{ %struct.A }>* inalloca) #0 {
+define i32 @"\01?test@@YAHUA@@@Z"(<{ %struct.A }>* inalloca) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%retval = alloca i32, align 4
%exn.slot = alloca i8*
br label %try.cont
; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK-NEXT: [[RECOVER:\%recover.*]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAHUA@@@Z.catch", i32 0, void (i8*, i8*)* @"\01?test@@YAHUA@@@Z.cleanup")
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %cleanup]
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
%2 = extractvalue { i8*, i32 } %1, 0
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
; Function Attrs: uwtable
-define void @_Z4testv() #0 {
+define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%obj = alloca %class.SomeClass, align 4
%exn.slot = alloca i8*
ret void
; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @_Z4testv.cleanup)
; CHECK-NEXT: indirectbr i8* [[RECOVER]], []
lpad: ; preds = %entry
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %tmp = landingpad { i8*, i32 }
cleanup
%tmp1 = extractvalue { i8*, i32 } %tmp, 0
store i8* %tmp1, i8** %exn.slot
; CHECK: }
; Function Attrs: nounwind uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%o = alloca %class.Obj, align 1
%exn.slot = alloca i8*
br label %try.cont
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
store i8* %1, i8** %exn.slot
@"llvm.eh.handlermapentry.reference.?AVSomeClass@@" = private unnamed_addr constant %eh.HandlerMapEntry { i32 8, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%rtti.TypeDescriptor15* @"\01??_R0?AVSomeClass@@@8" to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, section "llvm.metadata"
-; CHECK: define void @"\01?test@@YAXXZ"() #0 {
+; CHECK: define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK: entry:
; CHECK: [[OBJ_PTR:\%.+]] = alloca %class.SomeClass*, align 8
; CHECK: [[LL_PTR:\%.+]] = alloca i64, align 8
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
; Function Attrs: uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %try.cont
; CHECK: [[LPAD_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: catch %eh.HandlerMapEntry* @llvm.eh.handlermapentry.H
; CHECK-NEXT: catch %eh.HandlerMapEntry* @llvm.eh.handlermapentry._J
; CHECK-NEXT: catch %eh.HandlerMapEntry* @"llvm.eh.handlermapentry.reference.?AVSomeClass@@"
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %ret]
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch %eh.HandlerMapEntry* @llvm.eh.handlermapentry.H
catch %eh.HandlerMapEntry* @llvm.eh.handlermapentry._J
catch %eh.HandlerMapEntry* @"llvm.eh.handlermapentry.reference.?AVSomeClass@@"
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
; Function Attrs: uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %try.cont
; CHECK: [[LPAD_LABEL]]:
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
; CHECK: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch")
; CHECK: indirectbr i8* [[RECOVER]], [label %try.cont, label %try.cont10]
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
%1 = extractvalue { i8*, i32 } %0, 0
; CHECK-NOT: lpad1:
lpad1: ; preds = %catch
- %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %6 = landingpad { i8*, i32 }
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
%7 = extractvalue { i8*, i32 } %6, 0
store i8* %7, i8** %exn.slot
; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont)
;
; CHECK: [[LPAD1_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 }
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
; CHECK: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch")
; CHECK: indirectbr i8* [[RECOVER1]], []
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
; Function Attrs: uwtable
-define void @_Z4testv() #0 {
+define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%outer = alloca %class.Outer, align 1
%exn.slot = alloca i8*
br label %try.cont
; CHECK: [[LPAD_LABEL]]:
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIf to i8*)
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i8** @_ZTIf to i8*), i32 0, i8* (i8*, i8*)* @_Z4testv.catch)
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont19]
lpad: ; preds = %try.cont, %entry
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %tmp = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIf to i8*)
%tmp1 = extractvalue { i8*, i32 } %tmp, 0
store i8* %tmp1, i8** %exn.slot
br label %catch.dispatch11
; CHECK: [[LPAD1_LABEL]]:
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIf to i8*)
; CHECK-NEXT: indirectbr i8* [[RECOVER1]], [label %try.cont, label %try.cont19]
lpad1: ; preds = %invoke.cont4, %invoke.cont
- %tmp3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %tmp3 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTIi to i8*)
catch i8* bitcast (i8** @_ZTIf to i8*)
br label %catch.dispatch
; CHECK: [[LPAD3_LABEL]]:
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIf to i8*)
; CHECK-NEXT: indirectbr i8* [[RECOVER3]], [label %try.cont, label %try.cont19]
lpad3: ; preds = %invoke.cont2
- %tmp6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %tmp6 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTIi to i8*)
catch i8* bitcast (i8** @_ZTIf to i8*)
; CHECK-NOT: lpad7:
lpad7: ; preds = %catch
- %tmp14 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %tmp14 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTIf to i8*)
%tmp15 = extractvalue { i8*, i32 } %tmp14, 0
; CHECK: ret i8* blockaddress(@_Z4testv, %try.cont)
;
; CHECK: [[LPAD7_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: [[LPAD7_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: [[LPAD7_VAL:\%.+]] = landingpad { i8*, i32 }
; (FIXME) The nested handler body isn't being populated yet.
; CHECK: }
; CHECK: to label %invoke.cont unwind label %[[LPAD_LABEL:lpad[0-9]*]]
; Function Attrs: uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %try.cont10
; CHECK: [[LPAD_LABEL]]:
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
; CHECK: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.2", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1")
; CHECK: indirectbr i8* [[RECOVER]], [label %try.cont10, label %try.cont19]
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
%1 = extractvalue { i8*, i32 } %0, 0
; CHECK-NOT: lpad1:
lpad1: ; preds = %catch
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %5 = landingpad { i8*, i32 }
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
%6 = extractvalue { i8*, i32 } %5, 0
; CHECK-NOT: lpad8:
lpad8: ; preds = %try.cont
- %12 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %12 = landingpad { i8*, i32 }
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
%13 = extractvalue { i8*, i32 } %12, 0
store i8* %13, i8** %exn.slot
; CHECK: to label %invoke.cont9 unwind label %[[LPAD8_LABEL:lpad[0-9]*]]
;
; CHECK: [[LPAD1_LABEL]]:{{[ ]+}}; preds = %entry
-; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: [[LPAD1_VAL:\%.+]] = landingpad { i8*, i32 }
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
; CHECK: [[RECOVER1:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch", i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1")
; CHECK: ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont10)
;
; CHECK: [[LPAD8_LABEL]]:{{[ ]+}}; preds = %invoke.cont2
-; CHECK: [[LPAD8_VAL:\%.+]] = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: [[LPAD8_VAL:\%.+]] = landingpad { i8*, i32 }
; CHECK: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*)
; CHECK: [[RECOVER2:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0M@8" to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch.1")
; CHECK: indirectbr i8* [[RECOVER2]], []
; CHECK: call void (...) @llvm.frameescape
; Function Attrs: nounwind uwtable
-define void @"\01?test1@@YAXXZ"() #0 {
+define void @"\01?test1@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%tmp = alloca i32, align 4
%exn.slot = alloca i8*
to label %unreachable unwind label %lpad
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* null
%2 = extractvalue { i8*, i32 } %1, 0
store i8* %2, i8** %exn.slot
to label %unreachable unwind label %lpad1
lpad1: ; preds = %catch
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %4 = landingpad { i8*, i32 }
catch i8* null
%5 = extractvalue { i8*, i32 } %4, 0
store i8* %5, i8** %exn.slot
; CHECK: call void (...) @llvm.frameescape
; Function Attrs: nounwind uwtable
-define void @"\01?test2@@YAXXZ"() #0 {
+define void @"\01?test2@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%tmp = alloca i32, align 4
%exn.slot = alloca i8*
to label %unreachable unwind label %lpad
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* null
%2 = extractvalue { i8*, i32 } %1, 0
store i8* %2, i8** %exn.slot
to label %unreachable unwind label %lpad1
lpad1: ; preds = %catch
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %4 = landingpad { i8*, i32 }
catch i8* null
%5 = extractvalue { i8*, i32 } %4, 0
store i8* %5, i8** %exn.slot
; CHECK: br label %for.body
; Function Attrs: uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%e = alloca i32, align 4
%ExceptionVal = alloca [10 x i32], align 16
br label %try.cont
; CHECK: [[LPAD_LABEL:lpad[0-9]*]]:{{[ ]+}}; preds = %for.body
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*), i32 0, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch")
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %[[SPLIT_RECOVER_BB:.*]]]
lpad: ; preds = %for.body
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
catch i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)
%3 = extractvalue { i8*, i32 } %2, 1
%4 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*)) #1
declare void @llvm.eh.endcatch() #2
; Function Attrs: nounwind uwtable
-define void @test_catch_all() #0 {
+define void @test_catch_all() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
invoke void @may_throw()
to label %try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
tail call void @llvm.eh.begincatch(i8* %1, i8* null) #2
declare void @_CxxThrowException(i8*, %eh.ThrowInfo*)
; Function Attrs: uwtable
-define i32 @main() #1 {
+define i32 @main() #1 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%tmp.i = alloca i32, align 4
%e = alloca i32, align 4
unreachable
lpad1: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %1 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
%recover = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*), i32 0, i8* (i8*, i8*)* @main.catch)
indirectbr i8* %recover, [label %try.cont.split]
; Function Attrs: nounwind
declare i8* @llvm.eh.actions(...) #3
-define internal i8* @main.catch(i8*, i8*) #5 {
+define internal i8* @main.catch(i8*, i8*) #5 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%e.i8 = call i8* @llvm.framerecover(i8* bitcast (i32 ()* @main to i8*), i8* %1, i32 0)
%e = bitcast i8* %e.i8 to i32*
ret i8* blockaddress(@main, %try.cont.split)
stub: ; preds = %entry
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %4 = landingpad { i8*, i32 }
cleanup
%recover = call i8* (...) @llvm.eh.actions()
unreachable
@"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
@llvm.eh.handlertype.H.8 = private unnamed_addr constant %eh.CatchHandlerType { i32 8, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) }, section "llvm.metadata"
-define internal i8* @"\01?f@@YAXXZ.catch"(i8*, i8*) #4 {
+define internal i8* @"\01?f@@YAXXZ.catch"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?f@@YAXXZ" to i8*), i8* %1, i32 0)
%bc2 = bitcast i8* %.i8 to i32**
ret i8* blockaddress(@"\01?f@@YAXXZ", %try.cont)
lpad1: ; preds = %entry
- %lp4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %lp4 = landingpad { i8*, i32 }
cleanup
catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0
%recover = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1")
; CHECK: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
-define internal i8* @"\01?f@@YAXXZ.catch1"(i8*, i8*) #4 {
+define internal i8* @"\01?f@@YAXXZ.catch1"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?f@@YAXXZ" to i8*), i8* %1, i32 1)
%2 = bitcast i8* %.i8 to double*
ret i8* blockaddress(@"\01?f@@YAXXZ", %try.cont8)
lpad: ; preds = %entry
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %4 = landingpad { i8*, i32 }
cleanup
%recover = call i8* (...) @llvm.eh.actions()
unreachable
; CHECK: .seh_handlerdata
; CHECK: .long ("$cppxdata$?f@@YAXXZ")@IMGREL
-define void @"\01?f@@YAXXZ"() #0 {
+define void @"\01?f@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %try.cont
lpad2: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.8
catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0
%recover = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.8 to i8*), i32 0, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch", i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1")
to label %try.cont8 unwind label %lpad1
lpad1:
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %3 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.N.0
%recover2 = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.N.0 to i8*), i32 1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch1")
indirectbr i8* %recover2, [label %try.cont8]
; CHECK-NEXT: .long .Ltmp0@IMGREL
; CHECK-NEXT: .long 0
-define void @"\01?test1@@YAXXZ"() #0 {
+define void @"\01?test1@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%unwindhelp = alloca i64
%tmp = alloca i32, align 4
to label %unreachable unwind label %lpad1
lpad1: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
%recover = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test1@@YAXXZ.cleanup")
indirectbr i8* %recover, []
; CHECK-NEXT: .long .Ltmp12@IMGREL
; CHECK-NEXT: .long 0
-define void @"\01?test2@@YAX_N@Z"(i1 zeroext %b) #2 {
+define void @"\01?test2@@YAX_N@Z"(i1 zeroext %b) #2 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
%b.addr = alloca i8, align 1
%s = alloca %struct.S, align 1
%exn.slot = alloca i8*
br label %if.end
lpad1: ; preds = %entry, %if.end
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
%recover = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup")
indirectbr i8* %recover, []
lpad3: ; preds = %if.then
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
%recover4 = call i8* (...) @llvm.eh.actions(i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup1", i32 0, void (i8*, i8*)* @"\01?test2@@YAX_N@Z.cleanup")
indirectbr i8* %recover4, []
; Function Attrs: nounwind
declare void @llvm.eh.unwindhelp(i8*) #4
-define internal void @"\01?test2@@YAX_N@Z.cleanup"(i8*, i8*) #7 {
+define internal void @"\01?test2@@YAX_N@Z.cleanup"(i8*, i8*) #7 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%s.i8 = call i8* @llvm.framerecover(i8* bitcast (void (i1)* @"\01?test2@@YAX_N@Z" to i8*), i8* %1, i32 0)
%s = bitcast i8* %s.i8 to %struct.S*
ret void
stub: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
unreachable
}
-define internal void @"\01?test2@@YAX_N@Z.cleanup1"(i8*, i8*) #7 {
+define internal void @"\01?test2@@YAX_N@Z.cleanup1"(i8*, i8*) #7 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%s1.i8 = call i8* @llvm.framerecover(i8* bitcast (void (i1)* @"\01?test2@@YAX_N@Z" to i8*), i8* %1, i32 1)
%s1 = bitcast i8* %s1.i8 to %struct.S*
ret void
stub: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
unreachable
}
; CHECK: invoke void @"\01?g@@YAXXZ"()
; Function Attrs: nounwind
-define void @"\01?f@@YAXXZ"() #0 {
+define void @"\01?f@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
invoke void @"\01?g@@YAXXZ"()
to label %invoke.cont unwind label %lpad
to label %unreachable unwind label %lpad1
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
br label %catch2
; Note: Even though this landing pad has two catch clauses, it only has one action because both
; handlers do the same thing.
; CHECK: [[LPAD1_LABEL]]:
-; CHECK: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
; CHECK-NEXT: catch i8* null
; CHECK-NEXT: [[RECOVER:\%.+]] = call i8* (...) @llvm.eh.actions(i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @"\01?f@@YAXXZ.catch")
; CHECK-NEXT: indirectbr i8* [[RECOVER]], [label %try.cont4]
lpad1: ; preds = %invoke.cont
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
%3 = extractvalue { i8*, i32 } %2, 0
; CHECK: }
; Function Attrs: uwtable
-define i32 @main() #0 {
+define i32 @main() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%retval = alloca i32, align 4
%tmp = alloca i8, align 1
to label %unreachable unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
to label %unreachable unwind label %lpad4
lpad2: ; preds = %catch
- %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %6 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
%7 = extractvalue { i8*, i32 } %6, 0
br label %catch.dispatch5
lpad4: ; preds = %try.cont
- %9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %9 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
%10 = extractvalue { i8*, i32 } %9, 0
br label %try.cont19
lpad10: ; preds = %catch8
- %15 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %15 = landingpad { i8*, i32 }
cleanup
%16 = extractvalue { i8*, i32 } %15, 0
store i8* %16, i8** %exn.slot
br label %eh.resume
lpad16: ; preds = %catch13
- %18 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %18 = landingpad { i8*, i32 }
cleanup
%19 = extractvalue { i8*, i32 } %18, 0
store i8* %19, i8** %exn.slot
br label %eh.resume
lpad21: ; preds = %try.cont19
- %21 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %21 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*)
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
catch i8* null
to label %unreachable unwind label %lpad35
lpad30: ; preds = %catch25
- %27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %27 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*)
catch i8* null
br label %catch.dispatch36
lpad35: ; preds = %try.cont33
- %30 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %30 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.D.0 to i8*)
catch i8* null
br label %try.cont60
lpad42: ; preds = %catch40
- %38 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %38 = landingpad { i8*, i32 }
cleanup
%39 = extractvalue { i8*, i32 } %38, 0
store i8* %39, i8** %exn.slot
br label %eh.resume
lpad50: ; preds = %catch45
- %41 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %41 = landingpad { i8*, i32 }
cleanup
%42 = extractvalue { i8*, i32 } %41, 0
store i8* %42, i8** %exn.slot
br label %eh.resume
lpad57: ; preds = %catch53
- %44 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %44 = landingpad { i8*, i32 }
cleanup
%45 = extractvalue { i8*, i32 } %44, 0
store i8* %45, i8** %exn.slot
@_TI1D = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (%eh.CatchableTypeArray.1* @_CTA1D to i64), i64 ptrtoint (i8* @__ImageBase to i64)) to i32) }, section ".xdata", comdat
; Function Attrs: nounwind uwtable
-define void @"\01?test@@YAXXZ"() #0 {
+define void @"\01?test@@YAXXZ"() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%tmp = alloca i32, align 4
%x = alloca i32, align 4
to label %unreachable unwind label %lpad
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
to label %unreachable unwind label %lpad3
lpad3: ; preds = %try.cont
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.D.0
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
to label %unreachable unwind label %lpad12
lpad12: ; preds = %try.cont10
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %4 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
catch i8* null
%recover2 = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*), i32 2, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch2", i32 1, i8* null, i32 -1, i8* (i8*, i8*)* @"\01?test@@YAXXZ.catch3")
; Function Attrs: nounwind
declare i8* @llvm.eh.actions(...) #3
-define internal i8* @"\01?test@@YAXXZ.catch"(i8*, i8*) #4 {
+define internal i8* @"\01?test@@YAXXZ.catch"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%x.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 0)
%x = bitcast i8* %x.i8 to i32*
ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont)
stub: ; preds = %entry
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
%recover = call i8* (...) @llvm.eh.actions()
unreachable
; Function Attrs: nounwind readnone
declare void @llvm.donothing() #2
-define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*) #4 {
+define internal i8* @"\01?test@@YAXXZ.catch1"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
call void @"\01?catch_a@@YAXXZ"() #3
invoke void @llvm.donothing()
ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont10)
stub: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
%recover = call i8* (...) @llvm.eh.actions()
unreachable
}
-define internal i8* @"\01?test@@YAXXZ.catch2"(i8*, i8*) #4 {
+define internal i8* @"\01?test@@YAXXZ.catch2"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
%x21.i8 = call i8* @llvm.framerecover(i8* bitcast (void ()* @"\01?test@@YAXXZ" to i8*), i8* %1, i32 2)
%x21 = bitcast i8* %x21.i8 to i32*
ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont22)
stub: ; preds = %entry
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
%recover = call i8* (...) @llvm.eh.actions()
unreachable
}
-define internal i8* @"\01?test@@YAXXZ.catch3"(i8*, i8*) #4 {
+define internal i8* @"\01?test@@YAXXZ.catch3"(i8*, i8*) #4 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
call void @"\01?catch_all@@YAXXZ"() #3
invoke void @llvm.donothing()
ret i8* blockaddress(@"\01?test@@YAXXZ", %try.cont22)
stub: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
%recover = call i8* (...) @llvm.eh.actions()
unreachable
declare i8* @llvm.frameaddress(i32)
; Function Attrs: uwtable
-define void @seh_catch_all() {
+define void @seh_catch_all() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %__try.cont
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
store i8* %1, i8** %exn.slot
declare dllimport void @EnterCriticalSection(%struct._RTL_CRITICAL_SECTION*)
declare dllimport void @LeaveCriticalSection(%struct._RTL_CRITICAL_SECTION*)
-define void @use_finally() {
+define void @use_finally() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
invoke void @may_crash()
to label %invoke.cont unwind label %lpad
ret void
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
%call.i2 = tail call i32 @puts(i8* null)
resume { i8*, i32 } %0
; CHECK-NEXT: indirectbr i8* %recover, []
; Function Attrs: nounwind uwtable
-define i32 @call_may_crash_locked() {
+define i32 @call_may_crash_locked() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
%p = alloca %struct._RTL_CRITICAL_SECTION, align 8
call void (...) @llvm.frameescape(%struct._RTL_CRITICAL_SECTION* %p)
ret i32 42
lpad: ; preds = %entry
- %tmp7 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %tmp7 = landingpad { i8*, i32 }
cleanup
%tmp8 = call i8* @llvm.frameaddress(i32 0)
%tmp9 = call i8* @llvm.framerecover(i8* bitcast (i32 ()* @call_may_crash_locked to i8*), i8* %tmp8, i32 0)
}
; Function Attrs: uwtable
-define i32 @main() #1 {
+define i32 @main() #1 personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
%myres = alloca i32, align 4
%exn.slot = alloca i8*
ret i32 0
lpad: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
%3 = extractvalue { i8*, i32 } %2, 0
store i8* %3, i8** %exn.slot
to label %invoke.cont3 unwind label %lpad1
lpad1: ; preds = %lpad, %invoke.cont
- %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %6 = landingpad { i8*, i32 }
cleanup
%7 = extractvalue { i8*, i32 } %6, 0
store i8* %7, i8** %exn.slot
target triple = "x86_64-pc-windows-msvc"
; Function Attrs: uwtable
-define void @do_except() #0 {
+define void @do_except() #0 personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
call void (...) @llvm.frameescape()
invoke void @g() #5
to label %__try.cont unwind label %lpad1
lpad1: ; preds = %entry
- %ehvals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %ehvals = landingpad { i8*, i32 }
catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@do_except@@" to i8*)
%recover = call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@do_except@@" to i8*), i32 -1, i8* blockaddress(@do_except, %__try.cont))
indirectbr i8* %recover, [label %__try.cont]
declare i32 @__C_specific_handler(...)
declare i32 @llvm.eh.typeid.for(i8*)
-define void @resume_phi() {
+define void @resume_phi() personality i32 (...)* @__C_specific_handler {
entry:
invoke void @might_crash(i8* null)
to label %return unwind label %lpad1
lpad1:
- %ehvals1 = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %ehvals1 = landingpad { i8*, i32 }
catch i32 ()* @filt
%ehptr1 = extractvalue { i8*, i32 } %ehvals1, 0
%ehsel1 = extractvalue { i8*, i32 } %ehvals1, 1
to label %return unwind label %lpad2
lpad2:
- %ehvals2 = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %ehvals2 = landingpad { i8*, i32 }
cleanup
%ehptr2 = extractvalue { i8*, i32 } %ehvals2, 0
%ehsel2 = extractvalue { i8*, i32 } %ehvals2, 1
declare i32 @__C_specific_handler(...)
declare i32 @llvm.eh.typeid.for(i8*)
-define i32 @simple_except_store() {
+define i32 @simple_except_store() personality i32 (...)* @__C_specific_handler {
entry:
%retval = alloca i32
store i32 0, i32* %retval
to label %return unwind label %lpad
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %ehvals = landingpad { i8*, i32 }
catch i32 ()* @filt
%sel = extractvalue { i8*, i32 } %ehvals, 1
%filt_sel = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @filt to i8*))
; CHECK-NEXT: call i8* (...) @llvm.eh.actions(i32 1, i8* bitcast (i32 ()* @filt to i8*), i32 -1, i8* blockaddress(@simple_except_store, %__except))
; CHECK-NEXT: indirectbr {{.*}} [label %__except]
-define i32 @catch_all() {
+define i32 @catch_all() personality i32 (...)* @__C_specific_handler {
entry:
%retval = alloca i32
store i32 0, i32* %retval
to label %return unwind label %lpad
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %ehvals = landingpad { i8*, i32 }
catch i8* null
store i32 1, i32* %retval
br label %return
; CHECK: store i32 1, i32* %retval
-define i32 @except_phi() {
+define i32 @except_phi() personality i32 (...)* @__C_specific_handler {
entry:
invoke void @might_crash()
to label %return unwind label %lpad
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %ehvals = landingpad { i8*, i32 }
catch i32 ()* @filt
%sel = extractvalue { i8*, i32 } %ehvals, 1
%filt_sel = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @filt to i8*))
; CHECK-NEXT: %r = phi i32 [ 0, %entry ], [ 1, %lpad.return_crit_edge ]
; CHECK-NEXT: ret i32 %r
-define i32 @lpad_phi() {
+define i32 @lpad_phi() personality i32 (...)* @__C_specific_handler {
entry:
invoke void @might_crash()
to label %cont unwind label %lpad
lpad:
%ncalls.1 = phi i32 [ 0, %entry ], [ 1, %cont ]
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %ehvals = landingpad { i8*, i32 }
catch i32 ()* @filt
%sel = extractvalue { i8*, i32 } %ehvals, 1
%filt_sel = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @filt to i8*))
; CHECK-NEXT: %r = phi i32 [ 2, %cont ], [ %{{.*}}, %lpad.return_crit_edge ]
; CHECK-NEXT: ret i32 %r
-define i32 @cleanup_and_except() {
+define i32 @cleanup_and_except() personality i32 (...)* @__C_specific_handler {
entry:
invoke void @might_crash()
to label %return unwind label %lpad
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %ehvals = landingpad { i8*, i32 }
cleanup
catch i32 ()* @filt
call void @cleanup()
@error = external global i8
-define void @_ada_x() {
+define void @_ada_x() personality i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*) {
entry:
invoke void @raise()
to label %eh_then unwind label %unwind
unwind: ; preds = %entry
- %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*)
+ %eh_ptr = landingpad { i8*, i32 }
catch i8* @error
%eh_select = extractvalue { i8*, i32 } %eh_ptr, 1
%eh_typeid = tail call i32 @llvm.eh.typeid.for(i8* @error)
@.str33 = external constant [29 x i32] ; <[29 x i32]*> [#uses=1]
@.str89 = external constant [5 x i32] ; <[5 x i32]*> [#uses=1]
-define void @_ZNK10wxDateTime6FormatEPKwRKNS_8TimeZoneE(%struct.wxString* noalias sret %agg.result, %struct.wxDateTime* %this, i32* %format, %"struct.wxDateTime::TimeZone"* %tz, i1 %foo) {
+define void @_ZNK10wxDateTime6FormatEPKwRKNS_8TimeZoneE(%struct.wxString* noalias sret %agg.result, %struct.wxDateTime* %this, i32* %format, %"struct.wxDateTime::TimeZone"* %tz, i1 %foo) personality i32 (...)* @__gxx_personality_v0 {
entry:
br i1 %foo, label %bb116.i, label %bb115.critedge.i
bb115.critedge.i: ; preds = %entry
bb7834: ; preds = %bb7806, %invcont5831
br label %bb3261
lpad: ; preds = %bb7806, %bb5968, %invcont5814, %bb440.i8663, %bb155.i8541, %bb5657, %bb3306
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret void
lpad8185: ; preds = %invcont5831
- %exn8185 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn8185 = landingpad {i8*, i32}
cleanup
ret void
}
declare i8* @__cxa_begin_catch(i8*) nounwind
-define i32 @main(i32 %argc, i8** %argv) {
+define i32 @main(i32 %argc, i8** %argv) personality i32 (...)* @__gxx_personality_v0 {
entry:
br i1 false, label %bb37, label %bb34
unreachable
lpad243: ; preds = %bb37
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
%eh_ptr244 = extractvalue { i8*, i32 } %exn, 0
store i32 (...)** getelementptr ([5 x i32 (...)*], [5 x i32 (...)*]* @_ZTVN10Evaluation10GridOutputILi3EEE, i32 0, i32 2), i32 (...)*** null, align 8
declare i32 @g()
-define i32 @phi() {
+define i32 @phi() personality i32 (...)* @__gxx_personality_v0 {
entry:
%a = call i32 @f() ; <i32> [#uses=1]
%b = invoke i32 @g()
lpad: ; preds = %cont, %entry
%y = phi i32 [ %a, %entry ], [ %aa, %cont ] ; <i32> [#uses=1]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 %y
}
declare i32 @f()
-define i32 @phi(i32 %x) {
+define i32 @phi(i32 %x) personality i32 (...)* @__gxx_personality_v0 {
entry:
%a = invoke i32 @f()
to label %cont unwind label %lpad ; <i32> [#uses=1]
lpad: ; preds = %cont, %entry
%v = phi i32 [ %x, %entry ], [ %a, %cont ] ; <i32> [#uses=1]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 %v
}
%struct.ComplexType = type { i32 }
-define i32 @t(i32 %clientPort, i32 %pluginID, i32 %requestID, i32 %objectID, i64 %serverIdentifier, i64 %argumentsData, i32 %argumentsLength) ssp {
+define i32 @t(i32 %clientPort, i32 %pluginID, i32 %requestID, i32 %objectID, i64 %serverIdentifier, i64 %argumentsData, i32 %argumentsLength) ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
; CHECK: _t:
; CHECK: movl 16(%rbp),
ret i32 0
lpad: ; preds = %invcont1, %invcont, %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
%8 = call i32 @vm_deallocate(i32 undef, i64 0, i64 %0) ; <i32> [#uses=0]
unreachable
declare i32 @_Z17LoadObjectFromBERR8xmstreamPP10ASN1ObjectPPF10ASN1StatusP13ASN1ObjHeaderS3_E(%struct.xmstream*, %struct.ASN1Object**, i32 (%struct.ASN1ObjHeader*, %struct.ASN1Object**)**)
-define i32 @_ZN8ASN1Unit4loadER8xmstreamjm18ASN1LengthEncoding(%struct.ASN1Unit* %this, %struct.xmstream* nocapture %stream, i32 %numObjects, i64 %size, i32 %lEncoding) {
+define i32 @_ZN8ASN1Unit4loadER8xmstreamjm18ASN1LengthEncoding(%struct.ASN1Unit* %this, %struct.xmstream* nocapture %stream, i32 %numObjects, i64 %size, i32 %lEncoding) personality i32 (...)* @__gxx_personality_v0 {
entry:
br label %meshBB85
lpad: ; preds = %bb1.i.fragment.cl, %bb1.i.fragment, %bb5
%.SV10.phi807 = phi i8* [ undef, %bb1.i.fragment.cl ], [ undef, %bb1.i.fragment ], [ undef, %bb5 ] ; <i8*> [#uses=1]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
%1 = load i8, i8* %.SV10.phi807, align 8 ; <i8> [#uses=0]
br i1 undef, label %meshBB81.bbcl.disp, label %bb13.fragment.bbcl.disp
declare i32 @_ZN11HullLibrary16CreateConvexHullERK8HullDescR10HullResult(i8*, i8* nocapture, i8* nocapture) ssp align 2
-define void @_ZN17btSoftBodyHelpers4DrawEP10btSoftBodyP12btIDebugDrawi(i8* %psb, i8* %idraw, i32 %drawflags) ssp align 2 {
+define void @_ZN17btSoftBodyHelpers4DrawEP10btSoftBodyP12btIDebugDrawi(i8* %psb, i8* %idraw, i32 %drawflags) ssp align 2 personality i32 (...)* @__gxx_personality_v0 {
entry:
br i1 undef, label %bb92, label %bb58
unreachable
lpad159: ; preds = %bb58
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
; CHECK: movl %esi,{{.*}}(%ebp)
; CHECK: calll __Z6throwsv
-define i8* @_Z4test1SiS_(%struct.S* byval %s1, i32 %n, %struct.S* byval %s2) ssp {
+define i8* @_Z4test1SiS_(%struct.S* byval %s1, i32 %n, %struct.S* byval %s2) ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%retval = alloca i8*, align 4 ; <i8**> [#uses=2]
%n.addr = alloca i32, align 4 ; <i32*> [#uses=1]
br label %finally
terminate.handler: ; preds = %match.end
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
call void @_ZSt9terminatev() noreturn nounwind
unreachable
try.handler: ; preds = %entry
- %exc1.ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %exc1.ptr = landingpad { i8*, i32 }
catch i8* null
%exc1 = extractvalue { i8*, i32 } %exc1.ptr, 0
%selector = extractvalue { i8*, i32 } %exc1.ptr, 1
br label %match.end
match.handler: ; preds = %match
- %exc3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %exc3 = landingpad { i8*, i32 }
cleanup
%7 = extractvalue { i8*, i32 } %exc3, 0
store i8* %7, i8** %_rethrow
; RUN: llc < %s -mtriple=i386-pc-mingw32
-define void @func() nounwind {
+define void @func() nounwind personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
invoke.cont:
%call = tail call i8* @malloc()
%a = invoke i32 @bar()
ret void
lpad:
- %exn.ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %exn.ptr = landingpad { i8*, i32 }
catch i8* null
%exn = extractvalue { i8*, i32 } %exn.ptr, 0
%eh.selector = extractvalue { i8*, i32 } %exn.ptr, 1
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
-define void @f(i32* nocapture %arg, i32* nocapture %arg1, i32* nocapture %arg2, i32* nocapture %arg3, i32 %arg4, i32 %arg5) optsize ssp {
+define void @f(i32* nocapture %arg, i32* nocapture %arg1, i32* nocapture %arg2, i32* nocapture %arg3, i32 %arg4, i32 %arg5) optsize ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
bb:
br i1 undef, label %bb6, label %bb7
bb20: ; preds = %bb43, %bb41, %bb29, %bb7
%tmp21 = phi i32 [ undef, %bb7 ], [ %tmp12, %bb43 ], [ %tmp12, %bb29 ], [ %tmp12, %bb41 ]
- %tmp22 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp22 = landingpad { i8*, i32 }
catch i8* bitcast ({ i8*, i8* }* @Exception to i8*)
br i1 undef, label %bb23, label %bb69
target triple = "i386-pc-linux-gnu"
-define void @_ZN4llvm17AsmMatcherEmitter3runERNS_11raw_ostreamE() align 2 {
+define void @_ZN4llvm17AsmMatcherEmitter3runERNS_11raw_ostreamE() align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
invoke void @_ZNK4llvm13CodeGenTarget12getAsmParserEv()
to label %1 unwind label %5
to label %4 unwind label %2
; <label>:2 ; preds = %1
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
unreachable
to label %12 unwind label %7
; <label>:5 ; preds = %0
- %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %6 = landingpad { i8*, i32 }
cleanup
br label %33
; <label>:7 ; preds = %4
- %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %8 = landingpad { i8*, i32 }
cleanup
br label %9
br i1 %15, label %20, label %18
; <label>:16 ; preds = %12
- %17 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %17 = landingpad { i8*, i32 }
cleanup
br label %26
br label %14
; <label>:21 ; preds = %18
- %22 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %22 = landingpad { i8*, i32 }
cleanup
%23 = extractvalue { i8*, i32 } %22, 1
br i1 undef, label %26, label %24
br label %9
; <label>:30 ; preds = %26
- %31 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %31 = landingpad { i8*, i32 }
catch i8* null
unreachable
unreachable
; <label>:35 ; preds = %9
- %36 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %36 = landingpad { i8*, i32 }
catch i8* null
unreachable
}
%"class.__gnu_cxx::hash_map" = type { %"class.__gnu_cxx::hashtable" }
%"class.__gnu_cxx::hashtable" = type { i64, i64, i64, i64, i64, i64 }
-define void @main() uwtable ssp {
+define void @main() uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%X = alloca %"class.__gnu_cxx::hash_map", align 8
br i1 undef, label %cond.true, label %cond.end
unreachable
lpad2.i.i.i.i: ; preds = %cond.end
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
br i1 undef, label %lpad.body.i.i, label %if.then.i.i.i.i.i.i.i.i
; CHECK: jmp LBB0_1
; CHECK: LBB0_1:
-define void @foobar() {
+define void @foobar() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @_zed()
to label %invoke.cont unwind label %lpad
ret void
lpad: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
declare i32 @__gxx_personality_v0(...)
-define void @test_eh_lpad_successor() {
+define void @test_eh_lpad_successor() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; Some times the landing pad ends up as the first successor of an invoke block.
; When this happens, a strange result used to fall out of updateTerminators: we
; didn't correctly locate the fallthrough successor, assuming blindly that the
br label %loop
lpad:
- %lpad.val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %lpad.val = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } %lpad.val
declare void @fake_throw() noreturn
-define void @test_eh_throw() {
+define void @test_eh_throw() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; For blocks containing a 'throw' (or similar functionality), we have
; a no-return invoke. In this case, only EH successors will exist, and
; fallthrough simply won't occur. Make sure we don't crash trying to update
unreachable
cleanup:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
unreachable
}
; CHECK-LABEL: @main
; CHECK: %unreachable
-define i32 @main(i8* %cleanup) {
+define i32 @main(i8* %cleanup) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_throw() #0
to label %unreachable unwind label %catch.dispatch9
catch.dispatch9: ; preds = %entry
- %tmp13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp13 = landingpad { i8*, i32 }
cleanup
catch i8* null
invoke void @_throw() #0
to label %unreachable unwind label %lpad31
lpad31: ; preds = %catch.dispatch9
- %tmp20 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp20 = landingpad { i8*, i32 }
cleanup
catch i8* null
call void @foo()
; CHECK-NEXT: .quad .Lstr
@str = private unnamed_addr constant [12 x i8] c"NSException\00"
-define void @f() {
+define void @f() personality i8* bitcast (void ()* @h to i8*) {
invoke void @g()
to label %invoke.cont unwind label %lpad
invoke.cont:
ret void
lpad:
- %tmp14 = landingpad { i8*, i32 } personality i8* bitcast (void ()* @h to i8*)
+ %tmp14 = landingpad { i8*, i32 }
catch i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
ret void
}
; PIC: .cfi_lsda 27, .Lexception0
-define void @bar() {
+define void @bar() personality i32 (...)* @__gxx_personality_v0 {
entry:
%call = invoke i32 @foo()
to label %invoke.cont unwind label %lpad
ret void
lpad:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
ret void
}
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
target triple = "i386-apple-darwin10.0"
-define void @foo() {
+define void @foo() personality i32 (...)* @__gxx_personality_v0 {
invcont5:
br label %bb15
to label %.noexc6.i.i unwind label %lpad.i.i ; <float> [#uses=0]
lpad.i.i: ; preds = %bb18.i5.i, %.noexc6.i.i
- %lpadval.i.i = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpadval.i.i = landingpad { i8*, i32 }
catch i8* null
unreachable
lpad59.i: ; preds = %bb15
- %lpadval60.i.i = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpadval60.i.i = landingpad { i8*, i32 }
catch i8* null
unreachable
declare void @might_throw()
declare void @cleanup()
-define i32 @simple_cleanup_catch() {
+define i32 @simple_cleanup_catch() personality i32 (...)* @__gxx_personality_v0 {
invoke void @might_throw()
to label %cont unwind label %lpad
; CHECK: ret i32 0
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %ehvals = landingpad { i8*, i32 }
cleanup
catch i8* @int_typeinfo
%ehptr = extractvalue { i8*, i32 } %ehvals, 0
br i1 %int_match, label %catch_int, label %eh.resume
; CHECK: lpad:
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK: call void @cleanup()
; CHECK: call i32 @llvm.eh.typeid.for
; CHECK: br i1
}
-define i32 @catch_no_resume() {
+define i32 @catch_no_resume() personality i32 (...)* @__gxx_personality_v0 {
invoke void @might_throw()
to label %cont unwind label %lpad
ret i32 0
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %ehvals = landingpad { i8*, i32 }
catch i8* @int_typeinfo
%ehptr = extractvalue { i8*, i32 } %ehvals, 0
%ehsel = extractvalue { i8*, i32 } %ehvals, 1
; Check that we can prune the unreachable resume instruction.
-; CHECK-LABEL: define i32 @catch_no_resume() {
+; CHECK-LABEL: define i32 @catch_no_resume() personality i32 (...)* @__gxx_personality_v0 {
; CHECK: invoke void @might_throw()
; CHECK: ret i32 0
; CHECK: lpad:
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK-NOT: br i1
; CHECK: ret i32 1
; CHECK-NOT: call void @_Unwind_Resume
; CHECK: {{^[}]}}
-define i32 @catch_cleanup_merge() {
+define i32 @catch_cleanup_merge() personality i32 (...)* @__gxx_personality_v0 {
invoke void @might_throw()
to label %inner_invoke unwind label %outer_lpad
inner_invoke:
ret i32 0
outer_lpad:
- %ehvals1 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %ehvals1 = landingpad { i8*, i32 }
catch i8* @int_typeinfo
br label %catch.dispatch
inner_lpad:
- %ehvals2 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %ehvals2 = landingpad { i8*, i32 }
cleanup
catch i8* @int_typeinfo
call void @cleanup()
; CHECK: ret i32 0
;
; CHECK: outer_lpad:
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK: br label %catch.dispatch
;
; CHECK: inner_lpad:
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK: call void @cleanup()
; CHECK: br label %catch.dispatch
;
declare void @g()
-define void @f() {
+define void @f() personality i8* bitcast (void ()* @g to i8*) {
bb0:
call void asm ".Lfunc_end0:", ""()
; CHECK: #APP
invoke void @g() to label %bb2 unwind label %bb1
bb1:
- landingpad { i8*, i32 } personality i8* bitcast (void ()* @g to i8*)
+ landingpad { i8*, i32 }
catch i8* null
call void @g()
ret void
declare void @g()
-define void @f() {
+define void @f() personality i8* bitcast (void ()* @g to i8*) {
bb0:
call void asm ".Lexception0:", ""()
invoke void @g()
to label %bb2 unwind label %bb1
bb1:
- landingpad { i8*, i32 } personality i8* bitcast (void ()* @g to i8*)
+ landingpad { i8*, i32 }
catch i8* null
br label %bb2
declare void @bar()
-define void @foo(i32 %a, i32 %b) nounwind {
+define void @foo(i32 %a, i32 %b) nounwind personality i32 (...)* @__gxx_personality_v0 {
entry:
%q = add i32 %a, 7
%r = add i32 %b, 9
return:
ret void
unw:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
; PR9500, rdar://9156159 - Don't do non-local address mode folding,
; because it may require values which wouldn't otherwise be live out
; of their blocks.
-define void @test6() {
+define void @test6() personality i32 (...)* @__gxx_personality_v0 {
if.end: ; preds = %if.then, %invoke.cont
%tmp15 = load i64, i64* undef
%dec = add i64 %tmp15, 13
unreachable
lpad: ; preds = %if.end19, %if.then14, %if.end, %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
; RUN: llc -mtriple i686-pc-windows-gnu %s -o - | FileCheck %s --check-prefix=MINGW32
@_ZTIi = external constant i8*
-define i32 @main() uwtable optsize ssp {
+define i32 @main() uwtable optsize ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; APPLE: .cfi_startproc
; APPLE: .cfi_personality 155, ___gxx_personality_v0
; APPLE: .cfi_lsda 16, Lexception0
to label %try.cont unwind label %lpad
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTIi to i8*)
br label %eh.resume
declare void @_Z1fv()
declare i32 @llvm.eh.typeid.for(i8*)
-define i32 @main() uwtable {
+define i32 @main() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @_Z1fv()
to label %try.cont unwind label %lpad
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (void ()* @filt0 to i8*)
catch i8* bitcast (void ()* @filt1 to i8*)
declare void @G()
-define void @F3(i32 %y) {
+define void @F3(i32 %y) personality i8* bitcast (void ()* @G to i8*) {
bb0:
invoke void @G()
to label %bb2 unwind label %bb1
bb1:
- landingpad { i8*, i32 } personality i8* bitcast (void ()* @G to i8*)
+ landingpad { i8*, i32 }
catch i8* null
br label %bb2
bb2:
declare void @plus(%Iter* sret, %Iter*, i32)
declare void @reverse(%frame.reverse* inalloca align 4)
-define i32 @main() {
+define i32 @main() personality i32 (...)* @pers {
%temp.lvalue = alloca %Iter
br label %blah
ret i32 0
lpad: ; preds = %invoke.cont, %entry
- %lp = landingpad { i8*, i32 } personality i32 (...)* @pers
+ %lp = landingpad { i8*, i32 }
cleanup
unreachable
}
declare void @throws()
-define void @get_indirect_hidden() {
+define void @get_indirect_hidden() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
invoke void @throws() to label %end unwind label %lpad
lpad:
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp = landingpad { i8*, i32 }
catch i8* bitcast (i8** @hidden_typeid to i8*)
br label %end
ret void
}
-define void @get_indirect() {
+define void @get_indirect() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
invoke void @throws() to label %end unwind label %lpad
lpad:
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp = landingpad { i8*, i32 }
catch i8* bitcast (i8** @normal_typeid to i8*)
br label %end
@7 = external unnamed_addr constant [27 x i8], align 1
@8 = external unnamed_addr constant [63 x i8], align 1
-define void @main() uwtable ssp {
+define void @main() uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
bb:
br i1 undef, label %bb1, label %bb2
br label %bb25272
bb25276: ; preds = %bb25283, %bb25274, %bb25273
- %tmp25277 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp25277 = landingpad { i8*, i32 }
cleanup
br label %bb25361
br label %bb25300
bb25298: ; preds = %bb25296, %bb25295, %bb25290, %bb25287
- %tmp25299 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp25299 = landingpad { i8*, i32 }
cleanup
br label %bb25360
to label %bb25326 unwind label %bb25324
bb25324: ; preds = %bb25357, %bb25344, %bb25343, %bb25342, %bb25337, %bb25334, %bb25333, %bb25323, %bb25313, %bb25307, %bb25306
- %tmp25325 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp25325 = landingpad { i8*, i32 }
cleanup
br label %bb25359
br label %bb25358
bb25355: ; preds = %bb25353, %bb25352, %bb25351
- %tmp25356 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp25356 = landingpad { i8*, i32 }
cleanup
br label %bb25359
; Test invoking of patchpoints
;
-define i64 @patchpoint_invoke(i64 %p1, i64 %p2) {
+define i64 @patchpoint_invoke(i64 %p1, i64 %p2) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK-LABEL: patchpoint_invoke:
; CHECK-NEXT: [[FUNC_BEGIN:.L.*]]:
ret i64 %result
threw:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i64 0
}
; RUN: llc < %s -mtriple=i386-apple-darwin9 | FileCheck %s -check-prefix=X32
; PR1632
-define void @_Z1fv() {
+define void @_Z1fv() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @_Z1gv()
to label %return unwind label %unwind
unwind: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
br i1 false, label %eh_then, label %cleanup20
to label %return unwind label %unwind10
unwind10: ; preds = %eh_then
- %exn10 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn10 = landingpad {i8*, i32}
cleanup
%upgraded.eh_select13 = extractvalue { i8*, i32 } %exn10, 1
%upgraded.eh_select131 = sext i32 %upgraded.eh_select13 to i64
; RUN: llc < %s -relocation-model=pic -mtriple=i386-pc-solaris2.11 | FileCheck %s -check-prefix=X32
; PR1632
-define void @_Z1fv() {
+define void @_Z1fv() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @_Z1gv()
to label %return unwind label %unwind
unwind: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret void
target triple = "i386-pc-linux-gnu"
@.str = external constant [13 x i8] ; <[13 x i8]*> [#uses=1]
-define void @_ada_c34018a() {
+define void @_ada_c34018a() personality i32 (...)* @__gxx_personality_v0 {
entry:
%0 = tail call i32 @report__ident_int(i32 90) ; <i32> [#uses=1]
%1 = trunc i32 %0 to i8 ; <i8> [#uses=1]
ret void
lpad: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
%2 = icmp eq i8 %1, 90 ; <i1> [#uses=1]
br i1 %2, label %return, label %bb22
declare fastcc void @_ZN4FE_QILi3EE14get_dpo_vectorEj(%"struct.std::vector<int,std::allocator<int> >"* noalias nocapture sret, i32)
-define fastcc void @_ZN4FE_QILi3EEC1Ej(i32 %degree) {
+define fastcc void @_ZN4FE_QILi3EEC1Ej(i32 %degree) personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke fastcc void @_ZNSt6vectorIbSaIbEEC1EmRKbRKS0_(%"struct.std::vector<bool,std::allocator<bool> >"* undef, i64 1, i8* undef)
to label %invcont.i unwind label %lpad.i
to label %_ZNSt12_Vector_baseIjSaIjEEC2EmRKS0_.exit.i.i.i.i.i unwind label %lpad.i.i.i.i.i.i ; <i8*> [#uses=0]
lpad.i.i.i.i.i.i: ; preds = %bb71.i
- %exn.i.i.i.i.i.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i.i.i.i.i.i = landingpad {i8*, i32}
cleanup
unreachable
to label %_ZNSt12_Vector_baseIjSaIjEEC2EmRKS0_.exit.i.i.i12.i.i unwind label %lpad.i.i.i.i8.i.i ; <i8*> [#uses=0]
lpad.i.i.i.i8.i.i: ; preds = %_ZNSt6vectorIjSaIjEED1Ev.exit.i.i
- %exn.i.i.i.i8.i.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i.i.i.i8.i.i = landingpad {i8*, i32}
cleanup
invoke void @_Unwind_Resume(i8* undef)
to label %.noexc.i9.i.i unwind label %lpad.i19.i.i
to label %bb83.i unwind label %lpad188.i
lpad.i19.i.i: ; preds = %lpad.i.i.i.i8.i.i
- %exn.i19.i.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i19.i.i = landingpad {i8*, i32}
cleanup
unreachable
to label %_ZNSt12_Vector_baseIjSaIjEEC2EmRKS0_.exit.i.i.i.i unwind label %lpad.i.i.i.i315.i ; <i8*> [#uses=0]
lpad.i.i.i.i315.i: ; preds = %invcont84.i
- %exn.i.i.i.i315.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i.i.i.i315.i = landingpad {i8*, i32}
cleanup
invoke void @_Unwind_Resume(i8* undef)
to label %.noexc.i316.i unwind label %lpad.i352.i
to label %invcont86.i unwind label %lpad200.i
lpad.i352.i: ; preds = %lpad.i.i.i.i315.i
- %exn.i352.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i352.i = landingpad {i8*, i32}
cleanup
unreachable
to label %_ZN10FullMatrixIdEC1Ejj.exit.i.i unwind label %lpad.i.i.i.i.i
lpad.i.i.i.i.i: ; preds = %invcont101.i
- %exn.i.i.i.i.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i.i.i.i.i = landingpad {i8*, i32}
cleanup
unreachable
to label %_ZN10FullMatrixIdEC1Ejj.exit28.i.i unwind label %lpad.i.i.i27.i.i
lpad.i.i.i27.i.i: ; preds = %_ZN10FullMatrixIdEC1Ejj.exit.i.i
- %exn.i.i.i27.i.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i.i.i27.i.i = landingpad {i8*, i32}
cleanup
invoke void @_Unwind_Resume(i8* undef)
to label %.noexc.i.i unwind label %lpad.i.i
unreachable
lpad.i.i: ; preds = %lpad.i.i.i27.i.i
- %exn.i.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i.i = landingpad {i8*, i32}
cleanup
unreachable
br label %bb9.i216.i
lpad.i: ; preds = %entry
- %exn.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i = landingpad {i8*, i32}
cleanup
unreachable
lpad120.i: ; preds = %invcont.i
- %exn120.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn120.i = landingpad {i8*, i32}
cleanup
unreachable
lpad124.i: ; preds = %invcont1.i
- %exn124.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn124.i = landingpad {i8*, i32}
cleanup
unreachable
lpad128.i: ; preds = %invcont3.i
- %exn128.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn128.i = landingpad {i8*, i32}
cleanup
unreachable
lpad132.i: ; preds = %invcont4.i
- %exn132.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn132.i = landingpad {i8*, i32}
cleanup
unreachable
lpad136.i: ; preds = %invcont6.i
- %exn136.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn136.i = landingpad {i8*, i32}
cleanup
unreachable
lpad140.i: ; preds = %bb21.i, %invcont7.i
- %exn140.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn140.i = landingpad {i8*, i32}
cleanup
unreachable
lpad144.i: ; preds = %bb10.i168.i, %invcont9.i
- %exn144.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn144.i = landingpad {i8*, i32}
cleanup
unreachable
lpad148.i: ; preds = %invcont10.i
- %exn148.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn148.i = landingpad {i8*, i32}
cleanup
unreachable
lpad188.i: ; preds = %bb50.i.i.i
- %exn188.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn188.i = landingpad {i8*, i32}
cleanup
unreachable
lpad196.i: ; preds = %bb.i191.i
- %exn196 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn196 = landingpad {i8*, i32}
cleanup
unreachable
lpad200.i: ; preds = %bb50.i.i
- %exn200.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn200.i = landingpad {i8*, i32}
cleanup
unreachable
lpad204.i: ; preds = %invcont86.i
- %exn204.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn204.i = landingpad {i8*, i32}
cleanup
unreachable
}
declare void @llvm.frameescape(...)
declare i8* @llvm.x86.seh.exceptioninfo(i8*, i8*)
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @_except_handler3 to i8*) {
entry:
%__exceptioncode = alloca i32, align 4
call void (...) @llvm.frameescape(i32* %__exceptioncode)
to label %__try.cont unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @_except_handler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i32 ()* @"filt$main" to i8*)
%1 = extractvalue { i8*, i32 } %0, 1
%2 = call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @"filt$main" to i8*)) #4
declare void @crash()
declare i32 @printf(i8* nocapture readonly, ...) nounwind
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
invoke void @crash()
to label %__try.cont unwind label %lpad
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
%1 = extractvalue { i8*, i32 } %0, 0
%2 = ptrtoint i8* %1 to i64
declare i32 @filt()
; Function Attrs: nounwind uwtable
-define void @use_both() #1 {
+define void @use_both() #1 personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %__try.cont
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@use_both@@" to i8*)
%2 = extractvalue { i8*, i32 } %1, 0
to label %invoke.cont3 unwind label %lpad1
lpad1: ; preds = %lpad, %invoke.cont
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %5 = landingpad { i8*, i32 }
catch i8* bitcast (i32 (i8*, i8*)* @"\01?filt$0@0@use_both@@" to i8*)
%6 = extractvalue { i8*, i32 } %5, 0
store i8* %6, i8** %exn.slot
; RUN: llc -O0 -mtriple=x86_64-windows-msvc < %s | FileCheck %s
declare void @g()
-define void @f() {
+define void @f() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
invoke void @g() to label %return unwind label %lpad
return:
ret void
lpad:
- %ehptrs = landingpad {i8*, i32} personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %ehptrs = landingpad {i8*, i32}
filter [0 x i8*] zeroinitializer
call void @__cxa_call_unexpected(i8* null)
unreachable
declare void @crash()
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
invoke void @crash()
to label %invoke.cont unwind label %lpad
ret i32 0
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
%1 = extractvalue { i8*, i32 } %0, 0
%2 = extractvalue { i8*, i32 } %0, 1
resume { i8*, i32 } %0
terminate.lpad: ; preds = %lpad
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %3 = landingpad { i8*, i32 }
catch i8* null
call void @abort()
unreachable
@str1 = internal constant [27 x i8] c"EXCEPTION_ACCESS_VIOLATION\00"
@str2 = internal constant [29 x i8] c"EXCEPTION_INT_DIVIDE_BY_ZERO\00"
-define i32 @safe_div(i32* %n, i32* %d) {
+define i32 @safe_div(i32* %n, i32* %d) personality i8* bitcast (i32 (...)* @_except_handler3 to i8*) {
entry:
%r = alloca i32, align 4
store i32 42, i32* %r
to label %__try.cont unwind label %lpad
lpad:
- %vals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @_except_handler3 to i8*)
+ %vals = landingpad { i8*, i32 }
catch i8* bitcast (i32 ()* @safe_div_filt0 to i8*)
catch i8* bitcast (i32 ()* @safe_div_filt1 to i8*)
%ehptr = extractvalue { i8*, i32 } %vals, 0
@str1 = internal constant [27 x i8] c"EXCEPTION_ACCESS_VIOLATION\00"
@str2 = internal constant [29 x i8] c"EXCEPTION_INT_DIVIDE_BY_ZERO\00"
-define i32 @safe_div(i32* %n, i32* %d) {
+define i32 @safe_div(i32* %n, i32* %d) personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
%r = alloca i32, align 4
invoke void @try_body(i32* %r, i32* %n, i32* %d)
to label %__try.cont unwind label %lpad
lpad:
- %vals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %vals = landingpad { i8*, i32 }
catch i8* bitcast (i32 (i8*, i8*)* @safe_div_filt0 to i8*)
catch i8* bitcast (i32 (i8*, i8*)* @safe_div_filt1 to i8*)
%ehptr = extractvalue { i8*, i32 } %vals, 0
; This is the same as above, but using "invoke" rather than "call" to
; call setjmp().
-define void @setjmp_invoker() {
+define void @setjmp_invoker() personality void ()* @personality {
; X86-32-LABEL: setjmp_invoker:
; X86-64-LABEL: setjmp_invoker:
%a1 = call i32 @get_val()
br i1 %setjmp_result, label %second, label %first
lpad:
- %lp = landingpad { i8*, i32 } personality void ()* @personality cleanup
+ %lp = landingpad { i8*, i32 } cleanup
unreachable
first:
%struct.objc_selector = type opaque
@"\01l_objc_msgSend_fixup_alloc" = external global %struct._message_ref_t, align 16 ; <%struct._message_ref_t*> [#uses=2]
-define %struct.NSArray* @newFetchedRowsForFetchPlan_MT(%struct.FetchPlanHeader* %fetchPlan, %struct.objc_selector* %selectionMethod, %struct.NSObject* %selectionParameter) ssp {
+define %struct.NSArray* @newFetchedRowsForFetchPlan_MT(%struct.FetchPlanHeader* %fetchPlan, %struct.objc_selector* %selectionMethod, %struct.NSObject* %selectionParameter) ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
%0 = invoke %struct.NSObject* null(%struct.NSObject* null, %struct._message_ref_t* @"\01l_objc_msgSend_fixup_alloc")
to label %invcont unwind label %lpad ; <%struct.NSObject*> [#uses=1]
lpad: ; preds = %invcont26, %invcont, %entry
%pool.1 = phi %struct.NSAutoreleasePool* [ null, %entry ], [ null, %invcont ], [ null, %invcont26 ] ; <%struct.NSAutoreleasePool*> [#uses=0]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
; test18a: Addr-of a variable passed into an invoke instruction.
; no ssp attribute
; Requires no protector.
-define i32 @test18a() {
+define i32 @test18a() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; LINUX-I386-LABEL: test18a:
; LINUX-I386-NOT: calll __stack_chk_fail
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
; ssp attribute
; Requires no protector.
; Function Attrs: ssp
-define i32 @test18b() #0 {
+define i32 @test18b() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; LINUX-I386-LABEL: test18b:
; LINUX-I386-NOT: calll __stack_chk_fail
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
; sspstrong attribute
; Requires protector.
; Function Attrs: sspstrong
-define i32 @test18c() #1 {
+define i32 @test18c() #1 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; LINUX-I386-LABEL: test18c:
; LINUX-I386: mov{{l|q}} %gs:
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
; sspreq attribute
; Requires protector.
; Function Attrs: sspreq
-define i32 @test18d() #2 {
+define i32 @test18d() #2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; LINUX-I386-LABEL: test18d:
; LINUX-I386: mov{{l|q}} %gs:
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
; (GEP followed by an invoke)
; no ssp attribute
; Requires no protector.
-define i32 @test19a() {
+define i32 @test19a() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; LINUX-I386-LABEL: test19a:
; LINUX-I386-NOT: calll __stack_chk_fail
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
; ssp attribute
; Requires no protector.
; Function Attrs: ssp
-define i32 @test19b() #0 {
+define i32 @test19b() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; LINUX-I386-LABEL: test19b:
; LINUX-I386-NOT: calll __stack_chk_fail
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
; sspstrong attribute
; Requires protector.
; Function Attrs: sspstrong
-define i32 @test19c() #1 {
+define i32 @test19c() #1 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; LINUX-I386-LABEL: test19c:
; LINUX-I386: mov{{l|q}} %gs:
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
; sspreq attribute
; Requires protector.
; Function Attrs: sspreq
-define i32 @test19d() #2 {
+define i32 @test19d() #2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; LINUX-I386-LABEL: test19d:
; LINUX-I386: mov{{l|q}} %gs:
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
define i64 addrspace(1)* @test_basic(i64 addrspace(1)* %obj,
i64 addrspace(1)* %obj1)
-gc "statepoint-example" {
+gc "statepoint-example" personality i32 ()* @"personality_function" {
entry:
; CHECK: Ltmp{{[0-9]+}}:
; CHECK: callq some_call
; CHECK: Ltmp{{[0-9]+}}:
; CHECK: movq
; CHECK: retq
- %landing_pad = landingpad { i8*, i32 } personality i32 ()* @"personality_function"
+ %landing_pad = landingpad { i8*, i32 }
cleanup
%relocate_token = extractvalue { i8*, i32 } %landing_pad, 1
%obj.relocated1 = call coldcc i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(i32 %relocate_token, i32 13, i32 13)
define i64 addrspace(1)* @test_result(i64 addrspace(1)* %obj,
i64 addrspace(1)* %obj1)
- gc "statepoint-example" {
+ gc "statepoint-example" personality i32 ()* @personality_function {
entry:
; CHECK: .Ltmp{{[0-9]+}}:
; CHECK: callq some_other_call
exceptional_return:
; CHECK: .Ltmp{{[0-9]+}}:
; CHECK: movq
- %landing_pad = landingpad { i8*, i32 } personality i32 ()* @personality_function
+ %landing_pad = landingpad { i8*, i32 }
cleanup
%relocate_token = extractvalue { i8*, i32 } %landing_pad, 1
%obj.relocated = call coldcc i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(i32 %relocate_token, i32 13, i32 13)
; CHECK: .align 4
define i64 addrspace(1)* @test_same_val(i1 %cond, i64 addrspace(1)* %val1, i64 addrspace(1)* %val2, i64 addrspace(1)* %val3)
- gc "statepoint-example" {
+ gc "statepoint-example" personality i32 ()* @"personality_function" {
entry:
br i1 %cond, label %left, label %right
ret i64 addrspace(1)* %ret
exceptional_return.left:
- %landing_pad = landingpad { i8*, i32 } personality i32 ()* @"personality_function"
+ %landing_pad = landingpad { i8*, i32 }
cleanup
%relocate_token = extractvalue { i8*, i32 } %landing_pad, 1
%val.relocated2 = call coldcc i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(i32 %relocate_token, i32 13, i32 13)
ret i64 addrspace(1)* %val.relocated2
exceptional_return.right:
- %landing_pad1 = landingpad { i8*, i32 } personality i32 ()* @"personality_function"
+ %landing_pad1 = landingpad { i8*, i32 }
cleanup
%relocate_token1 = extractvalue { i8*, i32 } %landing_pad1, 1
%val.relocated3 = call coldcc i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(i32 %relocate_token1, i32 13, i32 13)
}
define i64 addrspace(1)* @test_null_undef(i64 addrspace(1)* %val1)
- gc "statepoint-example" {
+ gc "statepoint-example" personality i32 ()* @"personality_function" {
; CHECK-LABEL: test_null_undef:
entry:
; CHECK: callq some_call
ret i64 addrspace(1)* %null.relocated
exceptional_return:
- %landing_pad = landingpad { i8*, i32 } personality i32 ()* @"personality_function"
+ %landing_pad = landingpad { i8*, i32 }
cleanup
%relocate_token = extractvalue { i8*, i32 } %landing_pad, 1
%null.relocated2 = call coldcc i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(i32 %relocate_token, i32 13, i32 13)
}
define i64 addrspace(1)* @test_alloca_and_const(i64 addrspace(1)* %val1)
- gc "statepoint-example" {
+ gc "statepoint-example" personality i32 ()* @"personality_function" {
; CHECK-LABEL: test_alloca_and_const:
entry:
%a = alloca i32
; CHECK: movl $15
; CHECK-NEXT: popq
; CHECK-NEXT: retq
- %landing_pad = landingpad { i8*, i32 } personality i32 ()* @"personality_function"
+ %landing_pad = landingpad { i8*, i32 }
cleanup
%relocate_token = extractvalue { i8*, i32 } %landing_pad, 1
%aa.rel2 = call coldcc i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(i32 %relocate_token, i32 14, i32 14)
}
; Test that stack slots are reused for invokes
-define i32 @back_to_back_invokes(i32 addrspace(1)* %a, i32 addrspace(1)* %b, i32 addrspace(1)* %c) #1 gc "statepoint-example" {
+define i32 @back_to_back_invokes(i32 addrspace(1)* %a, i32 addrspace(1)* %b, i32 addrspace(1)* %c) #1 gc "statepoint-example" personality i32 ()* @"personality_function" {
; CHECK-LABEL: back_to_back_invokes
entry:
; The exact stores don't matter, but there need to be three stack slots created
ret i32 1
exceptional_return:
- %landing_pad = landingpad { i8*, i32 } personality i32 ()* @"personality_function"
+ %landing_pad = landingpad { i8*, i32 }
cleanup
ret i32 0
exceptional_return2:
- %landing_pad2 = landingpad { i8*, i32 } personality i32 ()* @"personality_function"
+ %landing_pad2 = landingpad { i8*, i32 }
cleanup
ret i32 0
}
@"\01??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" }, comdat
@llvm.eh.handlertype.H.0 = private unnamed_addr constant %eh.CatchHandlerType { i32 0, i8* bitcast (%rtti.TypeDescriptor2* @"\01??_R0H@8" to i8*) }, section "llvm.metadata"
-define void @f() #0 {
+define void @f() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
invoke void @may_throw(i32 1)
to label %invoke.cont unwind label %lpad
ret void
lpad: ; preds = %catch, %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %0 = landingpad { i8*, i32 }
catch %eh.CatchHandlerType* @llvm.eh.handlertype.H.0
%1 = extractvalue { i8*, i32 } %0, 0
%2 = extractvalue { i8*, i32 } %0, 1
br label %catch.dispatch.4
lpad.1: ; preds = %invoke.cont
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
+ %3 = landingpad { i8*, i32 }
catch i8* bitcast (%eh.CatchHandlerType* @llvm.eh.handlertype.H.0 to i8*)
%4 = extractvalue { i8*, i32 } %3, 0
%5 = extractvalue { i8*, i32 } %3, 1
ret i32 1
}
-define void @use_except_handler3() {
+define void @use_except_handler3() personality i32 (...)* @_except_handler3 {
entry:
invoke void @may_throw_or_crash()
to label %cont unwind label %catchall
cont:
ret void
catchall:
- %0 = landingpad { i8*, i32 } personality i32 (...)* @_except_handler3
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i32 ()* @catchall_filt to i8*)
%1 = extractvalue { i8*, i32 } %0, 1
%2 = call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @catchall_filt to i8*)) #4
; CHECK-NEXT: .long _catchall_filt
; CHECK-NEXT: .long Ltmp{{[0-9]+}}
-define void @use_except_handler4() {
+define void @use_except_handler4() personality i32 (...)* @_except_handler4 {
entry:
invoke void @may_throw_or_crash()
to label %cont unwind label %catchall
cont:
ret void
catchall:
- %0 = landingpad { i8*, i32 } personality i32 (...)* @_except_handler4
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i32 ()* @catchall_filt to i8*)
%1 = extractvalue { i8*, i32 } %0, 1
%2 = call i32 @llvm.eh.typeid.for(i8* bitcast (i32 ()* @catchall_filt to i8*)) #4
; CHECK-NEXT: .long _catchall_filt
; CHECK-NEXT: .long Ltmp{{[0-9]+}}
-define void @use_CxxFrameHandler3() {
+define void @use_CxxFrameHandler3() personality i32 (...)* @__CxxFrameHandler3 {
invoke void @may_throw_or_crash()
to label %cont unwind label %catchall
cont:
ret void
catchall:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__CxxFrameHandler3
+ %ehvals = landingpad { i8*, i32 }
catch i8* null
%ehptr = extractvalue { i8*, i32 } %ehvals, 0
call void @llvm.eh.begincatch(i8* %ehptr, i8* null)
declare i32 @personality(...)
; Check for 'nop' between the last call and the epilogue.
-define void @foo1() {
+define void @foo1() personality i32 (...)* @personality {
invoke void @bar()
to label %normal
ret void
catch:
- %1 = landingpad { i8*, i32 } personality i32 (...)* @personality cleanup
+ %1 = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } %1
}
; WIN64-LABEL: foo1:
declare i32 @bar()
-define i32 @foo4() #0 {
+define i32 @foo4() #0 personality i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality {
entry:
%step = alloca i32, align 4
store i32 0, i32* %step
br label %endtryfinally
landingpad:
- %landing_pad = landingpad { i8*, i32 } personality i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality
+ %landing_pad = landingpad { i8*, i32 }
cleanup
%tmp3 = extractvalue { i8*, i32 } %landing_pad, 0
store i32 2, i32* %step
declare i32 @__gxx_personality_seh0(...)
declare i32 @llvm.eh.typeid.for(i8*) readnone nounwind
-define i32 @use_seh() {
+define i32 @use_seh() personality i32 (...)* @__C_specific_handler {
entry:
invoke void @maybe_throw()
to label %cont unwind label %lpad
ret i32 0
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %ehvals = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i32 (i8*, i8*)* @filt_g to i8*)
%ehsel = extractvalue { i8*, i32 } %ehvals, 1
; A MinGW64-ish EH style. It could happen if a binary uses both MSVC CRT and
; mingw CRT and is linked with LTO.
-define i32 @use_gcc() {
+define i32 @use_gcc() personality i32 (...)* @__gxx_personality_seh0 {
entry:
invoke void @maybe_throw()
to label %cont unwind label %lpad
ret i32 0
lpad:
- %ehvals = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_seh0
+ %ehvals = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTIi to i8*)
%ehsel = extractvalue { i8*, i32 } %ehvals, 1
; CHECK: entsp 4
; CHECK: .cfi_def_cfa_offset 16
; CHECK: .cfi_offset 15, 0
-define void @fn_catch() {
+define void @fn_catch() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; N.B. we alloc no variables, hence force compiler to spill
; CHECK: ldw r6, r0[0]
; CHECK: bl __cxa_end_catch
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast (i8** @_ZTIi to i8*)
catch i8* bitcast (i8** @_ZTId to i8*)
declare void @bar()
-define i64 @foo(i64 %lhs, i64 %rhs) {
+define i64 @foo(i64 %lhs, i64 %rhs) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
invoke void @bar() to label %end unwind label %clean
end:
ret i64 0
clean:
- %tst = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup
+ %tst = landingpad { i8*, i32 } cleanup
ret i64 42
}
ret void, !dbg !73
}
-define void @_Z3f16v() #0 {
+define void @_Z3f16v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%agg.tmp.i.i = alloca %struct.A, align 8
%d = alloca %struct.B, align 1
ret void, !dbg !94
lpad: ; preds = %call.i.i.noexc, %entry
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup, !dbg !94
call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !39, metadata !79), !dbg !82
%call2 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !94
declare void @bar()
-define i64 @foo(i64 %lhs, i64 %rhs) {
+define i64 @foo(i64 %lhs, i64 %rhs) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
invoke void @bar() to label %end unwind label %clean
end:
ret i64 0
clean:
- %tst = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup
+ %tst = landingpad { i8*, i32 } cleanup
ret i64 42
}
ret void
}
-define void @bar() {
+define void @bar() personality i8* bitcast (void ()* @foo to i8*) {
invoke void @foo()
to label %invoke.cont unwind label %lpad
ret void
lpad: ; preds = %0
- %tmp1 = landingpad { i8*, i32 } personality i8* bitcast (void ()* @foo to i8*)
+ %tmp1 = landingpad { i8*, i32 }
filter [1 x i8*] [i8* bitcast (i8** @_ZTId to i8*)]
ret void
}
}
; Function Attrs: uwtable
-define i32 @main(i32 %argc, i8** %argv) #2 {
+define i32 @main(i32 %argc, i8** %argv) #2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%retval = alloca i32, align 4
%argc.addr = alloca i32, align 4
ret i32 %1, !dbg !116
lpad: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup, !dbg !116
%3 = extractvalue { i8*, i32 } %2, 0, !dbg !116
store i8* %3, i8** %exn.slot, !dbg !116
resume { i8*, i32 } %lpad.val2, !dbg !119
terminate.lpad: ; preds = %lpad
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %5 = landingpad { i8*, i32 }
catch i8* null, !dbg !121
%6 = extractvalue { i8*, i32 } %5, 0, !dbg !121
call void @__clang_call_terminate(i8* %6) #5, !dbg !121
declare void @_ZSt9terminatev()
; Function Attrs: uwtable
-define linkonce_odr void @_ZN1AD0Ev(%class.A* %this) unnamed_addr #2 align 2 {
+define linkonce_odr void @_ZN1AD0Ev(%class.A* %this) unnamed_addr #2 align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%this.addr = alloca %class.A*, align 8
%exn.slot = alloca i8*
ret void, !dbg !129
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup, !dbg !131
%2 = extractvalue { i8*, i32 } %1, 0, !dbg !131
store i8* %2, i8** %exn.slot, !dbg !131
declare i32 @_Z8test_exti(i32)
-define i32 @_Z5test2v() {
+define i32 @_Z5test2v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %try.cont, !dbg !23
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*), !dbg !21
%2 = extractvalue { i8*, i32 } %1, 0, !dbg !21
store i8* %2, i8** %exn.slot, !dbg !21
declare i32 @_Z8test_exti(i32)
-define i32 @_Z5test2v() {
+define i32 @_Z5test2v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%exn.slot = alloca i8*
%ehselector.slot = alloca i32
br label %try.cont, !dbg !23
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*), !dbg !21
%2 = extractvalue { i8*, i32 } %1, 0, !dbg !21
store i8* %2, i8** %exn.slot, !dbg !21
unreachable
}
-define i32 @FB() {
+define i32 @FB() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException_B()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @FB() {
+define i32 @FB() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException_B()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
unreachable
}
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @throwException()
to label %try.cont unwind label %lpad
lpad:
- %p = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %p = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%e = extractvalue { i8*, i32 } %p, 0
call i8* @__cxa_begin_catch(i8* %e)
ret void
}
-define cc42 void @bar3() {
+define cc42 void @bar3() personality i32 (...)* @__gxx_personality_v0 {
invoke fastcc void @foo( )
to label %Ok unwind label %U
ret void
U:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
resume { i8*, i32 } %exn
}
-define void @bar4() {
+define void @bar4() personality i32 (...)* @__gxx_personality_v0 {
call cc42 void @bar( )
invoke cc42 void @bar3( )
to label %Ok unwind label %U
ret void
U:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
resume { i8*, i32 } %exn
}
ret void
}
-define i32 @main(i32 %argc) {
+define i32 @main(i32 %argc) personality i32 (...)* @__gxx_personality_v0 {
%retval = call i32 @test( i32 %argc ) ; <i32> [#uses=2]
%two = add i32 %retval, %retval ; <i32> [#uses=1]
%retval2 = invoke i32 @test( i32 %argc )
ret i32 %two2
Error:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 -1
}
@_ZTId = external constant i8*
@_ZTIPKc = external constant i8*
-define void @_Z3barv() uwtable optsize ssp {
+define void @_Z3barv() uwtable optsize ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @_Z3quxv() optsize
to label %try.cont unwind label %lpad
ret void
lpad: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
catch i8** @_ZTIc
filter [2 x i8**] [i8** @_ZTIPKc, i8** @_ZTId]
ret i32 %div
}
-define i32 @main() nounwind {
+define i32 @main() nounwind personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
%call = invoke i32 @div(i32 10, i32 0)
to label %__try.cont unwind label %lpad
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
br label %__try.cont
declare i32 @__gxx_personality_v0(...)
-define i64 @Invoke1(i8** %esc) nounwind uwtable ssp sanitize_address {
+define i64 @Invoke1(i8** %esc) nounwind uwtable ssp sanitize_address personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @MyNoReturnFunc(i32 1)
to label %invoke.cont unwind label %lpad
ret i64 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
ret i64 1
}
declare void @p()
-define void @bar() {
+define void @bar() personality void()* @p {
bb0:
call void @foo1()
call void @f(void()* @foo2)
bb2:
ret void
clean:
- landingpad {i32, i32} personality void()* @p cleanup
+ landingpad {i32, i32} cleanup
ret void
}
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
; PR2894
declare void @g()
-define void @f() {
+define void @f() personality i32 (...)* @__gxx_personality_v0 {
; CHECK: invoke void @g()
; CHECK: to label %d unwind label %c
invoke void @g() to label %d unwind label %c
d:
ret void
c:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret void
}
; RUN: opt < %s -inline -prune-eh -disable-output
-define void @f2() {
+define void @f2() personality i32 (...)* @__gxx_personality_v0 {
invoke void @f6()
to label %ok1 unwind label %lpad1
ret void
lpad1:
- landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ landingpad {i8*, i32}
cleanup
invoke void @f4()
to label %ok2 unwind label %lpad2
unreachable
lpad2:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
; RUN: opt < %s -adce -disable-output
-define void @test() {
+define void @test() personality i32 (...)* @__gxx_personality_v0 {
br i1 false, label %then, label %endif
then: ; preds = %0
to label %invoke_cont unwind label %invoke_catch
invoke_catch: ; preds = %then
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
resume { i8*, i32 } %exn
declare void @q_atomic_decrement()
-define void @_ZNK10QByteArray13leftJustifiedEicb() {
+define void @_ZNK10QByteArray13leftJustifiedEicb() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @strlen( )
to label %tmp.3.i.noexc unwind label %invoke_catch.0
br i1 false, label %then.0, label %else.0
invoke_catch.0: ; preds = %entry
- %exn.0 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.0 = landingpad {i8*, i32}
cleanup
invoke void @q_atomic_decrement( )
to label %tmp.1.i.i183.noexc unwind label %terminate
to label %invoke_cont.1 unwind label %invoke_catch.1
invoke_catch.1: ; preds = %then.0
- %exn.1 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.1 = landingpad {i8*, i32}
cleanup
invoke void @q_atomic_decrement( )
to label %tmp.1.i.i162.noexc unwind label %terminate
terminate: ; preds = %invoke_catch.1, %invoke_catch.0
%dbg.0.1 = phi { }* [ null, %invoke_catch.1 ], [ null, %invoke_catch.0 ] ; <{ }*> [#uses=0]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
declare i32 @strlen(i8*) readnone
-define i32 @test() {
+define i32 @test() personality i32 (...)* @__gxx_personality_v0 {
; invoke of pure function should not be deleted!
invoke i32 @strlen( i8* null ) readnone
to label %Cont unwind label %Other ; <i32>:1 [#uses=0]
ret i32 0
Other: ; preds = %0
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 1
}
; RUN: opt -inline -argpromotion < %s
; rdar://7879828
-define void @foo() {
+define void @foo() personality i32 (...)* @__gxx_personality_v0 {
invoke void @foo2()
to label %if.end432 unwind label %for.end520
unreachable
for.end520:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
; CHECK: ret void
}
-define i32 @test2() {
+define i32 @test2() personality i32 (...)* @__gxx_personality_v0 {
; invoke of pure function should not be deleted!
invoke i32 @strlen( i8* null ) readnone
to label %Cont unwind label %Other
ret i32 0
Other: ; preds = %0
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 1
declare i32 @__gxx_personality_v0(...)
-define fastcc void @_ZN11__sanitizerL12TestRegistryEPNS_14ThreadRegistryEb() #0 {
+define fastcc void @_ZN11__sanitizerL12TestRegistryEPNS_14ThreadRegistryEb() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
br i1 undef, label %if.else, label %entry.if.end_crit_edge
br label %if.else
lpad65.loopexit.split-lp.loopexit.split-lp.loopexit:
- %lpad.loopexit1121 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %lpad.loopexit1121 = landingpad { i8*, i32 }
cleanup
br label %lpad65.loopexit.split-lp.loopexit.split-lp
declare void @__errno_location()
-define void @yylex() {
+define void @yylex() personality i32 (...)* @__gcc_personality_v0 {
entry:
switch i32 0, label %label.126 [
i32 0, label %return
ret void
LongJmpBlkPre: ; preds = %endif.52, %then.40
- %exn = landingpad { i8*, i32 } personality i32 (...)* @__gcc_personality_v0
+ %exn = landingpad { i8*, i32 }
catch i8* null
ret void
}
; RUN: opt < %s -extract-blocks -disable-output
-define i32 @foo() {
+define i32 @foo() personality i32 (...)* @__gcc_personality_v0 {
br label %EB
EB: ; preds = %0
ret i32 %V
Unw: ; preds = %EB
- %exn = landingpad { i8*, i32 } personality i32 (...)* @__gcc_personality_v0
+ %exn = landingpad { i8*, i32 }
catch i8* null
resume { i8*, i32 } %exn
}
ret {i32,i32} {i32 42, i32 4}
}
-define i32 @bar() {
+define i32 @bar() personality i32 (...)* @__gxx_personality_v0 {
%x = invoke {i32,i32} @foo() to label %T unwind label %T2
T:
%y = extractvalue {i32,i32} %x, 1
ret i32 %y
T2:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
-define i32 @bar2() {
+define i32 @bar2() personality i32 (...)* @__gxx_personality_v0 {
entry:
%x = invoke {i32,i32} @foo() to label %T unwind label %T2
T:
%y = extractvalue {i32,i32} %x, 1
ret i32 %y
T2:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
declare void @throw_if_bit_set(i8*, i8) readonly
; CHECK: define i1 @c6(i8* readonly %q, i8 %bit)
-define i1 @c6(i8* %q, i8 %bit) {
+define i1 @c6(i8* %q, i8 %bit) personality i32 (...)* @__gxx_personality_v0 {
invoke void @throw_if_bit_set(i8* %q, i8 %bit)
to label %ret0 unwind label %ret1
ret0:
ret i1 0
ret1:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i1 1
}
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-unknown-linux-gnu"
-define i32 @main(i32 %argc, i8** nocapture %argv) {
+define i32 @main(i32 %argc, i8** nocapture %argv) personality i32 (...)* @__gxx_personality_v0 {
entry:
%0 = getelementptr inbounds i8, i8* undef, i64 5 ; <i8*> [#uses=1]
%1 = bitcast i8* %0 to i32* ; <i32*> [#uses=1]
ret i32 0
landing_pad: ; preds = %l147.i.i, %l129.i.i, %l117.i.i
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
switch i32 undef, label %fin [
i32 1, label %catch1
declare i32 @__gxx_personality_v0(i32, i64, i8*, i8*)
-define void @_Z3foov() uwtable {
+define void @_Z3foov() uwtable personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
entry:
invoke void @_Z4barv()
to label %return unwind label %lpad
lpad: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %0 = landingpad { i8*, i32 }
catch %struct.__fundamental_type_info_pseudo* @_ZTIi
catch %struct.__fundamental_type_info_pseudo* @_ZTIb
catch %struct.__fundamental_type_info_pseudo* @_ZTIi
%"union.llvm::SmallVectorBase::U" = type { x86_fp80 }
; Function Attrs: ssp uwtable
-define void @_Z4testv() #0 {
+define void @_Z4testv() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; CHECK: @_Z4testv()
; CHECK: invoke.cont:
; CHECK: br i1 true, label %new.notnull.i11, label %if.end.i14
ret void
lpad: ; preds = %if.end.i14, %if.end.i, %invoke.cont2
- %12 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %12 = landingpad { i8*, i32 }
cleanup
%13 = load i8*, i8** %BeginX.i.i.i.i.i.i, align 16, !tbaa !4
%cmp.i.i.i.i = icmp eq i8* %13, %1
declare i8* @strdup(i8*)
declare void @foo2(i8*)
-define void @test3() uwtable {
+define void @test3() uwtable personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
; CHECK-LABEL: @test3(
; CHECK-NOT: bb1:
; CHECK-NOT: bb2:
store i8* %ptr, i8** @glbl
unreachable
bb2:
- %tmp1 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %tmp1 = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } %tmp1
}
ret i32 1
}
-define void @_GLOBAL__I_a() {
+define void @_GLOBAL__I_a() personality i8* undef {
bb:
%tmp1 = invoke i32 @one()
to label %bb2 unwind label %bb4
ret void
bb4: ; preds = %bb
- %tmp5 = landingpad { i8*, i32 } personality i8* undef
+ %tmp5 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
unreachable
}
ret { i32, i32 } %Z
}
-define void @caller(i1 %C) {
+define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
%Q = alloca i32
;; Call incdec to see if %W is properly replaced by %Q
%W = call i32* @incdec(i1 %C, i32* %Q ) ; <i32> [#uses=1]
br label %RET
LPAD:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
br label %RET
ret i1 %Y
}
-define i1 @invokecaller(i1 %C) {
+define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
%X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL ; <i32> [#uses=1]
OK:
%Y = icmp ne i32 %X, 0 ; <i1> [#uses=1]
ret i1 %Y
FAIL:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i1 false
}
declare i32 @__gxx_personality_v0(...)
-define void @_ZN4llvm11_GLOBAL__N_22InsertPrologEpilogCode20runOnMachineFunctionERNS_15MachineFunctionE(%"struct.llvm::MachineFunction"* %F) {
+define void @_ZN4llvm11_GLOBAL__N_22InsertPrologEpilogCode20runOnMachineFunctionERNS_15MachineFunctionE(%"struct.llvm::MachineFunction"* %F) personality i32 (...)* @__gxx_personality_v0 {
entry:
%tmp.8.i = invoke %"struct.llvm::TargetFrameInfo"* null( %"struct.llvm::TargetMachine"* null )
to label %invoke_cont.0.i unwind label %invoke_catch.0.i ; <%"struct.llvm::TargetFrameInfo"*> [#uses=0]
invoke_catch.0.i: ; preds = %invoke_cont.49.i, %invoke_cont.48.i, %invoke_cont.47.i, %invoke_cont.i53.i, %no_exit.i, %invoke_cont.44.i, %invoke_cont.43.i, %invoke_cont.42.i, %invoke_cont.41.i, %invoke_cont.40.i, %invoke_cont.39.i, %invoke_cont.38.i, %invoke_cont.37.i, %then.2.i, %invoke_cont.35.i, %invoke_cont.34.i, %then.1.i, %endif.0.i, %invoke_cont.9.i, %invoke_cont.8.i, %invoke_cont.7.i, %invoke_cont.i.i, %then.0.i, %invoke_cont.4.i, %invoke_cont.3.i, %invoke_cont.2.i, %invoke_cont.1.i, %endif.0.i.i, %tmp.7.i.noexc.i, %invoke_cont.0.i, %entry
- %exn0.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn0.i = landingpad {i8*, i32}
cleanup
ret void
to label %invoke_cont.i.i unwind label %cond_true.i.i
cond_true.i.i: ; preds = %tmp.0.i.noexc.i
- %exn.i.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i.i = landingpad {i8*, i32}
cleanup
ret void
to label %invoke_cont.i53.i unwind label %cond_true.i52.i
cond_true.i52.i: ; preds = %tmp.0.i.noexc55.i
- %exn.i52.i = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn.i52.i = landingpad {i8*, i32}
cleanup
ret void
; RUN: opt < %s -indvars -disable-output
-define void @_ZN5ArrayISt7complexIdEEC2ERK10dim_vector() {
+define void @_ZN5ArrayISt7complexIdEEC2ERK10dim_vector() personality i32 (...)* @__gxx_personality_v0 {
entry:
%tmp.7 = invoke i32 @_ZN5ArrayISt7complexIdEE8get_sizeERK10dim_vector( )
to label %invoke_cont.0 unwind label %cond_true.1 ; <i32> [#uses=2]
br label %no_exit.i
cond_true.1: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
resume { i8*, i32 } %exn
}
declare void @_Z9qt_assertPKcS0_i()
-define void @_ZN13QMetaResourceC1EPKh() {
+define void @_ZN13QMetaResourceC1EPKh() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @_Z9qt_assertPKcS0_i( )
to label %endif.1 unwind label %then.i.i551
then.i.i551: ; preds = %entry
- %exn551 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn551 = landingpad {i8*, i32}
cleanup
ret void
to label %loopentry.0 unwind label %invoke_catch.6
invoke_catch.6: ; preds = %then.2
- %exn6 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn6 = landingpad {i8*, i32}
cleanup
ret void
declare i32 @__gccgo_personality_v0(i32, i64, i8*, i8*)
-define void @main.main() uwtable {
+define void @main.main() uwtable personality i32 (i32, i64, i8*, i8*)* @__gccgo_personality_v0 {
entry:
invoke void @__go_panic() noreturn
to label %0 unwind label %"5.i"
to label %main.f.exit unwind label %"7.i"
"5.i": ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gccgo_personality_v0
+ %1 = landingpad { i8*, i32 }
catch i8* null
br label %"3.i"
"7.i": ; preds = %"3.i"
- %2 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gccgo_personality_v0
+ %2 = landingpad { i8*, i32 }
catch i8* null
br label %"3.i"
@.str7 = external constant [24 x i8] ; <[24 x i8]*> [#uses=1]
@C.17.316 = external constant %struct.string___XUB ; <%struct.string___XUB*> [#uses=1]
-define void @_ada_c35503g() {
+define void @_ada_c35503g() personality i32 (...)* @__gxx_personality_v0 {
entry:
br label %bb
br label %bb123
lpad266: ; preds = %invcont129, %bb128, %bb123
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
ret i32 %J
}
-define i32 @Caller() {
+define i32 @Caller() personality i32 (...)* @__gxx_personality_v0 {
%V = invoke i32 @Callee( )
to label %Ok unwind label %Bad ; <i32> [#uses=1]
ret i32 %V
Bad: ; preds = %0
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 0
}
; RUN: opt < %s -inline -disable-output
-define i32 @main() {
+define i32 @main() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @__main( )
to label %LongJmpBlkPost unwind label %LongJmpBlkPre
LongJmpBlkPre:
%i.3 = phi i32 [ 0, %entry ]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 0
}
; RUN: opt < %s -inline -disable-output
-define i32 @main() {
+define i32 @main() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @__main( )
to label %Call2Invoke unwind label %LongJmpBlkPre
LongJmpBlkPre: ; preds = %Call2Invoke, %entry
%i.3 = phi i32 [ 0, %entry ]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
br label %exit
; RUN: opt < %s -inline -disable-output
-define i32 @main() {
+define i32 @main() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @__main( )
to label %else unwind label %RethrowExcept
br label %else
RethrowExcept: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 0
}
unreachable
}
-define fastcc void @_ZSt19__throw_logic_errorPKc() {
+define fastcc void @_ZSt19__throw_logic_errorPKc() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke fastcc void @_ZNSt11logic_errorC1ERKSs( )
to label %try_exit.0 unwind label %try_catch.0
try_catch.0: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
resume { i8*, i32 } %exn
unreachable
}
-define fastcc void @_ZNSt12length_errorC1ERKSs() {
+define fastcc void @_ZNSt12length_errorC1ERKSs() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke fastcc void @_ZNSsC1ERKSs( )
to label %_ZNSt11logic_errorC2ERKSs.exit unwind label %invoke_catch.i
invoke_catch.i: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
resume { i8*, i32 } %exn
unreachable
}
-define fastcc void @_ZNSsC1ERKSs() {
+define fastcc void @_ZNSsC1ERKSs() personality i32 (...)* @__gxx_personality_v0 {
entry:
call fastcc void @_ZNSs4_Rep7_M_grabERKSaIcES2_( )
invoke fastcc void @_ZNSaIcEC1ERKS_( )
to label %invoke_cont.1 unwind label %invoke_catch.1
invoke_catch.1: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
call fastcc void @_ZNSaIcED1Ev( )
resume { i8*, i32 } %exn
unreachable
}
-define fastcc void @_ZNSsC1ERKSs() {
+define fastcc void @_ZNSsC1ERKSs() personality i32 (...)* @__gxx_personality_v0 {
entry:
call fastcc void @_ZNSs4_Rep7_M_grabERKSaIcES2_( )
invoke fastcc void @_ZNSaIcEC1ERKS_( )
to label %invoke_cont.1 unwind label %invoke_catch.1
invoke_catch.1: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
call fastcc void @_ZNSaIcED1Ev( )
resume { i8*, i32 } %exn
unreachable
}
-define fastcc void @_ZNSt12length_errorC1ERKSs() {
+define fastcc void @_ZNSt12length_errorC1ERKSs() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke fastcc void @_ZNSsC1ERKSs( )
to label %_ZNSt11logic_errorC2ERKSs.exit unwind label %invoke_catch.i
invoke_catch.i: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
resume { i8*, i32 } %exn
unreachable
}
-define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() {
+define fastcc void @bc__support__high_resolution_time__initialize_clock_rate() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @gnat__os_lib__getenv( %struct.gnat__strings__string_access* null )
to label %invcont unwind label %cleanup144
ret void
cleanup144: ; preds = %invcont65, %invcont64, %invcont, %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
resume { i8*, i32 } %exn
}
ret void
}
-define void @main() {
+define void @main() personality i32 (...)* @__gxx_personality_v0 {
invoke fastcc void @parse()
to label %invcont unwind label %lpad
unreachable
lpad:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
;============================
; PR5208
-define void @AAA() {
+define void @AAA() personality i32 (...)* @__gxx_personality_v0 {
entry:
%A = alloca i8, i32 undef, align 1
invoke fastcc void @XXX()
unreachable
lpad156:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
declare fastcc void @YYY()
-define internal fastcc void @XXX() {
+define internal fastcc void @XXX() personality i32 (...)* @__gxx_personality_v0 {
entry:
%B = alloca i8, i32 undef, align 1
invoke fastcc void @YYY()
ret void
lpad:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
resume { i8*, i32 } %exn
}
ret void
}
-define void @f4(i32 %size) ssp {
+define void @f4(i32 %size) ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @f1(void ()* @f3)
to label %invcont3 unwind label %lpad18
ret void
lpad18: ; preds = %invcont3, %bb1
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
ret void
}
-define void @caller() {
+define void @caller() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
invoke void @inl()
to label %cont unwind label %lpad, !dbg !4
ret void
lpad:
- landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ landingpad { i8*, i32 }
cleanup
ret void
}
declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind
-define i32 @main() {
+define i32 @main() personality i32 (...)* @__gxx_personality_v0 {
%a = alloca i32 ; <i32*> [#uses=3]
%b = alloca i32 ; <i32*> [#uses=2]
store i32 1, i32* %a, align 4
ret i32 %retval
lpad:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
unreachable
}
; Make sure we are generating "call asm" instead of "invoke asm".
; CHECK: call void asm
; CHECK-LABEL: @callee_with_asm
-define void @caller() {
+define void @caller() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
br i1 undef, label %1, label %4
; <label>:1
to label %4 unwind label %2
; <label>:2
- %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %3 = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } undef
declare void @_ZSt9terminatev()
-define internal void @test0_in() alwaysinline uwtable ssp {
+define internal void @test0_in() alwaysinline uwtable ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
%a = alloca %struct.A, align 1
%b = alloca %struct.A, align 1
ret void
lpad:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
invoke void @_ZN1AD1Ev(%struct.A* %a)
to label %invoke.cont2 unwind label %terminate.lpad
resume { i8*, i32 } %exn
terminate.lpad:
- %exn1 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn1 = landingpad {i8*, i32}
catch i8* null
call void @_ZSt9terminatev() noreturn nounwind
unreachable
}
-define void @test0_out() uwtable ssp {
+define void @test0_out() uwtable ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @test0_in()
to label %ret unwind label %lpad
ret void
lpad: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* bitcast (i8** @_ZTIi to i8*)
%eh.exc = extractvalue { i8*, i32 } %exn, 0
%eh.selector = extractvalue { i8*, i32 } %exn, 1
; CHECK: invoke void @_ZN1AC1Ev(%struct.A* [[B]])
; CHECK: invoke void @_ZN1AD1Ev(%struct.A* [[B]])
; CHECK: invoke void @_ZN1AD1Ev(%struct.A* [[A]])
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: invoke void @_ZN1AD1Ev(%struct.A* [[A]])
; CHECK: [[LBL]]:
; CHECK-NEXT: br label %[[LPAD:[^\s]+]]
; CHECK: ret void
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: br label %[[LPAD]]
; CHECK: [[LPAD]]:
;; Test 1 - Correctly handle phis in outer landing pads.
-define void @test1_out() uwtable ssp {
+define void @test1_out() uwtable ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @test0_in()
to label %cont unwind label %lpad
lpad:
%x = phi i32 [ 0, %entry ], [ 1, %cont ]
%y = phi i32 [ 1, %entry ], [ 4, %cont ]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* bitcast (i8** @_ZTIi to i8*)
%eh.exc = extractvalue { i8*, i32 } %exn, 0
%eh.selector = extractvalue { i8*, i32 } %exn, 1
; Inner landing pad from first inlining.
; CHECK: [[LPAD1]]:
-; CHECK-NEXT: [[LPADVAL1:%.*]] = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK-NEXT: [[LPADVAL1:%.*]] = landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: invoke void @_ZN1AD1Ev(%struct.A* [[A1]])
; Inner landing pad from second inlining.
; CHECK: [[LPAD2]]:
-; CHECK-NEXT: [[LPADVAL2:%.*]] = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK-NEXT: [[LPADVAL2:%.*]] = landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: invoke void @_ZN1AD1Ev(%struct.A* [[A2]])
; CHECK: [[LPAD]]:
; CHECK-NEXT: [[X:%.*]] = phi i32 [ 0, %entry ], [ 0, {{%.*}} ], [ 1, %cont ], [ 1, {{%.*}} ]
; CHECK-NEXT: [[Y:%.*]] = phi i32 [ 1, %entry ], [ 1, {{%.*}} ], [ 4, %cont ], [ 4, {{%.*}} ]
-; CHECK-NEXT: [[LPADVAL:%.*]] = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK-NEXT: [[LPADVAL:%.*]] = landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: br label %[[LPAD_JOIN2]]
;; Test 2 - Don't make invalid IR for inlines into landing pads without eh.exception calls
-define void @test2_out() uwtable ssp {
+define void @test2_out() uwtable ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @test0_in()
to label %ret unwind label %lpad
ret void
lpad:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
call void @_ZSt9terminatev()
unreachable
;; Test 3 - Deal correctly with split unwind edges.
-define void @test3_out() uwtable ssp {
+define void @test3_out() uwtable ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @test0_in()
to label %ret unwind label %lpad
ret void
lpad:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* bitcast (i8** @_ZTIi to i8*)
br label %lpad.cont
}
; CHECK: define void @test3_out()
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: invoke void @_ZN1AD1Ev(
;; Test 4 - Split unwind edges with a dominance problem
-define void @test4_out() uwtable ssp {
+define void @test4_out() uwtable ssp personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @test0_in()
to label %cont unwind label %lpad.crit
ret void
lpad.crit:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* bitcast (i8** @_ZTIi to i8*)
call void @opaque() nounwind
br label %terminate
lpad:
- %exn2 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn2 = landingpad {i8*, i32}
catch i8* bitcast (i8** @_ZTIi to i8*)
br label %terminate
}
; CHECK: define void @test4_out()
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: invoke void @_ZN1AD1Ev(
; CHECK: invoke void @opaque()
; CHECK-NEXT: unwind label %lpad
; CHECK: lpad.crit:
-; CHECK-NEXT: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK-NEXT: landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: br label %[[JOIN]]
; CHECK: [[JOIN]]:
; CHECK-NEXT: call void @opaque() [[NUW:#[0-9]+]]
; CHECK-NEXT: br label %[[FIX:[^\s]+]]
; CHECK: lpad:
-; CHECK-NEXT: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK-NEXT: landingpad { i8*, i32 }
; CHECK-NEXT: catch i8* bitcast (i8** @_ZTIi to i8*)
; CHECK-NEXT: br label %[[FIX]]
; CHECK: [[FIX]]:
ret i32 %add
}
-define i32 @inner3() {
+define i32 @inner3() personality i8* null {
entry:
%invoke = invoke i32 @a() returns_twice
to label %cont unwind label %lpad
ret i32 %add
lpad:
- %lp = landingpad i32 personality i8* null cleanup
+ %lp = landingpad i32 cleanup
resume i32 %lp
}
ret i32 %add
}
-define i32 @inner4() returns_twice {
+define i32 @inner4() returns_twice personality i8* null {
entry:
%invoke = invoke i32 @a() returns_twice
to label %cont unwind label %lpad
ret i32 %add
lpad:
- %lp = landingpad i32 personality i8* null cleanup
+ %lp = landingpad i32 cleanup
resume i32 %lp
}
@exception_type2 = external global i8
-define internal void @inner() {
+define internal void @inner() personality i8* null {
invoke void @external_func()
to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad i32 personality i8* null
+ %lp = landingpad i32
catch i8* @exception_type1
resume i32 %lp
}
; this call site (PR17872), otherwise C++ destructors will not be
; called when they should be.
-define void @outer() {
+define void @outer() personality i8* null {
invoke void @inner()
to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad i32 personality i8* null
+ %lp = landingpad i32
cleanup
catch i8* @exception_type2
resume i32 %lp
; inlined function caused "catch i8* @exception_outer" to appear
; multiple times in the resulting landingpad.
-define internal void @inner_multiple_resume() {
+define internal void @inner_multiple_resume() personality i8* null {
invoke void @external_func()
to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad i32 personality i8* null
+ %lp = landingpad i32
catch i8* @exception_inner
%cond = load i1, i1* @condition
br i1 %cond, label %resume1, label %resume2
resume i32 2
}
-define void @outer_multiple_resume() {
+define void @outer_multiple_resume() personality i8* null {
invoke void @inner_multiple_resume()
to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad i32 personality i8* null
+ %lp = landingpad i32
catch i8* @exception_outer
resume i32 %lp
}
; inlined function caused "catch i8* @exception_outer" to appear
; multiple times in the resulting landingpad.
-define internal void @inner_resume_and_call() {
+define internal void @inner_resume_and_call() personality i8* null {
call void @external_func()
invoke void @external_func()
to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad i32 personality i8* null
+ %lp = landingpad i32
catch i8* @exception_inner
resume i32 %lp
}
-define void @outer_resume_and_call() {
+define void @outer_resume_and_call() personality i8* null {
invoke void @inner_resume_and_call()
to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad i32 personality i8* null
+ %lp = landingpad i32
catch i8* @exception_outer
resume i32 %lp
}
; function (since the outer function's landingpad will not be
; reachable), but it's OK to include this clause.
-define internal void @inner_no_resume_or_call() {
+define internal void @inner_no_resume_or_call() personality i8* null {
invoke void @external_func()
to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad i32 personality i8* null
+ %lp = landingpad i32
catch i8* @exception_inner
; A landingpad might have no "resume" if a C++ destructor aborts.
call void @abort() noreturn nounwind
unreachable
}
-define void @outer_no_resume_or_call() {
+define void @outer_no_resume_or_call() personality i8* null {
invoke void @inner_no_resume_or_call()
to label %cont unwind label %lpad
cont:
ret void
lpad:
- %lp = landingpad i32 personality i8* null
+ %lp = landingpad i32
catch i8* @exception_outer
resume i32 %lp
}
declare void @__cxa_end_catch()
declare void @_ZSt9terminatev()
-define void @inner1() {
+define void @inner1() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @f() to label %cont1 unwind label %terminate.lpad
ret void
terminate.lpad:
- landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ landingpad {i8*, i32}
catch i8* null
call void @_ZSt9terminatev() noreturn nounwind
unreachable
}
; caller returns true if might_throw throws an exception...
-define i32 @caller() {
+define i32 @caller() personality i32 (...)* @__gxx_personality_v0 {
invoke void @callee( )
to label %cont unwind label %exc
ret i32 0
exc: ; preds = %0
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 1
}
declare void @might_throw()
-define internal i32 @callee() {
+define internal i32 @callee() personality i32 (...)* @__gxx_personality_v0 {
invoke void @might_throw( )
to label %cont unwind label %exc
ret i32 0
exc: ; preds = %0
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 1
}
; caller returns true if might_throw throws an exception... callee cannot throw.
-define i32 @caller() {
+define i32 @caller() personality i32 (...)* @__gxx_personality_v0 {
%X = invoke i32 @callee( )
to label %cont unwind label %UnreachableExceptionHandler ; <i32> [#uses=1]
ret i32 %X
UnreachableExceptionHandler: ; preds = %0
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 -1
}
declare void @might_throw()
-define internal i32 @callee() {
+define internal i32 @callee() personality i32 (...)* @__gxx_personality_v0 {
invoke void @might_throw( )
to label %cont unwind label %exc
exc: ; preds = %0a
; This just rethrows the exception!
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
resume { i8*, i32 } %exn
}
; caller returns true if might_throw throws an exception... which gets
; propagated by callee.
-define i32 @caller() {
+define i32 @caller() personality i32 (...)* @__gxx_personality_v0 {
%X = invoke i32 @callee( )
to label %cont unwind label %Handler ; <i32> [#uses=1]
Handler: ; preds = %0
; This consumes an exception thrown by might_throw
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 1
}
declare i32* @bar()
-define float* @foo() {
+define float* @foo() personality i32 (...)* @__gxx_personality_v0 {
%tmp.11 = invoke float* bitcast (i32* ()* @bar to float* ()*)( )
to label %invoke_cont unwind label %X ; <float*> [#uses=1]
ret float* %tmp.11
X: ; preds = %0
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret float* null
}
declare i8* @test()
-define i32 @foo() {
+define i32 @foo() personality i32 (...)* @__gxx_personality_v0 {
entry:
br i1 true, label %cont, label %call
ret i32 %V
N: ; preds = %call
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i32 0
}
declare i32** @__ctype_tolower_loc() readnone
-define void @_ZNSt5ctypeIcEC2EPiPKtbm(%"struct.std::ctype<char>"* %this, i32* %unnamed_arg, i16* %__table, i8 zeroext %__del, i64 %__refs) {
+define void @_ZNSt5ctypeIcEC2EPiPKtbm(%"struct.std::ctype<char>"* %this, i32* %unnamed_arg, i16* %__table, i8 zeroext %__del, i64 %__refs) personality i32 (...)* @__gxx_personality_v0 {
entry:
%tmp8 = invoke i32* @_ZNSt6locale5facet15_S_get_c_localeEv( )
to label %invcont unwind label %lpad ; <i32*> [#uses=0]
ret void
lpad: ; preds = %invcont31, %invcont, %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
}
!0 = !{i16 0, i16 32768} ; [0, 32767]
!1 = !{i16 0, i16 32769} ; [0, 32768]
-define i16 @add_bounded_values(i16 %a, i16 %b) {
+define i16 @add_bounded_values(i16 %a, i16 %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; CHECK-LABEL: @add_bounded_values(
entry:
%c = call i16 @bounded(i16 %a), !range !0
; CHECK: add nuw i16 %c, %d
ret i16 %e
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
ret i16 42
}
-define i16 @add_bounded_values_2(i16 %a, i16 %b) {
+define i16 @add_bounded_values_2(i16 %a, i16 %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; CHECK-LABEL: @add_bounded_values_2(
entry:
%c = call i16 @bounded(i16 %a), !range !1
; CHECK: add i16 %c, %d
ret i16 %e
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
ret i16 42
}
declare void @bar()
-define void @foo_generic() {
+define void @foo_generic() personality i32 (i32, i64, i8*, i8*)* @generic_personality {
; CHECK-LABEL: @foo_generic(
invoke void @bar()
to label %cont.a unwind label %lpad.a
ret void
lpad.a:
- %a = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %a = landingpad { i8*, i32 }
catch i32* @T1
catch i32* @T2
catch i32* @T1
; CHECK-NEXT: unreachable
lpad.b:
- %b = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %b = landingpad { i8*, i32 }
filter [0 x i32*] zeroinitializer
catch i32* @T1
unreachable
; CHECK-NEXT: unreachable
lpad.c:
- %c = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %c = landingpad { i8*, i32 }
catch i32* @T1
filter [1 x i32*] [i32* @T1]
catch i32* @T2
; CHECK-NEXT: unreachable
lpad.d:
- %d = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %d = landingpad { i8*, i32 }
filter [3 x i32*] zeroinitializer
unreachable
; CHECK: %d = landingpad
; CHECK-NEXT: unreachable
lpad.e:
- %e = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %e = landingpad { i8*, i32 }
catch i32* @T1
filter [3 x i32*] [i32* @T1, i32* @T2, i32* @T2]
unreachable
; CHECK-NEXT: unreachable
lpad.f:
- %f = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %f = landingpad { i8*, i32 }
filter [2 x i32*] [i32* @T2, i32* @T1]
filter [1 x i32*] [i32* @T1]
unreachable
; CHECK-NEXT: unreachable
lpad.g:
- %g = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %g = landingpad { i8*, i32 }
filter [1 x i32*] [i32* @T1]
catch i32* @T3
filter [2 x i32*] [i32* @T2, i32* @T1]
; CHECK-NEXT: unreachable
lpad.h:
- %h = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %h = landingpad { i8*, i32 }
filter [2 x i32*] [i32* @T1, i32* null]
filter [1 x i32*] zeroinitializer
unreachable
; CHECK-NEXT: unreachable
lpad.i:
- %i = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @generic_personality
+ %i = landingpad { i8*, i32 }
cleanup
filter [0 x i32*] zeroinitializer
unreachable
; CHECK-NEXT: unreachable
}
-define void @foo_cxx() {
+define void @foo_cxx() personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
; CHECK-LABEL: @foo_cxx(
invoke void @bar()
to label %cont.a unwind label %lpad.a
ret void
lpad.a:
- %a = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %a = landingpad { i8*, i32 }
catch i32* null
catch i32* @T1
unreachable
; CHECK-NEXT: unreachable
lpad.b:
- %b = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %b = landingpad { i8*, i32 }
filter [1 x i32*] zeroinitializer
unreachable
; CHECK: %b = landingpad
; CHECK-NEXT: unreachable
lpad.c:
- %c = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %c = landingpad { i8*, i32 }
filter [2 x i32*] [i32* @T1, i32* null]
unreachable
; CHECK: %c = landingpad
; CHECK-NEXT: unreachable
lpad.d:
- %d = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %d = landingpad { i8*, i32 }
cleanup
catch i32* null
unreachable
; CHECK-NEXT: unreachable
}
-define void @foo_objc() {
+define void @foo_objc() personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0 {
; CHECK-LABEL: @foo_objc(
invoke void @bar()
to label %cont.a unwind label %lpad.a
ret void
lpad.a:
- %a = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0
+ %a = landingpad { i8*, i32 }
catch i32* null
catch i32* @T1
unreachable
; CHECK-NEXT: unreachable
lpad.b:
- %b = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0
+ %b = landingpad { i8*, i32 }
filter [1 x i32*] zeroinitializer
unreachable
; CHECK: %b = landingpad
; CHECK-NEXT: unreachable
lpad.c:
- %c = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0
+ %c = landingpad { i8*, i32 }
filter [2 x i32*] [i32* @T1, i32* null]
unreachable
; CHECK: %c = landingpad
; CHECK-NEXT: unreachable
lpad.d:
- %d = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__objc_personality_v0
+ %d = landingpad { i8*, i32 }
cleanup
catch i32* null
unreachable
; CHECK-NEXT: unreachable
}
-define void @foo_seh() {
+define void @foo_seh() personality i32 (...)* @__C_specific_handler {
; CHECK-LABEL: @foo_seh(
invoke void @bar()
to label %cont.a unwind label %lpad.a
ret void
lpad.a:
- %a = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %a = landingpad { i8*, i32 }
catch i32* null
catch i32* @T1
unreachable
; CHECK-NEXT: unreachable
lpad.b:
- %b = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %b = landingpad { i8*, i32 }
filter [1 x i32*] zeroinitializer
unreachable
; CHECK: %b = landingpad
; CHECK-NEXT: unreachable
lpad.c:
- %c = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %c = landingpad { i8*, i32 }
filter [2 x i32*] [i32* @T1, i32* null]
unreachable
; CHECK: %c = landingpad
; CHECK-NEXT: unreachable
lpad.d:
- %d = landingpad { i8*, i32 } personality i32 (...)* @__C_specific_handler
+ %d = landingpad { i8*, i32 }
cleanup
catch i32* null
unreachable
; rdar://7590304
declare void @test8a()
-define i8* @test8() {
+define i8* @test8() personality i32 (...)* @__gxx_personality_v0 {
; CHECK-LABEL: @test8(
; CHECK-NEXT: invoke void @test8a()
; Don't turn this into "unreachable": the callee and caller don't agree in
unreachable
try.handler: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
ret i8* null
}
}
declare i32 @__gxx_personality_v0(...)
-define void @test_invoke_vararg_cast(i32* %a, i32* %b) {
+define void @test_invoke_vararg_cast(i32* %a, i32* %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%0 = bitcast i32* %b to i8*
%1 = bitcast i32* %a to i64*
ret void
lpad: ; preds = %entry
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %2 = landingpad { i8*, i32 }
cleanup
ret void
; CHECK-LABEL: test_invoke_vararg_cast
ret i32 0
}
-define void @test5() {
+define void @test5() personality i32 (...)* @__gxx_personality_v0 {
store i1 true, i1* undef
%r = invoke i32 @test5a() to label %exit unwind label %unwind
unwind:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
br label %exit
exit:
%class.RuleBasedBreakIterator = type { i64 ()* }
%class.UStack = type { i8** }
-define i32 @_ZN22RuleBasedBreakIterator15checkDictionaryEi(%class.RuleBasedBreakIterator* %this, i32 %x) align 2 {
+define i32 @_ZN22RuleBasedBreakIterator15checkDictionaryEi(%class.RuleBasedBreakIterator* %this, i32 %x) align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%breaks = alloca %class.UStack, align 4 ; <%class.UStack*> [#uses=3]
call void @_ZN6UStackC1Ei(%class.UStack* %breaks, i32 0)
br i1 %tobool, label %cond.end, label %cond.false
terminate.handler: ; preds = %ehcleanup
- %exc = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %exc = landingpad { i8*, i32 }
cleanup
call void @_ZSt9terminatev() noreturn nounwind
unreachable
ehcleanup: ; preds = %cond.false
- %exc1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %exc1 = landingpad { i8*, i32 }
catch i8* null
invoke void @_ZN6UStackD1Ev(%class.UStack* %breaks)
to label %cont unwind label %terminate.handler
; rdar://7590304
-define i8* @test10(i8* %self, i8* %tmp3) {
+define i8* @test10(i8* %self, i8* %tmp3) personality i32 (...)* @__gxx_personality_v0 {
entry:
store i1 true, i1* undef
store i1 true, i1* undef
unreachable
try.handler: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
ret i8* %self
}
declare void @test18b() noreturn
declare void @test18foo(double**)
declare void @test18a() noreturn
-define fastcc void @test18x(i8* %t0, i1 %b) uwtable align 2 {
+define fastcc void @test18x(i8* %t0, i1 %b) uwtable align 2 personality i32 (...)* @__gxx_personality_v0 {
entry:
br i1 %b, label %e1, label %e2
e1:
to label %u unwind label %lpad
lpad:
%t5 = phi double** [ %t2, %e1 ], [ %t4, %e2 ]
- %lpad.nonloopexit262 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %lpad.nonloopexit262 = landingpad { i8*, i32 }
cleanup
call void @test18foo(double** %t5)
unreachable
; Check that instcombine doesn't insert GEPs before landingpad.
-define i32 @test3(%struct3* %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19, i64 %tmp20, i64 %tmp21) {
+define i32 @test3(%struct3* %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19, i64 %tmp20, i64 %tmp21) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
bb:
%tmp = getelementptr inbounds %struct3, %struct3* %dm, i64 0
br i1 %tmp4, label %bb1, label %bb2
ret i32 0
bb5:
- %tmp27 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* bitcast (i8** @_ZTIi to i8*)
+ %tmp27 = landingpad { i8*, i32 } catch i8* bitcast (i8** @_ZTIi to i8*)
%tmp34 = getelementptr inbounds %struct4, %struct4* %phi, i64 %tmp21, i32 1
%tmp35 = getelementptr inbounds %struct2, %struct2* %tmp34, i64 0, i32 1
%tmp25 = load i32, i32* %tmp35, align 4
; CHECK-LABEL: @test3(
; CHECK: bb5:
-; CHECK-NEXT: {{.*}}landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+; CHECK-NEXT: {{.*}}landingpad { i8*, i32 }
}
@_ZTIi = external constant i8*
; CHECK-LABEL: @f1(
-define i64 @f1() nounwind uwtable ssp {
+define i64 @f1() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK: nvoke noalias i8* undef()
%call = invoke noalias i8* undef()
ret i64 %0
lpad:
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%2 = extractvalue { i8*, i32 } %1, 0
tail call void @__cxa_call_unexpected(i8* %2) noreturn nounwind
}
; CHECK-LABEL: @f2(
-define i64 @f2() nounwind uwtable ssp {
+define i64 @f2() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK: nvoke noalias i8* null()
%call = invoke noalias i8* null()
ret i64 %0
lpad:
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%2 = extractvalue { i8*, i32 } %1, 0
tail call void @__cxa_call_unexpected(i8* %2) noreturn nounwind
}
; CHECK-LABEL: @f3(
-define void @f3() nounwind uwtable ssp {
+define void @f3() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; CHECK: invoke void @llvm.donothing()
%call = invoke noalias i8* @_Znwm(i64 13)
to label %invoke.cont unwind label %lpad
ret void
lpad:
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%2 = extractvalue { i8*, i32 } %1, 0
tail call void @__cxa_call_unexpected(i8* %2) noreturn nounwind
declare void @_ZN1AC2Ev(i8* %this)
; CHECK-LABEL: @test7(
-define void @test7() {
+define void @test7() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%nt = alloca i8
; CHECK-NOT: call {{.*}}@_ZnwmRKSt9nothrow_t(
unreachable
lpad.i: ; preds = %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup
+ %0 = landingpad { i8*, i32 } cleanup
; CHECK-NOT: call {{.*}}@_ZdlPvRKSt9nothrow_t(
call void @_ZdlPvRKSt9nothrow_t(i8* %call.i, i8* %nt) builtin nounwind
resume { i8*, i32 } %0
; CHECK-LABEL: @f2(
-define i64 @f2(i8** %esc) nounwind uwtable ssp {
+define i64 @f2(i8** %esc) nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK: invoke noalias i8* @_Znwm(i64 13)
%call = invoke noalias i8* @_Znwm(i64 13)
ret i64 %0
lpad:
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%2 = extractvalue { i8*, i32 } %1, 0
tail call void @__cxa_call_unexpected(i8* %2) noreturn nounwind
declare void @bar()
-define void @test1() {
+define void @test1() personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
entry:
invoke void @bar() to label %cont unwind label %lpad
cont:
ret void
lpad:
- %ex = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 cleanup
+ %ex = landingpad { i8*, i32 } cleanup
%exc_ptr = extractvalue { i8*, i32 } %ex, 0
%filter = extractvalue { i8*, i32 } %ex, 1
%exc_ptr2 = insertvalue { i8*, i32 } undef, i8* %exc_ptr, 0
ret void
}
-define void @_Z3fn1v() uwtable {
+define void @_Z3fn1v() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%call = call noalias i8* @_Znwm() #8
invoke void @_ZN24CompositeEditCommandImplC2Ev()
ret void
lpad: ; preds = %entry
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %4 = landingpad { i8*, i32 }
cleanup
call void @_ZdlPv() #9
unreachable
lpad1: ; preds = %_ZN1DC1Ev.exit, %_ZN15EditCommandImpl5applyEv.exit
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %5 = landingpad { i8*, i32 }
cleanup
%6 = load i32, i32* %1, align 4
%tobool.i.i.i = icmp eq i32 %6, 0
resume { i8*, i32 } undef
terminate.lpad: ; No predecessors!
- %7 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %7 = landingpad { i8*, i32 }
catch i8* null
unreachable
}
@.str32190 = external constant [92 x i8], align 1 ; <[92 x i8]*> [#uses=1]
@.str41 = external constant [25 x i8], align 1 ; <[25 x i8]*> [#uses=1]
-define void @_ZN8EtherBus10initializeEv() {
+define void @_ZN8EtherBus10initializeEv() personality i32 (...)* @__gxx_personality_v0 {
entry:
br i1 undef, label %_ZN7cObjectnwEj.exit, label %bb.i
to label %.noexc unwind label %lpad119 ; <i8*> [#uses=1]
lpad: ; preds = %_ZN7cObjectnwEj.exit
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
br label %Unwind
lpad119: ; preds = %bb106, %invcont104, %invcont103, %bb102, %bb49, %bb34, %bb12, %invcont10, %invcont9, %bb8
- %exn119 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn119 = landingpad {i8*, i32}
cleanup
unreachable
lpad123: ; preds = %.noexc
- %exn123 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn123 = landingpad {i8*, i32}
cleanup
%tmp5 = icmp eq i8* %tmp4, null ; <i1> [#uses=1]
br i1 %tmp5, label %Unwind, label %bb.i2
@_ZTIi = external constant i8*
; Verify dominators.
-define void @test3(i32 %x) {
+define void @test3(i32 %x) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%cmp2 = icmp eq i32 0, %x
br i1 %cmp2, label %try.cont.loopexit, label %for.body.lr.ph
br i1 %cmp, label %for.cond.try.cont.loopexit_crit_edge, label %for.body
lpad: ; preds = %for.body
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%1 = extractvalue { i8*, i32 } %0, 0
%2 = extractvalue { i8*, i32 } %0, 1
br i1 %cmp.i, label %for.cond.i.invoke.cont2.loopexit_crit_edge, label %for.body.i
lpad.i: ; preds = %for.body.i
- %5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %5 = landingpad { i8*, i32 }
catch i8* bitcast (i8** @_ZTIi to i8*)
%6 = extractvalue { i8*, i32 } %5, 0
%7 = extractvalue { i8*, i32 } %5, 1
br label %invoke.cont2
lpad1.i: ; preds = %catch.i
- %9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %9 = landingpad { i8*, i32 }
cleanup
%10 = extractvalue { i8*, i32 } %9, 0
%11 = extractvalue { i8*, i32 } %9, 1
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-s0:0:64-f80:32:32"
target triple = "i686-pc-mingw32"
-define void @func() {
+define void @func() personality i32 (...)* @__gxx_personality_v0 {
bb_init:
br label %bb_main
br label %bb_main
invcont17.normaldest.normaldest: ; No predecessors!
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
store i32 %tmp23, i32* undef
br label %bb_main
@catchtypeinfo = external unnamed_addr constant { i8*, i8*, i8* }
-define void @main() uwtable ssp {
+define void @main() uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @f1()
to label %try.cont19 unwind label %catch
; CHECK: br label %catch
catch: ; preds = %if.else, %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast ({ i8*, i8*, i8* }* @catchtypeinfo to i8*)
invoke void @f3()
to label %if.else unwind label %eh.resume
ret void
eh.resume: ; preds = %catch
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
catch i8* bitcast ({ i8*, i8*, i8* }* @catchtypeinfo to i8*)
resume { i8*, i32 } undef
; CHECK: catch.preheader.split-lp:
; CHECK: br label %catch, !dbg [[LPAD_PREHEADER_LOC]]
-define void @with_landingpad() uwtable ssp {
+define void @with_landingpad() uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @f1() to label %try.cont19 unwind label %catch, !dbg !13
catch: ; preds = %if.else, %entry
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* bitcast ({ i8*, i8*, i8* }* @catchtypeinfo to i8*), !dbg !13
invoke void @f3() to label %if.else unwind label %eh.resume, !dbg !13
ret void, !dbg !13
eh.resume: ; preds = %catch
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup catch i8* bitcast ({ i8*, i8*, i8* }* @catchtypeinfo to i8*), !dbg !13
resume { i8*, i32 } undef, !dbg !13
}
declare i8* @_Znwm()
declare i32 @__gxx_personality_v0(...)
declare void @g()
-define void @f() {
+define void @f() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
bb0:
br label %bb1
bb1:
%v3 = invoke noalias i8* @_Znwm()
to label %bb5 unwind label %bb4
bb4:
- %v4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %v4 = landingpad { i8*, i32 }
cleanup
br label %bb9
bb5:
bb7:
unreachable
bb8:
- %v7 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %v7 = landingpad { i8*, i32 }
cleanup
br label %bb9
bb9:
}
-define void @h() {
+define void @h() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
bb1:
invoke void @g() optsize
to label %bb2 unwind label %bb5
bb4:
ret void
bb5:
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp = landingpad { i8*, i32 }
cleanup
invoke void @g() optsize
to label %bb4 unwind label %bb7
bb6:
- %tmp1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %tmp1 = landingpad { i8*, i32 }
cleanup
%arraydestroy.isempty = icmp eq i8* undef, %arrayctor.cur
ret void
bb7:
- %lpad.nonloopexit = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %lpad.nonloopexit = landingpad { i8*, i32 }
catch i8* null
ret void
}
%class.MyContainer.1.3.19.29 = type { [6 x %class.MyMemVarClass.0.2.18.28*] }
%class.MyMemVarClass.0.2.18.28 = type { i32 }
-define void @_ZN11MyContainer1fEi(%class.MyContainer.1.3.19.29* %this, i32 %doit) uwtable ssp align 2 {
+define void @_ZN11MyContainer1fEi(%class.MyContainer.1.3.19.29* %this, i32 %doit) uwtable ssp align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
br label %for.cond
br label %for.inc
lpad: ; preds = %delete.notnull
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
%2 = extractvalue { i8*, i32 } %1, 0
%3 = extractvalue { i8*, i32 } %1, 1
%class.B.21.41.65.101.137.157.177.197.237.241.245.249.261.293.301.337.345.378 = type { %class.A.20.40.64.100.136.156.176.196.236.240.244.248.260.292.300.336.344.377* }
%class.A.20.40.64.100.136.156.176.196.236.240.244.248.260.292.300.336.344.377 = type { i8 }
-define void @_Z23get_reconstruction_pathv() uwtable ssp {
+define void @_Z23get_reconstruction_pathv() uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%c = alloca %class.D.22.42.66.102.138.158.178.198.238.242.246.250.262.294.302.338.346.379, align 8
br label %for.cond
br i1 undef, label %for.cond3, label %for.end
lpad: ; preds = %for.end, %invoke.cont4, %for.cond3, %invoke.cont, %for.cond
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } undef
declare void @bar()
-define void @foo() {
+define void @foo() personality i32 (...)* @__gxx_personality_v0 {
then:
invoke void @baz( )
to label %invoke_cont.0 unwind label %try_catch
to label %try_exit unwind label %try_catch
try_catch: ; preds = %invoke_cont.0, %then
%__tmp.0 = phi i32* [ null, %invoke_cont.0 ], [ null, %then ] ; <i32*> [#uses=0]
- %res = landingpad { i8* } personality i32 (...)* @__gxx_personality_v0
+ %res = landingpad { i8* }
cleanup
ret void
try_exit: ; preds = %invoke_cont.0
declare i32 @external_func(i64 %arg)
-define i32 @invoke_test(i64 %arg) {
+define i32 @invoke_test(i64 %arg) personality i8* null {
entry:
%result = invoke fastcc i32 @external_func(i64 inreg %arg)
to label %cont unwind label %lpad
ret i32 %result
lpad:
%phi = phi i32 [ 99, %entry ]
- %lp = landingpad { i8*, i32 } personality i8* null cleanup
+ %lp = landingpad { i8*, i32 } cleanup
ret i32 %phi
}
declare i32 @test1f()
-define i32 @test1() {
+define i32 @test1() personality i32 (...)* @__gxx_personality_v0 {
entry:
%whichFlag = alloca i32
%A = invoke i32 @test1f()
ret i32 %B
lpad86:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
br label %bb15
@.str = external constant [1 x i8], align 1
@_ZTVN2kc22impl_fileline_FileLineE = external constant [13 x i32 (...)*], align 32
-define void @_ZN2kc22impl_fileline_FileLineC2EPNS_20impl_casestring__StrEi(%"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_casestring__Str"* %_file, i32 %_line) align 2 {
+define void @_ZN2kc22impl_fileline_FileLineC2EPNS_20impl_casestring__StrEi(%"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_casestring__Str"* %_file, i32 %_line) align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%this_addr = alloca %"struct.kc::impl_fileline_FileLine"*, align 4
%_file_addr = alloca %"struct.kc::impl_casestring__Str"*, align 4
ret void
lpad: ; preds = %bb
- %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %eh_ptr = landingpad { i8*, i32 }
cleanup
%exn = extractvalue { i8*, i32 } %eh_ptr, 0
store i8* %exn, i8** %eh_exception
ret void
}
-define void @_ZN2kc22impl_fileline_FileLineC1EPNS_20impl_casestring__StrEi(%"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_casestring__Str"* %_file, i32 %_line) align 2 {
+define void @_ZN2kc22impl_fileline_FileLineC1EPNS_20impl_casestring__StrEi(%"struct.kc::impl_fileline_FileLine"* %this, %"struct.kc::impl_casestring__Str"* %_file, i32 %_line) align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%this_addr = alloca %"struct.kc::impl_fileline_FileLine"*, align 4
%_file_addr = alloca %"struct.kc::impl_casestring__Str"*, align 4
ret void
lpad: ; preds = %bb
- %eh_ptr = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %eh_ptr = landingpad { i8*, i32 }
cleanup
%exn = extractvalue { i8*, i32 } %eh_ptr, 0
store i8* %exn, i8** %eh_exception
ret i8 %out
}
-define i8 @invoke_with_range() {
+define i8 @invoke_with_range() personality i8* undef {
%out = invoke i8 @dummy() to label %next unwind label %lpad, !range !0
next:
ret i8 %out
lpad:
- %pad = landingpad { i8*, i32 } personality i8* undef cleanup
+ %pad = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } zeroinitializer
}
-define i8 @invoke_no_range() {
+define i8 @invoke_no_range() personality i8* undef {
; CHECK-LABEL: @invoke_no_range()
; CHECK-NEXT: invoke i8 @dummy
%out = invoke i8 @dummy() to label %next unwind label %lpad
ret i8 %out
lpad:
- %pad = landingpad { i8*, i32 } personality i8* undef cleanup
+ %pad = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } zeroinitializer
}
-define i8 @invoke_different_range() {
+define i8 @invoke_different_range() personality i8* undef {
; CHECK-LABEL: @invoke_different_range()
; CHECK-NEXT: invoke i8 @dummy
%out = invoke i8 @dummy() to label %next unwind label %lpad, !range !1
ret i8 %out
lpad:
- %pad = landingpad { i8*, i32 } personality i8* undef cleanup
+ %pad = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } zeroinitializer
}
ret i8 %out
}
-define i8 @invoke_with_same_range() {
+define i8 @invoke_with_same_range() personality i8* undef {
; CHECK-LABEL: @invoke_with_same_range()
; CHECK: tail call i8 @invoke_with_range()
%out = invoke i8 @dummy() to label %next unwind label %lpad, !range !0
ret i8 %out
lpad:
- %pad = landingpad { i8*, i32 } personality i8* undef cleanup
+ %pad = landingpad { i8*, i32 } cleanup
resume { i8*, i32 } zeroinitializer
}
; CHECK: %tmp1 = tail call i8* @objc_retain(i8* %tmp) [[NUW]]
; CHECK-NEXT: invoke
; CHECK: }
-define void @test20(double* %self) {
+define void @test20(double* %self) personality i32 (...)* @__gxx_personality_v0 {
if.then12:
%tmp = bitcast double* %self to i8*
%tmp1 = call i8* @objc_retain(i8* %tmp) nounwind
lpad20: ; preds = %invoke.cont23, %if.then12
%tmp502 = phi double* [ undef, %invoke.cont23 ], [ %self, %if.then12 ]
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
unreachable
; call, handle the case where it's an invoke in a different basic block.
; rdar://11714057
-; CHECK: define void @_Z6doTestP8NSString() {
+; CHECK: define void @_Z6doTestP8NSString() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
; CHECK: invoke.cont: ; preds = %entry
; CHECK-NEXT: call void asm sideeffect "mov\09r7, r7\09\09@ marker for objc_retainAutoreleaseReturnValue", ""()
; CHECK-NEXT: %tmp = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %call) [[NUW:#[0-9]+]]
; CHECK: }
-define void @_Z6doTestP8NSString() {
+define void @_Z6doTestP8NSString() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%call = invoke i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* ()*)()
to label %invoke.cont unwind label %lpad
unreachable
lpad: ; preds = %entry
- %tmp1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1 = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } undef
}
@"\01L_OBJC_SELECTOR_REFERENCES_5" = internal global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_OBJC_METH_VAR_NAME_4", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
@llvm.used = appending global [6 x i8*] [i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_" to i8*), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_" to i8*), i8* bitcast (%struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_1" to i8*), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @"\01L_OBJC_METH_VAR_NAME_4", i32 0, i32 0), i8* bitcast (i8** @"\01L_OBJC_SELECTOR_REFERENCES_5" to i8*)], section "llvm.metadata"
-define i32 @main() uwtable ssp {
+define i32 @main() uwtable ssp personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
%tmp = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_", align 8, !dbg !37
%tmp1 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8, !dbg !37, !invariant.load !38
br label %if.end, !dbg !43
lpad: ; preds = %entry
- %tmp4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %tmp4 = landingpad { i8*, i32 }
catch i8* null, !dbg !40
%tmp5 = extractvalue { i8*, i32 } %tmp4, 0, !dbg !40
%exn.adjusted = call i8* @objc_begin_catch(i8* %tmp5) nounwind, !dbg !44
; CHECK: call void @objc_release(i8* %zipFile) [[NUW]], !clang.imprecise_release !0
; CHECK: ret void
; CHECK-NEXT: }
-define void @test0(i8* %zipFile) {
+define void @test0(i8* %zipFile) personality i32 (...)* @__gxx_personality_v0 {
entry:
call i8* @objc_retain(i8* %zipFile) nounwind
call void @use_pointer(i8* %zipFile)
ret void
lpad: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
call void @objc_release(i8* %zipFile) nounwind, !clang.imprecise_release !0
ret void
; CHECK: done:
; CHECK-NEXT: ret void
; CHECK-NEXT: }
-define void @test1(i8* %zipFile) {
+define void @test1(i8* %zipFile) personality i32 (...)* @__gxx_personality_v0 {
entry:
call i8* @objc_retain(i8* %zipFile) nounwind
call void @use_pointer(i8* %zipFile)
br label %done
lpad: ; preds = %entry
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
call void @callee()
br label %done
; The optimizer should ignore invoke unwind paths consistently.
; PR12265
-; CHECK: define void @test2() {
+; CHECK: define void @test2() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
; CHECK: invoke.cont:
; CHECK-NEXT: call i8* @objc_retain
; CHECK-NOT: @objc_r
; CHECK: finally.rethrow:
; CHECK-NOT: @objc
; CHECK: }
-define void @test2() {
+define void @test2() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
%call = invoke i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* ()*)()
to label %invoke.cont unwind label %finally.rethrow, !clang.arc.no_objc_arc_exceptions !0
ret void
finally.rethrow: ; preds = %invoke.cont, %entry
- %tmp2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %tmp2 = landingpad { i8*, i32 }
catch i8* null
unreachable
}
; CHECK-NEXT: call void @objc_release(i8* %p) [[NUW]]
; CHECK-NEXT: ret void
; CHECK-NEXT: }
-define void @test3(i8* %p, i1 %b) {
+define void @test3(i8* %p, i1 %b) personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
%0 = call i8* @objc_retain(i8* %p)
call void @callee()
to label %if.end unwind label %lpad, !clang.arc.no_objc_arc_exceptions !0
lpad:
- %r = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %r = landingpad { i8*, i32 }
cleanup
ret void
; CHECK-LABEL: define void @test4(
; CHECK: lpad:
-; CHECK-NEXT: %r = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+; CHECK-NEXT: %r = landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: call void @objc_release(i8* %p) [[NUW]]
; CHECK-NEXT: ret void
; CHECK-NEXT: call void @objc_release(i8* %p) [[NUW]]
; CHECK-NEXT: ret void
; CHECK-NEXT: }
-define void @test4(i8* %p, i1 %b) {
+define void @test4(i8* %p, i1 %b) personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
%0 = call i8* @objc_retain(i8* %p)
call void @callee()
to label %if.end unwind label %lpad
lpad:
- %r = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %r = landingpad { i8*, i32 }
cleanup
call void @objc_release(i8* %p)
ret void
; CHECK-LABEL: define void @test5(
; CHECK: call i8* @objc_retainAutoreleasedReturnValue(i8* %z)
; CHECK: }
-define void @test5() {
+define void @test5() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
%z = invoke i8* @returner()
to label %if.end unwind label %lpad, !clang.arc.no_objc_arc_exceptions !0
lpad:
- %r13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %r13 = landingpad { i8*, i32 }
cleanup
ret void
; CHECK-LABEL: define void @test6(
; CHECK: call i8* @objc_retain(i8* %z)
; CHECK: }
-define void @test6() {
+define void @test6() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
%z = invoke i8* @returner()
to label %if.end unwind label %lpad, !clang.arc.no_objc_arc_exceptions !0
lpad:
- %r13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %r13 = landingpad { i8*, i32 }
cleanup
ret void
declare i32 @__objc_personality_v0(...)
-define hidden void @test1() {
+define hidden void @test1() personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
br i1 undef, label %msgSend.nullinit, label %msgSend.call
}
; Function Attrs: ssp
-define void @test3() #1 {
+define void @test3() #1 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
entry:
%call2 = invoke i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8*)*)(i8* undef, i8* undef, i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring to i8*))
to label %invoke.cont unwind label %lpad
br label %invoke.cont8
lpad.i: ; preds = %land.end
- %tmp13 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp13 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont24
lpad.i1982: ; preds = %invoke.cont21
- %tmp28 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp28 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont44
lpad.i1988: ; preds = %land.end43
- %tmp42 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp42 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont91
lpad.i2000: ; preds = %invoke.cont71
- %tmp74 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp74 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup102
br label %invoke.cont100
lpad.i2006: ; preds = %invoke.cont97
- %tmp82 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp82 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont117
lpad.i2012: ; preds = %invoke.cont110
- %tmp98 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp98 = landingpad { i8*, i32 }
cleanup
unreachable
to label %invoke.cont.i2022 unwind label %lpad156.body
lpad: ; preds = %entry
- %tmp118 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp118 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup
lpad3: ; preds = %land.rhs, %invoke.cont
- %tmp119 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp119 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup
unreachable
lpad16: ; preds = %invoke.cont8
- %tmp121 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp121 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup26
lpad20: ; preds = %invoke.cont17
- %tmp122 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp122 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup26
unreachable
lpad35: ; preds = %land.rhs39, %invoke.cont24
- %tmp124 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp124 = landingpad { i8*, i32 }
cleanup
unreachable
lpad51: ; preds = %invoke.cont44
- %tmp125 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp125 = landingpad { i8*, i32 }
cleanup
unreachable
lpad61: ; preds = %land.rhs58
- %tmp127 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp127 = landingpad { i8*, i32 }
cleanup
unreachable
lpad66.body.thread: ; preds = %invoke.cont62
- %tmp128 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp128 = landingpad { i8*, i32 }
cleanup
unreachable
lpad66.body: ; preds = %land.end70
- %tmp129 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp129 = landingpad { i8*, i32 }
cleanup
unreachable
lpad94: ; preds = %invoke.cont95, %invoke.cont91
- %tmp133 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp133 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup102
unreachable
lpad109: ; preds = %invoke.cont100
- %tmp134 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp134 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont190
lpad.i2036: ; preds = %invoke.cont185
- %tmp168 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp168 = landingpad { i8*, i32 }
cleanup
br label %lpad183.body
br label %invoke.cont207
lpad.i2042: ; preds = %invoke.cont204
- %tmp181 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp181 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont231
lpad.i2054: ; preds = %invoke.cont228
- %tmp198 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp198 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont281
lpad.i2066: ; preds = %invoke.cont278
- %tmp253 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp253 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont373
lpad.i2078: ; preds = %invoke.cont370
- %tmp340 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp340 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont392
lpad.i2084: ; preds = %invoke.cont383
- %tmp360 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp360 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont405
lpad.i2090: ; preds = %invoke.cont402
- %tmp370 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp370 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont418
lpad.i2096: ; preds = %invoke.cont412
- %tmp380 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp380 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont432
lpad.i2102: ; preds = %invoke.cont429
- %tmp390 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp390 = landingpad { i8*, i32 }
cleanup
unreachable
to label %invoke.cont443 unwind label %lpad381
lpad.i2108: ; preds = %invoke.cont435
- %tmp396 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp396 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont449
lpad.i2114: ; preds = %invoke.cont443
- %tmp402 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp402 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont458
lpad.i2120: ; preds = %invoke.cont455
- %tmp408 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp408 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont466
lpad.i2126: ; preds = %invoke.cont460
- %tmp414 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp414 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup477
br label %invoke.cont475
lpad.i2132: ; preds = %invoke.cont469
- %tmp420 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp420 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup477
br label %invoke.cont521
lpad.i2138: ; preds = %msgSend.cont
- %tmp468 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp468 = landingpad { i8*, i32 }
cleanup
unreachable
br label %invoke.cont540
lpad.i2144: ; preds = %invoke.cont534
- %tmp486 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp486 = landingpad { i8*, i32 }
cleanup
unreachable
to label %invoke.cont566 unwind label %lpad565
lpad.i2150: ; preds = %invoke.cont554
- %tmp500 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp500 = landingpad { i8*, i32 }
cleanup
call void @objc_release(i8* %tmp499) #3, !clang.imprecise_release !0
unreachable
unreachable
lpad156.body: ; preds = %invoke.cont117
- %tmp1157 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1157 = landingpad { i8*, i32 }
cleanup
unreachable
lpad164.body: ; preds = %invoke.cont157
- %tmp1158 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1158 = landingpad { i8*, i32 }
cleanup
unreachable
lpad183: ; preds = %invoke.cont184, %invoke.cont165
- %tmp1159 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1159 = landingpad { i8*, i32 }
cleanup
br label %lpad183.body
unreachable
lpad196: ; preds = %invoke.cont190
- %tmp1160 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1160 = landingpad { i8*, i32 }
cleanup
unreachable
lpad200: ; preds = %invoke.cont197
- %tmp1161 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1161 = landingpad { i8*, i32 }
cleanup
unreachable
lpad203: ; preds = %invoke.cont207, %invoke.cont201
- %tmp1162 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1162 = landingpad { i8*, i32 }
cleanup
unreachable
lpad212.body: ; preds = %invoke.cont208
- %tmp1163 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1163 = landingpad { i8*, i32 }
cleanup
unreachable
lpad220: ; preds = %invoke.cont213
- %tmp1164 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1164 = landingpad { i8*, i32 }
cleanup
br label %eh.resume
lpad227: ; preds = %invoke.cont231, %invoke.cont221
- %tmp1166 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1166 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup239
lpad236.body: ; preds = %invoke.cont232
- %tmp1167 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1167 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup239
unreachable
lpad244: ; preds = %invoke.cont245, %invoke.cont237
- %tmp1168 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1168 = landingpad { i8*, i32 }
cleanup
unreachable
lpad249: ; preds = %invoke.cont247
- %tmp1169 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1169 = landingpad { i8*, i32 }
cleanup
unreachable
lpad252: ; preds = %invoke.cont250
- %tmp1170 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1170 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup263
lpad255: ; preds = %invoke.cont253
- %tmp1171 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1171 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup263
lpad258: ; preds = %invoke.cont256
- %tmp1172 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1172 = landingpad { i8*, i32 }
cleanup
unreachable
unreachable
lpad265: ; preds = %invoke.cont259
- %tmp1173 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1173 = landingpad { i8*, i32 }
cleanup
unreachable
lpad273: ; preds = %invoke.cont266
- %tmp1175 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1175 = landingpad { i8*, i32 }
cleanup
unreachable
lpad277: ; preds = %invoke.cont274
- %tmp1176 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1176 = landingpad { i8*, i32 }
cleanup
unreachable
lpad289: ; preds = %invoke.cont281
- %tmp1177 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1177 = landingpad { i8*, i32 }
cleanup
unreachable
lpad301: ; preds = %invoke.cont290
- %tmp1180 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1180 = landingpad { i8*, i32 }
cleanup
unreachable
lpad308: ; preds = %invoke.cont302
- %tmp1182 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1182 = landingpad { i8*, i32 }
cleanup
unreachable
lpad311: ; preds = %invoke.cont309
- %tmp1183 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1183 = landingpad { i8*, i32 }
cleanup
unreachable
lpad314: ; preds = %invoke.cont312
- %tmp1184 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1184 = landingpad { i8*, i32 }
cleanup
unreachable
lpad320: ; preds = %invoke.cont315
- %tmp1186 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1186 = landingpad { i8*, i32 }
cleanup
unreachable
lpad340.body.thread: ; preds = %land.rhs335
- %tmp1188 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1188 = landingpad { i8*, i32 }
cleanup
unreachable
lpad340.body: ; preds = %land.end344
- %tmp1189 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1189 = landingpad { i8*, i32 }
cleanup
unreachable
lpad360: ; preds = %invoke.cont345
- %tmp1191 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1191 = landingpad { i8*, i32 }
cleanup
br label %eh.resume
lpad363: ; preds = %invoke.cont373, %invoke.cont361
- %tmp1192 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1192 = landingpad { i8*, i32 }
cleanup
unreachable
lpad369: ; preds = %invoke.cont364
- %tmp1194 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1194 = landingpad { i8*, i32 }
cleanup
unreachable
lpad381: ; preds = %invoke.cont466, %invoke.cont458, %invoke.cont449, %invoke.cont.i2106, %invoke.cont432, %invoke.cont422, %invoke.cont418, %invoke.cont408, %invoke.cont405, %invoke.cont395, %invoke.cont392, %invoke.cont382, %invoke.cont376
- %tmp1196 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1196 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup477
lpad398: ; preds = %invoke.cont396
- %tmp1199 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1199 = landingpad { i8*, i32 }
cleanup
unreachable
lpad401: ; preds = %invoke.cont399
- %tmp1200 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1200 = landingpad { i8*, i32 }
cleanup
unreachable
lpad411: ; preds = %invoke.cont409
- %tmp1201 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1201 = landingpad { i8*, i32 }
cleanup
unreachable
lpad425: ; preds = %invoke.cont423
- %tmp1203 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1203 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup477
lpad428: ; preds = %invoke.cont426
- %tmp1204 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1204 = landingpad { i8*, i32 }
cleanup
unreachable
lpad454: ; preds = %invoke.cont452
- %tmp1207 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1207 = landingpad { i8*, i32 }
cleanup
unreachable
unreachable
lpad489: ; preds = %invoke.cont546, %invoke.cont540, %invoke.cont528, %invoke.cont509, %invoke.cont499, %invoke.cont475
- %tmp1211 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1211 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup560
lpad498: ; preds = %invoke.cont490
- %tmp1214 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1214 = landingpad { i8*, i32 }
cleanup
unreachable
lpad505: ; preds = %invoke.cont503
- %tmp1215 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1215 = landingpad { i8*, i32 }
cleanup
unreachable
lpad508: ; preds = %invoke.cont506
- %tmp1216 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1216 = landingpad { i8*, i32 }
cleanup
unreachable
lpad514: ; preds = %msgSend.call
- %tmp1217 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1217 = landingpad { i8*, i32 }
cleanup
unreachable
lpad527: ; preds = %invoke.cont521
- %tmp1219 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1219 = landingpad { i8*, i32 }
cleanup
br label %ehcleanup560
lpad533: ; preds = %invoke.cont531
- %tmp1220 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1220 = landingpad { i8*, i32 }
cleanup
unreachable
lpad545: ; preds = %invoke.cont543
- %tmp1222 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1222 = landingpad { i8*, i32 }
cleanup
unreachable
lpad553: ; preds = %invoke.cont548
- %tmp1224 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1224 = landingpad { i8*, i32 }
cleanup
unreachable
br label %eh.resume
lpad565: ; preds = %invoke.cont.i2148
- %tmp1225 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1225 = landingpad { i8*, i32 }
cleanup
unreachable
lpad571: ; preds = %invoke.cont566
- %tmp1227 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1227 = landingpad { i8*, i32 }
cleanup
unreachable
lpad580: ; preds = %invoke.cont572
- %tmp1228 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp1228 = landingpad { i8*, i32 }
cleanup
br label %eh.resume
@"OBJC_EHTYPE_$_NSException" = external global i8
-define void @test4() {
+define void @test4() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
br i1 undef, label %if.end13, label %if.then10
br label %if.end439
lpad: ; preds = %if.end399
- %2 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %2 = landingpad { i8*, i32 }
catch i8* @"OBJC_EHTYPE_$_NSException"
unreachable
; CHECK: @objc_release(
; CHECK: @objc_release(
; CHECK: }
-define void @test1(i8* %call88) nounwind {
+define void @test1(i8* %call88) nounwind personality i32 (...)* @__gxx_personality_v0 {
entry:
%tmp1 = call i8* @objc_retainAutoreleasedReturnValue(i8* %call88) nounwind
%call94 = invoke i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*)*)(i8* %tmp1)
unreachable
lpad91: ; preds = %entry
- %exn91 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn91 = landingpad {i8*, i32}
cleanup
unreachable
lpad100: ; preds = %invoke.cont93
- %exn100 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn100 = landingpad {i8*, i32}
cleanup
call void @objc_release(i8* %tmp2) nounwind, !clang.imprecise_release !0
unreachable
; CHECK: call void @objc_release(i8* %call) [[NUW]]
; CHECK: call void @objc_release(i8* %call) [[NUW]]
; CHECK: call void @objc_release(i8* %cond) [[NUW]]
-define void @test0() {
+define void @test0() personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*) {
entry:
br label %while.body
br label %while.body
lpad: ; preds = %invoke.cont, %while.body
- %t4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
+ %t4 = landingpad { i8*, i32 }
catch i8* null
ret void
}
ret void
}
-define linkonce_odr void @_ZN4BaseD0Ev(%class.Base* %this) unnamed_addr uwtable ssp align 2 {
+define linkonce_odr void @_ZN4BaseD0Ev(%class.Base* %this) unnamed_addr uwtable ssp align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%this.addr = alloca %class.Base*, align 8
%exn.slot = alloca i8*
ret void
lpad: ; preds = %entry
- %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %1 = landingpad { i8*, i32 }
cleanup
%2 = extractvalue { i8*, i32 } %1, 0
store i8* %2, i8** %exn.slot
declare i64 addrspace(1)* @"some_call"(i64 addrspace(1)*)
declare i32 @"personality_function"()
-define i64 addrspace(1)* @test_basic(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" {
+define i64 addrspace(1)* @test_basic(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @"personality_function" {
; CHECK-LABEL: entry:
entry:
; CHECK: invoke
; CHECK: ret i64
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} personality i32 ()* @"personality_function"
+ %landing_pad4 = landingpad {i8*, i32}
cleanup
ret i64 addrspace(1)* %obj1
}
-define i64 addrspace(1)* @test_two_invokes(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" {
+define i64 addrspace(1)* @test_two_invokes(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @"personality_function" {
; CHECK-LABEL: entry:
entry:
; CHECK: invoke
; CHECK: ret i64
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} personality i32 ()* @"personality_function"
+ %landing_pad4 = landingpad {i8*, i32}
cleanup
ret i64 addrspace(1)* %obj1
}
-define i64 addrspace(1)* @test_phi_node(i1 %cond, i64 addrspace(1)* %obj) gc "statepoint-example" {
+define i64 addrspace(1)* @test_phi_node(i1 %cond, i64 addrspace(1)* %obj) gc "statepoint-example" personality i32 ()* @"personality_function" {
; CHECK-LABEL: @test_phi_node
; CHECK-LABEL: entry:
entry:
; CHECK: ret i64 addrspace(1)*
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} personality i32 ()* @"personality_function"
+ %landing_pad4 = landingpad {i8*, i32}
cleanup
ret i64 addrspace(1)* %obj
}
entry:
call void @do_safepoint()
ret void
-}
\ No newline at end of file
+}
declare void @f()
declare i32 @personality_function()
-define void @test_id() gc "statepoint-example" {
+define void @test_id() gc "statepoint-example" personality i32 ()* @personality_function {
; CHECK-LABEL: @test_id(
entry:
; CHECK-LABEL: entry:
ret void
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} personality i32 ()* @personality_function cleanup
+ %landing_pad4 = landingpad {i8*, i32} cleanup
ret void
}
-define void @test_num_patch_bytes() gc "statepoint-example" {
+define void @test_num_patch_bytes() gc "statepoint-example" personality i32 ()* @personality_function {
; CHECK-LABEL: @test_num_patch_bytes(
entry:
; CHECK-LABEL: entry:
ret void
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} personality i32 ()* @personality_function cleanup
+ %landing_pad4 = landingpad {i8*, i32} cleanup
ret void
}
; Ensure that the gc.statepoint calls / invokes we generate carry over
; the right calling conventions.
-define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" {
+define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality {
; CHECK-LABEL: @test_invoke_format(
; CHECK-LABEL: entry:
; CHECK: invoke coldcc i32 (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
ret i64 addrspace(1)* %ret_val
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} personality i32 ()* @personality
+ %landing_pad4 = landingpad {i8*, i32}
cleanup
ret i64 addrspace(1)* %obj1
}
; Ensure that the gc.statepoint calls / invokes we generate have the
; set of arguments we expect it to have.
-define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" {
+define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality {
; CHECK-LABEL: @test_invoke_format(
; CHECK-LABEL: entry:
; CHECK: invoke i32 (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
ret i64 addrspace(1)* %ret_val
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} personality i32 ()* @personality
+ %landing_pad4 = landingpad {i8*, i32}
cleanup
ret i64 addrspace(1)* %obj1
}
; RUN: opt < %s -prune-eh -S | not grep invoke
-define internal i32 @foo() {
+define internal i32 @foo() personality i32 (...)* @__gxx_personality_v0 {
invoke i32 @foo( )
to label %Normal unwind label %Except ; <i32>:1 [#uses=0]
Normal: ; preds = %0
ret i32 12
Except: ; preds = %0
- landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ landingpad { i8*, i32 }
catch i8* null
ret i32 123
}
-define i32 @caller() {
+define i32 @caller() personality i32 (...)* @__gxx_personality_v0 {
invoke i32 @foo( )
to label %Normal unwind label %Except ; <i32>:1 [#uses=0]
Normal: ; preds = %0
ret i32 0
Except: ; preds = %0
- landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ landingpad { i8*, i32 }
catch i8* null
ret i32 1
}
ret i32 %div
}
-define i32 @main() nounwind {
+define i32 @main() nounwind personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
%call = invoke i32 @div(i32 10, i32 0)
to label %__try.cont unwind label %lpad
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
br label %__try.cont
ret void
}
-define i32 @caller() {
+define i32 @caller() personality i32 (...)* @__gxx_personality_v0 {
invoke void @foo( )
to label %Normal unwind label %Except
ret i32 0
Except: ; preds = %0
- landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ landingpad { i8*, i32 }
catch i8* null
ret i32 1
}
declare void @_Z12xxxdtsP10xxxpq()
-define hidden void @_ZN12xxxyzIi9xxxwLi29ELi0EE4f3NewES0_i() ssp align 2 {
+define hidden void @_ZN12xxxyzIi9xxxwLi29ELi0EE4f3NewES0_i() ssp align 2 personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
bb:
invoke void @f4_()
to label %bb1 unwind label %.thread
.thread: ; preds = %bb
- %tmp = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp = landingpad { i8*, i32 }
cleanup
br label %bb13
to label %bb6 unwind label %bb2
bb2: ; preds = %.noexc
- %tmp3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp3 = landingpad { i8*, i32 }
cleanup
invoke void @f3()
to label %.body unwind label %bb4
bb4: ; preds = %bb2
- %tmp5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp5 = landingpad { i8*, i32 }
catch i8* null
unreachable
ret void
bb8: ; preds = %_ZN6xxxdIN12xxxyzIi9xxxwLi29ELi0EE4fr1jS3_.exit
- %tmp9 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp9 = landingpad { i8*, i32 }
cleanup
br label %_ZN10xxxpqdlev.exit
bb10: ; preds = %bb6, %bb1
%.1 = phi i1 [ true, %bb1 ], [ false, %bb6 ]
- %tmp11 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp11 = landingpad { i8*, i32 }
cleanup
br label %.body
resume { i8*, i32 } undef
bb14: ; preds = %bb13, %.body
- %tmp15 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
+ %tmp15 = landingpad { i8*, i32 }
catch i8* null
unreachable
}
declare i32 @fake_personality_function()
; When a statepoint is an invoke rather than a call
-define <2 x i64 addrspace(1)*> @test4(<2 x i64 addrspace(1)*>* %ptr) gc "statepoint-example" {
+define <2 x i64 addrspace(1)*> @test4(<2 x i64 addrspace(1)*>* %ptr) gc "statepoint-example" personality i32 ()* @fake_personality_function {
; CHECK-LABEL: test4
; CHECK: load
; CHECK-NEXT: extractelement
; CHECK-NEXT: insertelement
; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %14
exceptional_return: ; preds = %entry
- %landing_pad4 = landingpad { i8*, i32 } personality i32 ()* @fake_personality_function
+ %landing_pad4 = landingpad { i8*, i32 }
cleanup
ret <2 x i64 addrspace(1)*> %obj
}
; Need to delete unreachable gc.statepoint invoke - tested seperately given
; a correct implementation could only remove the instructions, not the block
-define void @test8() gc "statepoint-example" {
+define void @test8() gc "statepoint-example" personality i32 ()* undef {
; CHECK-LABEL: test8
; CHECK-NOT: gc.statepoint
ret void
ret void
exceptional_return: ; preds = %entry
- %landing_pad4 = landingpad { i8*, i32 } personality i32 ()* undef
+ %landing_pad4 = landingpad { i8*, i32 }
cleanup
ret void
}
declare i32* @fake_personality_function()
; Function Attrs: nounwind
-define i64* addrspace(1)* @test() gc "statepoint-example" {
+define i64* addrspace(1)* @test() gc "statepoint-example" personality i32* ()* @fake_personality_function {
entry:
%obj = invoke i64* addrspace(1)* @non_gc_call()
to label %normal_dest unwind label %unwind_dest
unwind_dest:
- %lpad = landingpad { i8*, i32 } personality i32* ()* @fake_personality_function
+ %lpad = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } undef
declare i32 @fake_personality_function()
-define void @"test_invoke"(i32 addrspace(1)* %base) gc "statepoint-example" {
+define void @"test_invoke"(i32 addrspace(1)* %base) gc "statepoint-example" personality i32 ()* @fake_personality_function {
; CHECK-LABEL: test_invoke
entry:
%ptr.gep = getelementptr i32, i32 addrspace(1)* %base, i32 15
exception:
; CHECK-LABEL: exception:
- %landing_pad4 = landingpad { i8*, i32 } personality i32 ()* @fake_personality_function
+ %landing_pad4 = landingpad { i8*, i32 }
cleanup
; CHECK: gc.relocate
; CHECK: bitcast
declare void @foo()
-define i32 @test(i1 %cond) {
+define i32 @test(i1 %cond) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
Entry:
br i1 %cond, label %Inv, label %Cont
Inv: ; preds = %Entry
Ok: ; preds = %Inv
br label %Cont
LPad:
- %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %val = landingpad { i8*, i32 }
catch i8* null
br label %Cont
Cont: ; preds = %Ok, %Inv, %Entry
declare i32 @foo()
-define void @caller() {
+define void @caller() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
br i1 true, label %T, label %F
F: ; preds = %0
%X = invoke i32 @foo( )
to label %T unwind label %LP ; <i32> [#uses=0]
LP:
- %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %val = landingpad { i8*, i32 }
catch i8* null
br label %T
T:
; RUN: opt < %s -sccp -disable-output
; PR1431
-define void @_ada_bench() {
+define void @_ada_bench() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
br label %cond_next
cond_next: ; preds = %cond_next, %entry
bb177: ; preds = %bb149
unreachable
cleanup: ; preds = %bb149, %bb114, %bb67
- %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %val = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } %val
}
; RUN: opt < %s -ipsccp -S | grep "ret i32 undef"
; PR3325
-define i32 @main() {
+define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
%tmp1 = invoke i32 @f()
to label %UnifiedReturnBlock unwind label %lpad
lpad:
- %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %val = landingpad { i8*, i32 }
cleanup
unreachable
ret {i64,i64} %b
}
-define i64 @test4b() {
+define i64 @test4b() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
%a = invoke {i64,i64} @test4a()
to label %A unwind label %B
A:
%c = call i64 @test4c(i64 %b)
ret i64 %c
B:
- %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %val = landingpad { i8*, i32 }
catch i8* null
ret i64 0
}
ret {i64,i64} %b
}
-define i64 @test5b() {
+define i64 @test5b() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
%a = invoke {i64,i64} @test5a()
to label %A unwind label %B
A:
%c = call i64 @test5c({i64,i64} %a)
ret i64 %c
B:
- %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %val = landingpad { i8*, i32 }
catch i8* null
ret i64 0
}
declare i8* @objc_msgSend(i8*, i8*, ...)
declare i32 @personality_v0(...)
-define void @invoketest() {
+define void @invoketest() personality i8* bitcast (i32 (...)* @personality_v0 to i8*) {
entry:
br i1 undef, label %cond.true, label %cond.false
br label %if.end98
lpad:
- %l = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @personality_v0 to i8*)
+ %l = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } %l
target datalayout = "f64:64:64-v64:64:64"
-define void @test_phi_in_landingpad() {
+define void @test_phi_in_landingpad() personality i8*
+ bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @foo()
to label %inner unwind label %lpad
lpad:
%x1 = phi double [ undef, %entry ], [ undef, %inner ]
%y1 = phi double [ undef, %entry ], [ undef, %inner ]
- landingpad { i8*, i32 } personality i8*
- bitcast (i32 (...)* @__gxx_personality_v0 to i8*) catch i8* null
+ landingpad { i8*, i32 } catch i8* null
br label %done
done:
; (GEP followed by an invoke)
; safestack attribute
; Requires protector.
-define i32 @foo() uwtable safestack {
+define i32 @foo() uwtable safestack personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK: __safestack_unsafe_stack_ptr
%c = alloca %struct.pair, align 4
ret i32 0
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
ret i32 0
}
; Addr-of a variable passed into an invoke instruction.
; safestack attribute
; Requires protector and stack restore after landing pad.
-define i32 @foo() uwtable safestack {
+define i32 @foo() uwtable safestack personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK: %[[SP:.*]] = load i8*, i8** @__safestack_unsafe_stack_ptr
; CHECK: %[[STATICTOP:.*]] = getelementptr i8, i8* %[[SP]], i32 -16
lpad:
; CHECK: landingpad
; CHECK-NEXT: catch
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
; CHECK-NEXT: store i8* %[[STATICTOP]], i8** @__safestack_unsafe_stack_ptr
ret i32 0
declare i32 @extern_fn2(i32)
declare i32 @__gcc_personality_v0(i32, i64, i8*, i8*)
-define void @odd_fn(i1) noinline {
+define void @odd_fn(i1) noinline personality i32 (i32, i64, i8*, i8*)* @__gcc_personality_v0 {
%retptr1 = alloca i32
%retptr2 = alloca i32
br i1 %0, label %then, label %else
ret void
unwind: ; preds = %then
- %info = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gcc_personality_v0
+ %info = landingpad { i8*, i32 }
cleanup
call void @extern_fn(i32* null)
unreachable
;
; RUN: opt < %s -simplifycfg -disable-output
-define i32 @test() {
+define i32 @test() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
%A = invoke i32 @test( )
to label %Ret unwind label %Ret2 ; <i32> [#uses=1]
Ret: ; preds = %0
ret i32 %A
Ret2: ; preds = %0
- %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %val = landingpad { i8*, i32 }
catch i8* null
ret i32 undef
}
; RUN: opt < %s -simplifycfg -disable-output
-define i1 @foo() {
+define i1 @foo() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
%X = invoke i1 @foo( )
to label %N unwind label %F ; <i1> [#uses=1]
F: ; preds = %0
- %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %val = landingpad { i8*, i32 }
catch i8* null
ret i1 false
N: ; preds = %0
declare i32 @func(i8*) nounwind
-define i32 @test() {
+define i32 @test() personality i32 (...)* @__gxx_personality_v0 {
invoke i32 @func( i8* null )
to label %Cont unwind label %Other ; <i32>:1 [#uses=0]
ret i32 0
Other: ; preds = %0
- landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ landingpad { i8*, i32 }
catch i8* null
ret i32 1
}
declare void @bar(i32)
-define void @foo() {
+define void @foo() personality i32 (...)* @__gxx_personality_v0 {
entry:
invoke void @bar(i32 undef)
to label %r unwind label %u
ret void
u: ; preds = %entry
- %val = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+ %val = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } %val
}
declare void @bar()
-define i32 @foo() {
+define i32 @foo() personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 {
entry:
invoke void @bar()
to label %return unwind label %lpad
ret i32 0
lpad:
- %lp = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
+ %lp = landingpad { i8*, i32 }
cleanup
resume { i8*, i32 } %lp
}
ret void
}
-define void @test2() {
+define void @test2() personality i32 (...)* @__gxx_personality_v0 {
; CHECK-LABEL: @test2(
; CHECK: entry:
; CHECK-NEXT: call void @test2()
invoke void @test2( )
to label %N unwind label %U
U:
- %res = landingpad { i8* } personality i32 (...)* @__gxx_personality_v0
+ %res = landingpad { i8* }
cleanup
unreachable
N:
; CHECK-LABEL: @test1
-define void @test1() {
+define void @test1() personality i32 (...)* @__gxx_personality_v0 {
entry:
; CHECK-LABEL: entry:
; CHECK: to label %invoke2 unwind label %lpad2
ret void
lpad1:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
cleanup
br label %shared_resume
lpad2:
; CHECK-LABEL: lpad2:
-; CHECK: landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
+; CHECK: landingpad { i8*, i32 }
; CHECK-NEXT: cleanup
; CHECK-NEXT: call void @fn()
; CHECK-NEXT: ret void
- %exn2 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn2 = landingpad {i8*, i32}
cleanup
br label %shared_resume
}
; Don't trigger if blocks aren't the same/empty
-define void @neg1() {
+define void @neg1() personality i32 (...)* @__gxx_personality_v0 {
; CHECK-LABEL: @neg1
entry:
; CHECK-LABEL: entry:
ret void
lpad1:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
filter [0 x i8*] zeroinitializer
call void @fn()
br label %shared_resume
lpad2:
- %exn2 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn2 = landingpad {i8*, i32}
cleanup
br label %shared_resume
}
; Should not trigger when the landing pads are not the exact same
-define void @neg2() {
+define void @neg2() personality i32 (...)* @__gxx_personality_v0 {
; CHECK-LABEL: @neg2
entry:
; CHECK-LABEL: entry:
ret void
lpad1:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
filter [0 x i8*] zeroinitializer
br label %shared_resume
lpad2:
- %exn2 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn2 = landingpad {i8*, i32}
cleanup
br label %shared_resume
; CHECK-LABEL: @f1(
-define i8* @f1() nounwind uwtable ssp {
+define i8* @f1() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK: call void @llvm.trap()
; CHECK: unreachable
ret i8* %call
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%1 = extractvalue { i8*, i32 } %0, 0
tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind
}
; CHECK-LABEL: @f2(
-define i8* @f2() nounwind uwtable ssp {
+define i8* @f2() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK: call void @llvm.trap()
; CHECK: unreachable
ret i8* %call
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%1 = extractvalue { i8*, i32 } %0, 0
tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind
}
; CHECK-LABEL: @f3(
-define i32 @f3() nounwind uwtable ssp {
+define i32 @f3() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; CHECK-NEXT: entry
entry:
; CHECK-NEXT: ret i32 3
ret i32 3
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%1 = extractvalue { i8*, i32 } %0, 0
tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind
}
; CHECK-LABEL: @f4(
-define i32 @f4() nounwind uwtable ssp {
+define i32 @f4() nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; CHECK-NEXT: entry
entry:
; CHECK-NEXT: call i32 @read_only()
ret i32 %call
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
%1 = extractvalue { i8*, i32 } %0, 0
tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind
}
; CHECK-LABEL: @f5(
-define i32 @f5(i1 %cond, i8* %a, i8* %b) {
+define i32 @f5(i1 %cond, i8* %a, i8* %b) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
br i1 %cond, label %x, label %y
lpad:
; CHECK-NOT: phi
%phi2 = phi i8* [%a, %x], [%b, %y]
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
; CHECK: __cxa_call_unexpected(i8* %a)
tail call void @__cxa_call_unexpected(i8* %phi2) noreturn nounwind
}
; CHECK-LABEL: @f6(
-define void @f6() {
+define void @f6() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @purefn()
to label %invoke.cont1 unwind label %lpad
lpad:
; CHECK-NOT: phi
%tmp = phi i8* [ null, %invoke.cont1 ], [ null, %entry ]
- landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ landingpad { i8*, i32 }
cleanup
ret void
}
; This testcase checks to see if the simplifycfg pass is converting invoke
; instructions to call instructions if the handler just rethrows the exception.
-define i32 @test1() {
+define i32 @test1() personality i32 (...)* @__gxx_personality_v0 {
; CHECK-LABEL: @test1(
; CHECK-NEXT: call void @bar()
; CHECK-NEXT: ret i32 0
to label %1 unwind label %Rethrow
ret i32 0
Rethrow:
- %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
+ %exn = landingpad {i8*, i32}
catch i8* null
resume { i8*, i32 } %exn
}
ret i32 %div
}
-define i32 @main() nounwind {
+define i32 @main() nounwind personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
entry:
%call = invoke i32 @div(i32 10, i32 0)
to label %__try.cont unwind label %lpad
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+ %0 = landingpad { i8*, i32 }
catch i8* null
br label %__try.cont
declare i32 @llvm.experimental.gc.statepoint.p0f_p1i64f(i64, i32, i64 addrspace(1)* ()*, i32, i32, ...)
declare i32* @fake_personality_function()
-define i32 @test() gc "statepoint-example" {
+define i32 @test() gc "statepoint-example" personality i32* ()* @fake_personality_function {
; CHECK-LABEL: test
entry:
; CHECK-LABEL: entry:
to label %normal unwind label %exception
exception:
- %lpad = landingpad { i8*, i32 } personality i32* ()* @fake_personality_function
+ %lpad = landingpad { i8*, i32 }
cleanup
ret i32 0
}
declare i32 @g()
-define void @f2(i32 %x) {
+define void @f2(i32 %x) personality i32 ()* @g {
bb0:
%y1 = invoke i32 @g() to label %bb1 unwind label %bb2
bb1:
ret void
bb2:
%y2 = phi i32 [%y1, %bb0]
- %y3 = landingpad i32 personality i32 ()* @g
+ %y3 = landingpad i32
cleanup
ret void
; CHECK: Instruction does not dominate all uses!
; CHECK-NEXT: %y2 = phi i32 [ %y1, %bb0 ]
}
-define void @f3(i32 %x) {
+define void @f3(i32 %x) personality i32 ()* @g {
bb0:
%y1 = invoke i32 @g() to label %bb1 unwind label %bb2
bb1:
ret void
bb2:
- %y2 = landingpad i32 personality i32 ()* @g
+ %y2 = landingpad i32
cleanup
br label %bb3
bb3:
declare i8 @llvm.expect.i8(i8,i8)
declare i32 @fn(i8 (i8, i8)*)
-define void @f1() {
+define void @f1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; OK
invoke void @llvm.donothing()
ret void
contb:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
ret void
}
-define i8 @f2() {
+define i8 @f2() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
; CHECK: Cannot invoke an intrinsinc other than donothing or patchpoint
invoke void @llvm.trap()
ret i8 3
lpad:
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
ret i8 2
}
ret i32 %call
}
-define void @f4() {
+define void @f4() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
invoke void @llvm.donothing()
to label %cont unwind label %cont
cont:
; CHECK: Block containing LandingPadInst must be jumped to only by the unwind edge of an invoke.
- %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %0 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
ret void
}
}
; We can annotate the range of the return value of an INVOKE.
-define void @invoke_all(i8* %x) {
+define void @invoke_all(i8* %x) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
entry:
%v1 = invoke i8 @f1(i8* %x) to label %cont unwind label %lpad, !range !0
%v2 = invoke i8 @f2(i8* %x) to label %cont unwind label %lpad, !range !1
ret void
lpad:
- %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ %4 = landingpad { i8*, i32 }
filter [0 x i8*] zeroinitializer
ret void
}
}
; Basic test for invoke statepoints
-define i8 addrspace(1)* @test3(i8 addrspace(1)* %obj, i8 addrspace(1)* %obj1) gc "statepoint-example" {
+define i8 addrspace(1)* @test3(i8 addrspace(1)* %obj, i8 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @"personality_function" {
; CHECK-LABEL: test3
entry:
; CHECK-LABEL: entry
; CHECK-LABEL: exceptional_return
; CHECK: gc.relocate
; CHECK: gc.relocate
- %landing_pad = landingpad { i8*, i32 } personality i32 ()* @"personality_function"
+ %landing_pad = landingpad { i8*, i32 }
cleanup
%relocate_token = extractvalue { i8*, i32 } %landing_pad, 1
%obj.relocated1 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(i32 %relocate_token, i32 12, i32 12)
map(F.getPrefixData());
if (F.hasPrologueData())
map(F.getPrologueData());
+ if (F.hasPersonalityFn())
+ map(F.getPersonalityFn());
}
// Function bodies.
changeValueUseList(F.getPrefixData());
if (F.hasPrologueData())
changeValueUseList(F.getPrologueData());
+ if (F.hasPersonalityFn())
+ changeValueUseList(F.getPersonalityFn());
}
// Function bodies.
std::unique_ptr<Module> makeLLVMModule(DPass *P) {
const char *ModuleStrig =
"declare i32 @g()\n" \
- "define void @f(i32 %x) {\n" \
+ "define void @f(i32 %x) personality i32 ()* @g {\n" \
"bb0:\n" \
" %y1 = add i32 %x, 1\n" \
" %y2 = add i32 %x, 1\n" \
" %y4 = add i32 %x, 1\n" \
" br label %bb4\n" \
"bb2:\n" \
- " %y5 = landingpad i32 personality i32 ()* @g\n" \
+ " %y5 = landingpad i32\n" \
" cleanup\n" \
" br label %bb4\n" \
"bb3:\n" \
TEST_F(IRBuilderTest, LandingPadName) {
IRBuilder<> Builder(BB);
- LandingPadInst *LP = Builder.CreateLandingPad(Builder.getInt32Ty(),
- Builder.getInt32(0), 0, "LP");
+ LandingPadInst *LP = Builder.CreateLandingPad(Builder.getInt32Ty(), 0, "LP");
EXPECT_EQ(LP->getName(), "LP");
}