[PATCH] D18126: Port InstrProfiling pass to new pass manager

David Li via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 13 10:32:27 PDT 2016


davidxl marked 2 inline comments as done.

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:34-37
@@ -33,14 +33,6 @@
 
-class InstrProfiling : public ModulePass {
+class InstrProfiling {
 public:
-  static char ID;
-
-  InstrProfiling() : ModulePass(ID) {}
-
-  InstrProfiling(const InstrProfOptions &Options)
-      : ModulePass(ID), Options(Options) {}
-
-  const char *getPassName() const override {
-    return "Frontend instrumentation-based coverage lowering";
-  }
+  InstrProfiling() {}
+  InstrProfiling(const InstrProfOptions &Options) : Options(Options) {}
 
----------------
chandlerc wrote:
> Why not make this the actual new pass manager class? That's how most of the passes with stat work. You can see SROA and recently GVN for examples (admitedly a bit more complex).
> 
> This will also show the most basic part of how to parameterize it - the constructors here are exactly what you want to be able to construct this pass out of specific options.
> 
This can be done -- but it will adds lots of overhead in the new pass manager class itself as this class keeps track of the state that only needed when the pass is actually run. Of course InstrProfOptions need to be part of the pass.



http://reviews.llvm.org/D18126





More information about the llvm-commits mailing list