[PATCH] D52428: Unify landing pad information adding routines (NFC)

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 16:46:23 PDT 2018


rnk added a comment.

Looks good to me.



================
Comment at: lib/CodeGen/MachineFunction.cpp:632-633
+  if (const auto *LPI = dyn_cast<LandingPadInst>(FirstI)) {
+    if (const auto *PF = dyn_cast<Function>(
+            FirstI->getFunction()->getPersonalityFn()->stripPointerCasts()))
+      getMMI().addPersonality(PF);
----------------
We can simplify this to `dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts())`, now that personalities live on the parent function, not the landingpad.


================
Comment at: lib/CodeGen/MachineFunction.cpp:639-641
+    // FIXME: New EH - Add the clauses in reverse order. This isn't 100%
+    // correct,
+    //        but we need to do it this way because of how the DWARF EH emitter
----------------
This comment is scary, but pre-existing, so I guess let's not worry about it.


Repository:
  rL LLVM

https://reviews.llvm.org/D52428





More information about the llvm-commits mailing list