[PATCH] D55278: [NewPM] -print-module-scope -print-after now prints module even after invalidated Loop/SCC

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 17 13:30:54 PST 2018


philip.pfaffe added a comment.

This generally looks fine, some code comments inline.



================
Comment at: lib/Passes/StandardInstrumentations.cpp:34
+/// of \p IR for use in header when printing.
+std::pair<const Module *, std::string> unwrapModule(Any IR) {
+  std::string Extra;
----------------
This should be an Optional.


================
Comment at: lib/Passes/StandardInstrumentations.cpp:35
+std::pair<const Module *, std::string> unwrapModule(Any IR) {
+  std::string Extra;
   const Module *M = nullptr;
----------------
Why this intermiate? Why not just return?


================
Comment at: lib/Passes/StandardInstrumentations.cpp:169
+  assert(!ModuleDescStack.empty() && "empty ModuleDescStack");
+  auto ModuleDesc = ModuleDescStack.pop_back_val();
+  assert(std::get<2>(ModuleDesc).equals(PassID) && "malformed ModuleDescStack");
----------------
Avoid AAA


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55278





More information about the llvm-commits mailing list