[llvm] [Pass] Support start/stop in instrumentation (PR #70912)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 21:48:32 PST 2024


================
@@ -152,6 +153,11 @@ class PassInstrumentationCallbacks {
   void addClassToPassName(StringRef ClassName, StringRef PassName);
   /// Get the pass name for a given pass class name.
   StringRef getPassNameForClassName(StringRef ClassName);
+  /// Inverse of getPassNameForClassName
+  StringRef getClassNameForPassName(StringRef PassName);
+
+  /// Helper callback to support options like start-before.
+  llvm::unique_function<StartStopFunc> StartStopCallback;
----------------
aeubanks wrote:

I'm missing where this is being used.

Also, `PassInstrumentationCallbacks` doesn't really seem like the right place to put this. The only reason we interact with PIC is to get the class/pass name map. If we can somehow separate that out, that would be ideal, but perhaps that's too hard.

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


More information about the llvm-commits mailing list