[PATCH] D54740: [NewPM] fixing asserts on deleted loop in -print-after-all

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 04:43:56 PST 2018


philip.pfaffe added inline comments.


================
Comment at: lib/Passes/StandardInstrumentations.cpp:136-137
   SmallString<20> Banner = formatv("*** IR Dump After {0} ***", PassID);
+  // TODO: handle cases when IR is nullptr (i.e. has been invalidated)
+  // but we still need to print the module due to forcePrintModuleIR.
   unwrapAndPrint(Banner, IR);
----------------
fedor.sergeev wrote:
> chandlerc wrote:
> > FWIW, I think the way to handle this is to bind a reference to the module into the callback so that it intrinsically has access to it to print.
> Thats true, just wanted to do that separately (and, btw, address the same problem for Legacy printer).
Same as above.


================
Comment at: lib/Passes/StandardInstrumentations.cpp:58
     const LazyCallGraph::SCC *C = any_cast<const LazyCallGraph::SCC *>(IR);
-    assert(C);
+    // We get nullptr here when current SCC gets invalidated by the pass.
+    if (C == nullptr)
----------------
Is that still the case? You don't hook up the Invalidated callback below.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54740/new/

https://reviews.llvm.org/D54740





More information about the llvm-commits mailing list