[llvm] a3afff9 - Remove some noisy log messages from showing up in llvm-gsymutil output.

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 14:13:13 PDT 2023


Author: Greg Clayton
Date: 2023-08-09T14:13:03-07:00
New Revision: a3afff9fd56c437b8a3228e3a96dfb7ee6ae4165

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

LOG: Remove some noisy log messages from showing up in llvm-gsymutil output.

This patch removes two log messages that were causing noisy output:
- when we have a zero sized symbol that gets removed in favor of something with a size or with debug info
- when an inlined function's address range has the same high and low pc, don't emit an error message as this is a common technique to indicate a function has been stripped or is no longer present.

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
index c9f9f6c5e6a8e8..19e9b65da17470 100644
--- a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+++ b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
@@ -221,13 +221,18 @@ static void parseInlineInfo(GsymCreator &Gsym, raw_ostream *Log, CUInfo &CUI,
         // Check that the inlined function is within the any of the range the
         // parent InlineInfo. If it isn't remove it!
         AddressRange InlineRange(Range.LowPC, Range.HighPC);
-        if (parent.Ranges.contains(InlineRange)) {
-          II.Ranges.insert(InlineRange);
-        } else if (Log) {
-          *Log << "error: inlined function DIE at " << HEX32(Die.getOffset())
-               << " has a range [" << HEX64(Range.LowPC) << " - "
-               << HEX64(Range.HighPC) << ") that isn't contained in any parent "
-               << "address ranges, this inline range will be removed.\n";
+        // Check for empty inline range in case inline function was outlined
+        // or has not code
+        if (!InlineRange.empty()) {
+          if (parent.Ranges.contains(InlineRange)) {
+            II.Ranges.insert(InlineRange);
+          } else if (Log) {
+            *Log << "error: inlined function DIE at " << HEX32(Die.getOffset())
+                 << " has a range [" << HEX64(Range.LowPC) << " - "
+                 << HEX64(Range.HighPC) << ") that isn't contained in any "
+                 << "parent address ranges, this inline range will be "
+                    "removed.\n";
+          }
         }
       }
     }

diff  --git a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
index 2cb2419bb3f81d..6006b86aa3858f 100644
--- a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
+++ b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
@@ -270,11 +270,9 @@ llvm::Error GsymCreator::finalize(llvm::raw_ostream &OS) {
           }
         } else {
           if (Prev.Range.size() == 0 && Curr.Range.contains(Prev.Range.start())) {
-            if (!Quiet) {
-              OS << "warning: removing symbol:\n"
-                << Prev << "\nKeeping:\n"
-                << Curr << "\n";
-            }
+            // Symbols on macOS don't have address ranges, so if the range
+            // doesn't match and the size is zero, then we replace the empty
+            // symbol function info with the current one.
             std::swap(Prev, Curr);
           } else {
             FinalizedFuncs.emplace_back(std::move(Curr));


        


More information about the llvm-commits mailing list