[PATCH] D109542: [NPM] Complementary fixes for opt option -print-pipeline-passes

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 13:50:04 PDT 2021


bjope added inline comments.


================
Comment at: llvm/include/llvm/IR/PassManager.h:388
+    // Drop anonymous namespace here handle passes such as NoOpModulePass.
+    ClassName.consume_front("(anonymous namespace)::");
     auto PassName = MapClassName2PassName(ClassName);
----------------
aeubanks wrote:
> IIRC (and I might not be), there was some issue with different compilers providing slightly different names
> 
> But those classes can just manually override `name()` anyway, so I don't think this is necessary
It seems like the name() function that called is the one above, even if "struct NoOpModulePass" etc in PassBuilder.cpp has a their own name() functions. Not sure exactly why but those static functions aren't virtual(?).

One solution if "(anonymous namespace)::" isn't "portable" would be to add printPipeline methods in those structs in PassBuilder.cpp that is in the anonymous namespace.
Or maybe we could add some llvmtest namespace or similar (if the anonymous namespace is used just to avoid having those testing purpose passes in the regular llvm namespace (or why can't they be in the llvm namespace).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109542



More information about the llvm-commits mailing list