[llvm-branch-commits] [llvm-branch] r104477 - in /llvm/branches/wendling/eh: include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/Transforms/IPO/ lib/Transforms/InstCombine/ lib/Transforms/Utils/ lib/VMCore/
Bill Wendling
isanbard at gmail.com
Sun May 23 15:59:07 PDT 2010
Author: void
Date: Sun May 23 17:59:07 2010
New Revision: 104477
URL: http://llvm.org/viewvc/llvm-project?rev=104477&view=rev
Log:
A rough-in for what I see as the new syntax for the 'invoke' instruction. The
old syntax:
invoke [cconv] [ret attrs] <ptr to function ty> <function ptr val>(<args>) [fn attrs]
to label <normal label> unwind label <exception label>
This is the new working syntax:
invoke [cconv] [ret attrs] <ptr to function ty> <function ptr val>(<args>) [fn attrs]
to label <normal label>
personality '[' <ptr to personality function> ']'
catches '['
(TypeAndValue, label <catch label>)+
']'
catchall '[' TypeAndValue, label <catch-all label> ']'
unwind to label <unwind label>
This is highly subject to change. And it's currently not hooked up to
anything. Indeed, it won't write the new syntax out to the files.
Modified:
llvm/branches/wendling/eh/include/llvm/Instructions.h
llvm/branches/wendling/eh/include/llvm/Intrinsics.td
llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h
llvm/branches/wendling/eh/lib/AsmParser/LLLexer.cpp
llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp
llvm/branches/wendling/eh/lib/AsmParser/LLParser.h
llvm/branches/wendling/eh/lib/AsmParser/LLToken.h
llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp
llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp
llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp
llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp
llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp
llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp
llvm/branches/wendling/eh/lib/VMCore/Core.cpp
Modified: llvm/branches/wendling/eh/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/include/llvm/Instructions.h?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/include/llvm/Instructions.h (original)
+++ llvm/branches/wendling/eh/include/llvm/Instructions.h Sun May 23 17:59:07 2010
@@ -2411,6 +2411,7 @@
template<typename InputIterator>
static InvokeInst *Create(Value *Func,
BasicBlock *IfNormal, BasicBlock *IfException,
+ Value *PersFn,
InputIterator ArgBegin, InputIterator ArgEnd,
const Twine &NameStr = "",
Instruction *InsertBefore = 0) {
@@ -2421,6 +2422,7 @@
template<typename InputIterator>
static InvokeInst *Create(Value *Func,
BasicBlock *IfNormal, BasicBlock *IfException,
+ Value *PersFn,
InputIterator ArgBegin, InputIterator ArgEnd,
const Twine &NameStr,
BasicBlock *InsertAtEnd) {
@@ -2549,6 +2551,13 @@
Op<-1>() = reinterpret_cast<Value*>(B);
}
+ Value *getPersonalityFn() const {
+ return 0; // EH-FIXME: Implement.
+ }
+ void setPersonalityFn(Value *P) {
+ P = P; // EH-FIXME: Implement.
+ }
+
BasicBlock *getSuccessor(unsigned i) const {
assert(i < 2 && "Successor # out of range for invoke!");
return i == 0 ? getNormalDest() : getUnwindDest();
Modified: llvm/branches/wendling/eh/include/llvm/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/include/llvm/Intrinsics.td?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/include/llvm/Intrinsics.td (original)
+++ llvm/branches/wendling/eh/include/llvm/Intrinsics.td Sun May 23 17:59:07 2010
@@ -291,6 +291,10 @@
//===------------------ Exception Handling Intrinsics----------------------===//
//
+
+// llvm.eh.filter - A list of one or more types that the function can throw.
+def int_eh_filter : Intrinsic<[], [llvm_ptr_ty, llvm_vararg_ty]>;
+
def int_eh_exception : Intrinsic<[llvm_ptr_ty], [], [IntrReadMem]>;
def int_eh_selector : Intrinsic<[llvm_i32_ty],
[llvm_ptr_ty, llvm_ptr_ty, llvm_vararg_ty]>;
Modified: llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h (original)
+++ llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h Sun May 23 17:59:07 2010
@@ -277,33 +277,36 @@
}
InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
- BasicBlock *UnwindDest, const Twine &Name = "") {
+ BasicBlock *UnwindDest, Value *PersonalityFn,
+ const Twine &Name = "") {
Value *Args[] = { 0 };
- return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, Args,
- Args), Name);
+ return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
+ PersonalityFn, Args, Args), Name);
}
InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
- BasicBlock *UnwindDest, Value *Arg1,
+ BasicBlock *UnwindDest, Value *PersonalityFn,
+ Value *Arg1,
const Twine &Name = "") {
Value *Args[] = { Arg1 };
- return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, Args,
- Args+1), Name);
+ return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
+ PersonalityFn, Args, Args+1), Name);
}
InvokeInst *CreateInvoke3(Value *Callee, BasicBlock *NormalDest,
- BasicBlock *UnwindDest, Value *Arg1,
- Value *Arg2, Value *Arg3,
+ BasicBlock *UnwindDest, Value *PersonalityFn,
+ Value *Arg1, Value *Arg2, Value *Arg3,
const Twine &Name = "") {
Value *Args[] = { Arg1, Arg2, Arg3 };
- return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, Args,
- Args+3), Name);
+ return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
+ PersonalityFn, Args, Args+3), Name);
}
/// CreateInvoke - Create an invoke instruction.
template<typename InputIterator>
InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
- BasicBlock *UnwindDest, InputIterator ArgBegin,
- InputIterator ArgEnd, const Twine &Name = "") {
+ BasicBlock *UnwindDest, Value *PersonalityFn,
+ InputIterator ArgBegin, InputIterator ArgEnd,
+ const Twine &Name = "") {
return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
- ArgBegin, ArgEnd), Name);
+ PersonalityFn, ArgBegin, ArgEnd), Name);
}
UnwindInst *CreateUnwind() {
Modified: llvm/branches/wendling/eh/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/AsmParser/LLLexer.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/branches/wendling/eh/lib/AsmParser/LLLexer.cpp Sun May 23 17:59:07 2010
@@ -532,6 +532,11 @@
KEYWORD(alignstack);
KEYWORD(gc);
+ // EH keywords.
+ KEYWORD(catches);
+ KEYWORD(catchall);
+ KEYWORD(personality);
+
KEYWORD(ccc);
KEYWORD(fastcc);
KEYWORD(coldcc);
Modified: llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp (original)
+++ llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp Sun May 23 17:59:07 2010
@@ -3316,20 +3316,85 @@
return false;
}
+/// ParseCatchClauses
+/// ::= /*empty*/
+/// ::= 'catches' '[' (TypeAndValue ',' TypeAndValue)+ ']'
+bool LLParser::ParseCatchClauses(SmallVectorImpl<ValueBBPair> &Catches,
+ PerFunctionState &PFS) {
+ if (Lex.getKind() != lltok::kw_catches)
+ // There are no catch clauses.
+ return false;
+
+ Lex.Lex(); // Eat 'catches' token.
+
+ // Gather up all of the catches.
+ if (ParseToken(lltok::lsquare,
+ "expected '[' in catch clause of invoke"))
+ return true;
+
+ while (Lex.getKind() != lltok::rsquare) {
+ Value *CatchTy;
+ BasicBlock *CatchBB = 0;
+
+ if (ParseTypeAndValue(CatchTy, PFS) ||
+ ParseToken(lltok::comma,
+ "expected comma in catch clause of invoke") ||
+ ParseTypeAndBasicBlock(CatchBB, PFS))
+ return true;
+
+ Catches.push_back(ValueBBPair(CatchTy, CatchBB));
+ }
+
+ Lex.Lex(); // Eat ']' token.
+ return false;
+}
+
+/// ParseCatchAllClause
+/// ::= /*empty*/
+/// ::= 'with' 'catchall' '[' TypeAndValue ',' TypeAndValue ']'
+bool LLParser::ParseCatchAllClause(Value *&CatchAllVal, BasicBlock *&CatchAllBB,
+ PerFunctionState &PFS) {
+ if (Lex.getKind() != lltok::kw_catchall)
+ // There isn't a catch-all clause.
+ return false;
+
+ // Gather up the catch-all.
+ Lex.Lex(); // Eat 'catchall' token.
+ LocTy CatchAllLoc;
+
+ if (ParseToken(lltok::lsquare,
+ "expected '[' in catch-all clause of invoke") ||
+ ParseTypeAndValue(CatchAllVal, CatchAllLoc, PFS) ||
+ ParseToken(lltok::comma,
+ "expected ',' in catch-all clause of invoke") ||
+ ParseTypeAndBasicBlock(CatchAllBB, PFS) ||
+ ParseToken(lltok::rsquare,
+ "expected ']' in catch-all clause of invoke"))
+ return true;
+
+ return false;
+}
/// ParseInvoke
/// ::= 'invoke' OptionalCallingConv OptionalAttrs Type Value ParamList
-/// OptionalAttrs 'to' TypeAndValue 'unwind' TypeAndValue
+/// OptionalAttrs 'to' TypeAndValue 'personality' TypeAndValue
+/// OptionalCatches OptionalCatchAll 'unwind' 'to' TypeAndValue
bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
LocTy CallLoc = Lex.getLoc();
unsigned RetAttrs, FnAttrs;
CallingConv::ID CC;
PATypeHolder RetType(Type::getVoidTy(Context));
LocTy RetTypeLoc;
+ LocTy PersLoc;
ValID CalleeID;
SmallVector<ParamInfo, 16> ArgList;
- BasicBlock *NormalBB, *UnwindBB;
+ Value *PersFn = 0;
+ SmallVector<ValueBBPair, 16> Catches;
+ BasicBlock *NormalBB = 0, *UnwindBB = 0;
+ Value *CatchAllVal = 0;
+ BasicBlock *CatchAllBB = 0;
+
if (ParseOptionalCallingConv(CC) ||
ParseOptionalAttrs(RetAttrs, 1) ||
ParseType(RetType, RetTypeLoc, true /*void allowed*/) ||
@@ -3338,10 +3403,22 @@
ParseOptionalAttrs(FnAttrs, 2) ||
ParseToken(lltok::kw_to, "expected 'to' in invoke") ||
ParseTypeAndBasicBlock(NormalBB, PFS) ||
+ ParseToken(lltok::kw_personality,
+ "expected 'personality' clause in invoke") ||
+ ParseToken(lltok::lsquare,
+ "expected '[' in personality clause in invoke") ||
+ ParseTypeAndValue(PersFn, PersLoc, PFS) ||
+ ParseToken(lltok::rsquare,
+ "expected ']' in personality clause in invoke") ||
+ ParseCatchClauses(Catches, PFS) ||
+ ParseCatchAllClause(CatchAllVal, CatchAllBB, PFS) ||
ParseToken(lltok::kw_unwind, "expected 'unwind' in invoke") ||
+ ParseToken(lltok::kw_to, "expected 'to' in invoke") ||
ParseTypeAndBasicBlock(UnwindBB, PFS))
return true;
+ // EH-FIXME: If there are no catches, should this be an error?
+
// If RetType is a non-function pointer type, then this is the short syntax
// for the call, which means that RetType is just the return type. Infer the
// rest of the function argument types from the arguments that are present.
@@ -3409,7 +3486,7 @@
// Finish off the Attributes and check them
AttrListPtr PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
- InvokeInst *II = InvokeInst::Create(Callee, NormalBB, UnwindBB,
+ InvokeInst *II = InvokeInst::Create(Callee, NormalBB, UnwindBB, PersFn,
Args.begin(), Args.end());
II->setCallingConv(CC);
II->setAttributes(PAL);
Modified: llvm/branches/wendling/eh/lib/AsmParser/LLParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/AsmParser/LLParser.h?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/AsmParser/LLParser.h (original)
+++ llvm/branches/wendling/eh/lib/AsmParser/LLParser.h Sun May 23 17:59:07 2010
@@ -303,6 +303,13 @@
bool ParseParameterList(SmallVectorImpl<ParamInfo> &ArgList,
PerFunctionState &PFS);
+ // Parse the (optional) catch clauses of the invoke call.
+ typedef std::pair<Value*, BasicBlock*> ValueBBPair;
+ bool ParseCatchClauses(SmallVectorImpl<ValueBBPair> &Catches,
+ PerFunctionState &PFS);
+ bool ParseCatchAllClause(Value *&CatchAllVal, BasicBlock *&CatchAllBB,
+ PerFunctionState &PFS);
+
// Constant Parsing.
bool ParseValID(ValID &ID, PerFunctionState *PFS = NULL);
bool ParseGlobalValue(const Type *Ty, Constant *&V);
Modified: llvm/branches/wendling/eh/lib/AsmParser/LLToken.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/AsmParser/LLToken.h?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/AsmParser/LLToken.h (original)
+++ llvm/branches/wendling/eh/lib/AsmParser/LLToken.h Sun May 23 17:59:07 2010
@@ -22,12 +22,12 @@
// Tokens with no info.
dotdotdot, // ...
- equal, comma, // = ,
+ equal, comma, // = ,
star, // *
lsquare, rsquare, // [ ]
- lbrace, rbrace, // { }
- less, greater, // < >
- lparen, rparen, // ( )
+ lbrace, rbrace, // { }
+ less, greater, // < >
+ lparen, rparen, // ( )
backslash, // \ (not /)
exclaim, // !
@@ -37,69 +37,101 @@
kw_declare, kw_define,
kw_global, kw_constant,
- kw_private, kw_linker_private, kw_internal, kw_linkonce, kw_linkonce_odr,
- kw_weak, kw_weak_odr, kw_appending, kw_dllimport, kw_dllexport, kw_common,
+ // Linkage tokens.
+ kw_appending,
kw_available_externally,
- kw_default, kw_hidden, kw_protected,
+ kw_common,
+ kw_dllexport,
+ kw_dllimport,
kw_extern_weak,
- kw_external, kw_thread_local,
- kw_zeroinitializer,
- kw_undef, kw_null,
- kw_to,
- kw_tail,
- kw_target,
- kw_triple,
- kw_deplibs,
+ kw_external,
+ kw_internal,
+ kw_linker_private,
+ kw_linkonce,
+ kw_linkonce_odr,
+ kw_private,
+ kw_weak,
+ kw_weak_odr,
+
+ // Visibility tokens.
+ kw_default,
+ kw_hidden,
+ kw_protected,
+
+ kw_addrspace,
+ kw_alias,
+ kw_align,
+ kw_alignstack,
+ kw_asm,
+ kw_c,
kw_datalayout,
- kw_volatile,
- kw_nuw,
- kw_nsw,
+ kw_deplibs,
kw_exact,
kw_inbounds,
- kw_align,
- kw_addrspace,
- kw_section,
- kw_alias,
+ kw_gc,
kw_module,
- kw_asm,
+ kw_nsw,
+ kw_null,
+ kw_nuw,
+ kw_section,
kw_sideeffect,
- kw_alignstack,
- kw_gc,
- kw_c,
+ kw_tail,
+ kw_target,
+ kw_thread_local,
+ kw_triple,
+ kw_to,
+ kw_undef,
+ kw_volatile,
+ kw_zeroinitializer,
- kw_cc, kw_ccc, kw_fastcc, kw_coldcc,
- kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc,
- kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc,
+ // Exception handling tokens.
+ kw_catchall,
+ kw_catches,
+ kw_personality,
+
+ // Calling convention tokens.
+ kw_arm_aapcs_vfpcc,
+ kw_arm_aapcscc,
+ kw_arm_apcscc,
+ kw_cc,
+ kw_ccc,
+ kw_coldcc,
+ kw_fastcc,
kw_msp430_intrcc,
+ kw_x86_fastcallcc,
+ kw_x86_stdcallcc,
+ kw_x86_thiscallcc,
- kw_signext,
- kw_zeroext,
+ // Attribute tokens.
+ kw_alwaysinline,
+ kw_byval,
+ kw_inlinehint,
kw_inreg,
- kw_sret,
- kw_nounwind,
- kw_noreturn,
+ kw_naked,
+ kw_nest,
kw_noalias,
kw_nocapture,
- kw_byval,
- kw_nest,
- kw_readnone,
- kw_readonly,
-
- kw_inlinehint,
+ kw_noimplicitfloat,
kw_noinline,
- kw_alwaysinline,
+ kw_noredzone,
+ kw_noreturn,
+ kw_nounwind,
kw_optsize,
+ kw_readnone,
+ kw_readonly,
+ kw_signext,
+ kw_sret,
kw_ssp,
kw_sspreq,
- kw_noredzone,
- kw_noimplicitfloat,
- kw_naked,
+ kw_zeroext,
- kw_type,
+ // Type tokens.
kw_opaque,
+ kw_type,
kw_union,
- kw_eq, kw_ne, kw_slt, kw_sgt, kw_sle, kw_sge, kw_ult, kw_ugt, kw_ule,
+ // Binary operator tokens.
+ kw_eq, kw_ne, kw_slt, kw_sgt, kw_sle, kw_sge, kw_ult, kw_ugt, kw_ule,
kw_uge, kw_oeq, kw_one, kw_olt, kw_ogt, kw_ole, kw_oge, kw_ord, kw_uno,
kw_ueq, kw_une,
@@ -109,18 +141,48 @@
kw_urem, kw_srem, kw_frem, kw_shl, kw_lshr, kw_ashr,
kw_and, kw_or, kw_xor, kw_icmp, kw_fcmp,
- kw_phi, kw_call,
- kw_trunc, kw_zext, kw_sext, kw_fptrunc, kw_fpext, kw_uitofp, kw_sitofp,
- kw_fptoui, kw_fptosi, kw_inttoptr, kw_ptrtoint, kw_bitcast,
- kw_select, kw_va_arg,
-
- kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_unwind,
+ kw_bitcast,
+ kw_call,
+ kw_indirectbr,
+ kw_fpext,
+ kw_fptosi,
+ kw_fptoui,
+ kw_fptrunc,
+ kw_inttoptr,
+ kw_ptrtoint,
+ kw_select,
+ kw_sext,
+ kw_sitofp,
+ kw_uitofp,
+ kw_va_arg,
+ kw_zext,
+
+ // Terminator instruction tokens.
+ kw_br,
+ kw_invoke,
+ kw_phi,
+ kw_ret,
+ kw_switch,
+ kw_trunc,
kw_unreachable,
+ kw_unwind,
- kw_malloc, kw_alloca, kw_free, kw_load, kw_store, kw_getelementptr,
-
- kw_extractelement, kw_insertelement, kw_shufflevector, kw_getresult,
- kw_extractvalue, kw_insertvalue, kw_blockaddress,
+ // Memory instruction tokens.
+ kw_alloca,
+ kw_blockaddress,
+ kw_free,
+ kw_getelementptr,
+ kw_load,
+ kw_malloc,
+ kw_store,
+
+ // Vector instruction tokens.
+ kw_extractelement,
+ kw_extractvalue,
+ kw_getresult,
+ kw_insertelement,
+ kw_insertvalue,
+ kw_shufflevector,
// Unsigned Valued tokens (UIntVal).
GlobalID, // @42
@@ -136,8 +198,8 @@
// Type valued tokens (TyVal).
Type,
- APFloat, // APFloatVal
- APSInt // APSInt
+ APFloat, // APFloatVal
+ APSInt // APSInt
};
} // end namespace lltok
} // end namespace llvm
Modified: llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp Sun May 23 17:59:07 2010
@@ -2114,6 +2114,7 @@
}
I = InvokeInst::Create(Callee, NormalBB, UnwindBB,
+ 0, // EH-FIXME!
Ops.begin(), Ops.end());
InstructionList.push_back(I);
cast<InvokeInst>(I)->setCallingConv(
Modified: llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp (original)
+++ llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp Sun May 23 17:59:07 2010
@@ -162,6 +162,7 @@
InvokeInst *II = InvokeInst::Create(CI->getCalledValue(),
NewBB, CleanupBB,
+ 0, // EH-FIXME!
Args.begin(), Args.end(),
CI->getName(), CallBB);
II->setCallingConv(CI->getCallingConv());
Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp Sun May 23 17:59:07 2010
@@ -714,6 +714,7 @@
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
+ II->getPersonalityFn(),
Args.begin(), Args.end(), "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
cast<InvokeInst>(New)->setAttributes(AttrListPtr::get(AttributesVec.begin(),
Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp Sun May 23 17:59:07 2010
@@ -233,6 +233,7 @@
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
+ II->getPersonalityFn(),
Args.begin(), Args.end(), "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
cast<InvokeInst>(New)->setAttributes(PAL);
@@ -763,6 +764,7 @@
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
+ II->getPersonalityFn(),
Args.begin(), Args.end(), "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
cast<InvokeInst>(New)->setAttributes(NewCallPAL);
Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp Sun May 23 17:59:07 2010
@@ -476,6 +476,7 @@
std::vector<Value*> Params(CI.op_begin() + 1, CI.op_end());
InvokeInst* II =
InvokeInst::Create(CI.getCalledValue(), NewBB, PrelimBBMap[Func],
+ 0, // EH-FIXME!
Params.begin(), Params.end(), CI.getName(), Term);
II->setCallingConv(CI.getCallingConv());
II->setAttributes(CI.getAttributes());
Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp Sun May 23 17:59:07 2010
@@ -93,6 +93,7 @@
InvokeInst *II = cast<InvokeInst>(i);
NCall = InvokeInst::Create(NF, II->getNormalDest(),
II->getUnwindDest(),
+ II->getPersonalityFn(),
args.begin(), args.end(),
II->getName(), II);
cast<InvokeInst>(NCall)->setCallingConv(II->getCallingConv());
Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp Sun May 23 17:59:07 2010
@@ -304,6 +304,7 @@
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
+ II->getPersonalityFn(),
Args.begin(), Args.end(), "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
cast<InvokeInst>(New)->setAttributes(NewPAL);
Modified: llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp Sun May 23 17:59:07 2010
@@ -1078,6 +1078,7 @@
Instruction *NC;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
NC = InvokeInst::Create(Callee, II->getNormalDest(), II->getUnwindDest(),
+ II->getPersonalityFn(),
Args.begin(), Args.end(),
Caller->getName(), Caller);
cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv());
@@ -1249,6 +1250,7 @@
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
NewCaller = InvokeInst::Create(NewCallee,
II->getNormalDest(), II->getUnwindDest(),
+ II->getPersonalityFn(),
NewArgs.begin(), NewArgs.end(),
Caller->getName(), Caller);
cast<InvokeInst>(NewCaller)->setCallingConv(II->getCallingConv());
Modified: llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp Sun May 23 17:59:07 2010
@@ -66,6 +66,7 @@
SmallVector<Value*, 8> InvokeArgs(CI->op_begin()+1, CI->op_end());
InvokeInst *II =
InvokeInst::Create(CI->getCalledValue(), Split, InvokeDest,
+ 0, // EH-FIXME!
InvokeArgs.begin(), InvokeArgs.end(),
CI->getName(), BB->getTerminator());
II->setCallingConv(CI->getCallingConv());
Modified: llvm/branches/wendling/eh/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/VMCore/Core.cpp?rev=104477&r1=104476&r2=104477&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/VMCore/Core.cpp (original)
+++ llvm/branches/wendling/eh/lib/VMCore/Core.cpp Sun May 23 17:59:07 2010
@@ -1725,10 +1725,10 @@
LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef B, LLVMValueRef Fn,
LLVMValueRef *Args, unsigned NumArgs,
LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
- const char *Name) {
+ LLVMValueRef PersFn, const char *Name) {
return wrap(unwrap(B)->CreateInvoke(unwrap(Fn), unwrap(Then), unwrap(Catch),
- unwrap(Args), unwrap(Args) + NumArgs,
- Name));
+ unwrap(PersFn), unwrap(Args),
+ unwrap(Args) + NumArgs, Name));
}
LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef B) {
More information about the llvm-branch-commits
mailing list