[PATCH] D12108: [WinEH] Require token linkage in EH pad/ret signatures

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 17:34:59 PDT 2015


majnemer added a comment.

In http://reviews.llvm.org/D12108#227888, @JosephTremoulet wrote:

> I suppose I could change just the `FooReturnInst::getFooPad()` accessors' return types to `FooPad *` (and remove support for `undef` from the verifier, LangRef, examples, and tests).  That way:
>
> - Parsers could still sneak in an `Argument` through the public API (and likewise for any transforms that temporarily use placeholder values during a rewrite)
> - `Create` and `setFooPad()` would agree with each other in accepting arbitrary `Value *` (but the verifier would catch non-`FooPad`s if any were left)
> - Callers of `getFooPad()` wanting a `FooPadInst *` wouldn't have to downcast, and wouldn't have to deal with the possibility of `undef`
>
>   That //would// mean we'll have values that can't have all their uses replaced with `undef` (unless those uses are rewritten/removed before the next verifier pass), but if that's not an important property to preserve for LLVM (I may have been biased by other codebases) then callers of `getFooPad` will benefit.
>
>   Would that be a happy compromise?


I think it's OK to let non-pad operands have undef so long as they are transient and will get wiped out before the next pass runs.  We permit this sort of thing for degenerate `phi` and basic blocks.


================
Comment at: docs/ExceptionHandling.rst:676
@@ -676,3 +675,3 @@
   lpad.cleanup:                                     ; preds = %invoke.cont
-    cleanuppad [label %lpad.catch]
+    %cleanup = cleanuppad
     call void @"\01??_DCleanup@@QEAA at XZ"(%struct.Cleanup* nonnull %obj) nounwind
----------------
Shouldn't the `cleanuppad` be followed by `[]`

================
Comment at: docs/ExceptionHandling.rst:681
@@ -681,3 +680,3 @@
   lpad.catch:                                       ; preds = %entry, %lpad.cleanup
-    catchpad void [%rtti.TypeDescriptor2* @"\01??_R0H at 8", i32 0, i32* %e]
+    %catch = catchpad void [%rtti.TypeDescriptor2* @"\01??_R0H at 8", i32 0, i32* %e]
             to label %catch unwind label %lpad.terminate
----------------
Should the `void` be removed?


http://reviews.llvm.org/D12108





More information about the llvm-commits mailing list