================ @@ -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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits