[PATCH] D11041: New EH representation for MSVC compatibility
Joseph Tremoulet
jotrem at microsoft.com
Thu Jul 9 12:05:29 PDT 2015
JosephTremoulet added inline comments.
================
Comment at: lib/IR/Instruction.cpp:468-471
@@ -457,2 +467,6 @@
return !CI->doesNotThrow();
+ if (const auto *CRI = dyn_cast<CleanupReturnInst>(this))
+ return CRI->unwindsToCaller();
+ if (const auto *CEBI = dyn_cast<CatchEndBlockInst>(this))
+ return CEBI->unwindsToCaller();
return isa<ResumeInst>(this);
----------------
majnemer wrote:
> JosephTremoulet wrote:
> > Should there be a clause for TerminateBlock here?
> I think TerminateBlock is more like a function-call which never returns and thus wouldn't throw.
The LangRef indicates that TerminateBlock might continue propagating the exception rather than never-return terminate the program (and it shouldn't need an unwind clause otherwise):
> where a personality routine may decide to terminate the program
> Control is transferred to the ``exception`` label if the personality routine decides not to terminate the program for the in-flight exception.
So in the event that a TerminateBlock unwinds to caller and chooses not to terminate the program, does that count as "throw" for these purposes? To me it seems analogous to the catchendblock case.
http://reviews.llvm.org/D11041
More information about the llvm-commits
mailing list