[llvm] 14850a0 - Log to the right stream in DwarfTransformer::handleDie().

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 14:00:26 PDT 2021


Author: Greg Clayton
Date: 2021-09-08T14:00:19-07:00
New Revision: 14850a062845bef842ee54417b8a0771dbc732a4

URL: https://github.com/llvm/llvm-project/commit/14850a062845bef842ee54417b8a0771dbc732a4
DIFF: https://github.com/llvm/llvm-project/commit/14850a062845bef842ee54417b8a0771dbc732a4.diff

LOG: Log to the right stream in DwarfTransformer::handleDie().

Since we might end up using multiple threads when logging information in the DWARFTransformer, the handleDie() method must use the supplied stream named "OS" when logging warnings and errors. When we use multiple threads, we log to a thread specific stream buffer and then use a mutex to ensure our output doesn't overlap when we emit warnings and errors after a thread is done.

Differential Revision: https://reviews.llvm.org/D109401

Added: 
    

Modified: 
    llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
index 075f08c21b703..b2c43b893cd32 100644
--- a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+++ b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
@@ -392,11 +392,11 @@ void DwarfTransformer::handleDie(raw_ostream &OS, CUInfo &CUI, DWARFDie Die) {
         if (Range.LowPC != 0) {
           if (!Gsym.isQuiet()) {
             // Unexpected invalid address, emit a warning
-            Log << "warning: DIE has an address range whose start address is "
-                   "not in any executable sections ("
-                << *Gsym.GetValidTextRanges()
-                << ") and will not be processed:\n";
-            Die.dump(Log, 0, DIDumpOptions::getForSingleDIE());
+            OS << "warning: DIE has an address range whose start address is "
+                  "not in any executable sections ("
+               << *Gsym.GetValidTextRanges()
+               << ") and will not be processed:\n";
+            Die.dump(OS, 0, DIDumpOptions::getForSingleDIE());
           }
         }
         break;


        


More information about the llvm-commits mailing list