[Lldb-commits] [lldb] Add symbol locator time for each module in statistics (PR #134563)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 18 11:55:53 PDT 2025


================
@@ -956,6 +961,20 @@ class Module : public std::enable_shared_from_this<Module>,
     bool m_match_name_after_lookup = false;
   };
 
+  class StatisticsMap {
+  public:
+    void add(const std::string &key, double value) {
+      if (key.empty())
+        return;
+      auto it = map.find(key);
+      if (it == map.end())
+        map.try_emplace(key, value);
+      else
+        it->second += value;
+    }
+    std::unordered_map<std::string, double> map;
+  };
+
----------------
clayborg wrote:

Move this to Statistics.h so we can re-use elsewhere if needed.

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


More information about the lldb-commits mailing list