[PATCH] D11041: New EH representation for MSVC compatibility

David Majnemer david.majnemer at gmail.com
Thu Jul 9 12:54:31 PDT 2015


majnemer 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);
----------------
JosephTremoulet wrote:
> 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.
> 
> 
> 
Ah yes, I forgot the `unwind to caller` case.


http://reviews.llvm.org/D11041







More information about the llvm-commits mailing list