[llvm] [NFC] Move DroppedVariableStats to its own file and redesign it to be extensible. (PR #115563)

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 13:00:41 PST 2024


================
@@ -35,22 +38,32 @@ class DroppedVariableStats {
           << "Pass Level, Pass Name, Num of Dropped Variables, Func or "
              "Module Name\n";
   };
+
+  virtual ~DroppedVariableStats() = default;
+
   // We intend this to be unique per-compilation, thus no copies.
   DroppedVariableStats(const DroppedVariableStats &) = delete;
   void operator=(const DroppedVariableStats &) = delete;
 
-  void registerCallbacks(PassInstrumentationCallbacks &PIC);
-  void runBeforePass(StringRef PassID, Any IR);
-  void runAfterPass(StringRef PassID, Any IR, const PreservedAnalyses &PA);
-  void runAfterPassInvalidated(StringRef PassID, const PreservedAnalyses &PA);
   bool getPassDroppedVariables() { return PassDroppedVariables; }
 
-private:
+protected:
+  void setup() {
+    DebugVariablesStack.push_back(
+        {DenseMap<const Function *, DebugVariables>()});
+    InlinedAts.push_back(
+        {DenseMap<StringRef, DenseMap<VarID, DILocation *>>()});
+    return;
----------------
adrian-prantl wrote:

this is redundant

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


More information about the llvm-commits mailing list