[llvm] Gsymutil aggregation similar to DwarfDump --verify (PR #81154)

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 11:45:06 PST 2024


================
@@ -596,29 +612,26 @@ Error DwarfTransformer::convert(uint32_t NumThreads, raw_ostream *OS) {
       DWARFDie Die = getDie(*CU);
       if (Die) {
         CUInfo CUI(DICtx, dyn_cast<DWARFCompileUnit>(CU.get()));
-        pool.async([this, CUI, &LogMutex, OS, Die]() mutable {
-          std::string ThreadLogStorage;
-          raw_string_ostream ThreadOS(ThreadLogStorage);
-          handleDie(OS ? &ThreadOS: nullptr, CUI, Die);
-          ThreadOS.flush();
-          if (OS && !ThreadLogStorage.empty()) {
-            // Print ThreadLogStorage lines into an actual stream under a lock
-            std::lock_guard<std::mutex> guard(LogMutex);
-            *OS << ThreadLogStorage;
-          }
+        pool.async([this, CUI, &LogMutex, Out, Die]() mutable {
+          StringAggregator ThreadOut(Out.IsShowingDetail());
----------------
clayborg wrote:

We can just use the `OutputAggregator` here and get rid of the `StringAggregator` class:
```
std::string storage;
raw_string_ostream StrStream;
OutputAggregator ThreadOut(Out.GetOS() ? &StrStream : nullptr);
```

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


More information about the llvm-commits mailing list