From 3567d27062327df11daf918ea9da2cd603686f9e Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 2 Apr 2015 21:13:31 +0000 Subject: [WinEH] Make llvm.eh.actions use frameescape indices for catch params This makes it possible to use the same representation of llvm.eh.actions in outlined handlers as we use in the parent function because i32's are just constants that can be copied freely between functions. I had to add a sentinel alloca to the list of child allocas so that we don't try to sink the catch object into the handler. Normally, one would use nullptr for this kind of thing, but TinyPtrVector doesn't support null elements. More than that, it's elements have to have a suitable alignment. Therefore, I settled on this for my sentinel: AllocaInst *getCatchObjectSentinel() { return static_cast(nullptr) + 1; } llvm-svn: 233947 --- llvm/lib/IR/Verifier.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/IR') diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 1cdb99c4366..31ddd6543a7 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -3204,6 +3204,8 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { Assert(!SawFrameEscape, "multiple calls to llvm.frameescape in one function", &CI); for (Value *Arg : CI.arg_operands()) { + if (isa(Arg)) + continue; // Null values are allowed as placeholders. auto *AI = dyn_cast(Arg->stripPointerCasts()); Assert(AI && AI->isStaticAlloca(), "llvm.frameescape only accepts static allocas", &CI); -- cgit v1.2.3