================
@@ -9,26 +9,34 @@
 #include "lldb/Core/Progress.h"
 
 #include "lldb/Core/Debugger.h"
-#include "lldb/Utility/StreamString.h"
 
 #include <optional>
 
 using namespace lldb;
 using namespace lldb_private;
 
 std::atomic<uint64_t> Progress::g_id(0);
+std::atomic<uint64_t> Progress::g_refcount(1);
+std::unordered_map<std::string, uint64_t> Progress::g_map = {};
 
 Progress::Progress(std::string title, std::string details,
                    std::optional<uint64_t> total,
-                   lldb_private::Debugger *debugger)
+                   lldb_private::Debugger *debugger, bool type)
     : m_title(title), m_details(details), m_id(++g_id), m_completed(0),
-      m_total(Progress::kNonDeterministicTotal) {
+      m_total(Progress::kNonDeterministicTotal), m_type(type) {
   if (total)
     m_total = *total;
 
   if (debugger)
     m_debugger_id = debugger->GetID();
   std::lock_guard<std::mutex> guard(m_mutex);
+
+  if (m_type == Progress::eProgressCoalecseReports) {
+    g_map.emplace(title, g_refcount);
+
+    if (g_map.at(title) >= 1)
+      ++g_map.at(title);
----------------
clayborg wrote:

Use the threadsafe `ProgressCategoryMap` here:
```
GetProgressCategoryMap()->Increment(title);
```

https://github.com/llvm/llvm-project/pull/81026
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to