[clang] [llvm] [NFC][InstrProf] Refactor InstrProfiling lowering pass (PR #74970)

Mircea Trofin via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 10 16:26:06 PST 2023


================
@@ -31,31 +31,45 @@ using LoadStorePair = std::pair<Instruction *, Instruction *>;
 /// Instrumentation based profiling lowering pass. This pass lowers
 /// the profile instrumented code generated by FE or the IR based
 /// instrumentation pass.
-class InstrProfiling : public PassInfoMixin<InstrProfiling> {
+class InstrProfilingLoweringPass
+    : public PassInfoMixin<InstrProfilingLoweringPass> {
+  const InstrProfOptions Options;
+  // Is this lowering for the context-sensitive instrumentation.
+  const bool IsCS;
+
 public:
-  InstrProfiling() : IsCS(false) {}
-  InstrProfiling(const InstrProfOptions &Options, bool IsCS = false)
+  InstrProfilingLoweringPass() : IsCS(false) {}
+  InstrProfilingLoweringPass(const InstrProfOptions &Options, bool IsCS = false)
       : Options(Options), IsCS(IsCS) {}
 
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
-  bool run(Module &M,
-           std::function<const TargetLibraryInfo &(Function &F)> GetTLI);
+};
+class InstrProfiling final {
----------------
mtrofin wrote:

Done, will move it to the cpp next.

https://github.com/llvm/llvm-project/pull/74970


More information about the cfe-commits mailing list