[PATCH] D12434: [WinEH] Teach SimplfyCFG to eliminate empty cleanup pads.
Joseph Tremoulet via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 3 18:07:55 PDT 2015
JosephTremoulet added a comment.
One last nit.
> Any objections to my committing this as is and doing the proposed refactoring as part of a separate change set?
No, that plan sounds good. In fact I checked in http://reviews.llvm.org/rL246751 with some code at line 3314 in WinEHPrepare.cpp that rewrites `cleanupendpad`s as `unreachable` but instead ought to be calling this helper that the refactoring will create to change its predecessors to 'unwind to caller' (or from `invoke` to `call`).
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2994
@@ +2993,3 @@
+ unsigned Idx = DestPN->getBasicBlockIndex(BB);
+ if (Idx != -1) {
+ // This PHI node has an incoming value that corresponds to a control
----------------
I'm pretty sure you could assert `Idx != -1`; `DestPN` is a PHI node in block `UnwindDest`, which must have `BB` as a predecessor because it is the `->getUnwindDest()` of `BB`'s terminator.
Repository:
rL LLVM
http://reviews.llvm.org/D12434
More information about the llvm-commits
mailing list