Skip to content

Commit a3afff9

Browse files
committed
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
1 parent 18e161f commit a3afff9

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,18 @@ static void parseInlineInfo(GsymCreator &Gsym, raw_ostream *Log, CUInfo &CUI,
221221
// Check that the inlined function is within the any of the range the
222222
// parent InlineInfo. If it isn't remove it!
223223
AddressRange InlineRange(Range.LowPC, Range.HighPC);
224-
if (parent.Ranges.contains(InlineRange)) {
225-
II.Ranges.insert(InlineRange);
226-
} else if (Log) {
227-
*Log << "error: inlined function DIE at " << HEX32(Die.getOffset())
228-
<< " has a range [" << HEX64(Range.LowPC) << " - "
229-
<< HEX64(Range.HighPC) << ") that isn't contained in any parent "
230-
<< "address ranges, this inline range will be removed.\n";
224+
// Check for empty inline range in case inline function was outlined
225+
// or has not code
226+
if (!InlineRange.empty()) {
227+
if (parent.Ranges.contains(InlineRange)) {
228+
II.Ranges.insert(InlineRange);
229+
} else if (Log) {
230+
*Log << "error: inlined function DIE at " << HEX32(Die.getOffset())
231+
<< " has a range [" << HEX64(Range.LowPC) << " - "
232+
<< HEX64(Range.HighPC) << ") that isn't contained in any "
233+
<< "parent address ranges, this inline range will be "
234+
"removed.\n";
235+
}
231236
}
232237
}
233238
}

llvm/lib/DebugInfo/GSYM/GsymCreator.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,9 @@ llvm::Error GsymCreator::finalize(llvm::raw_ostream &OS) {
270270
}
271271
} else {
272272
if (Prev.Range.size() == 0 && Curr.Range.contains(Prev.Range.start())) {
273-
if (!Quiet) {
274-
OS << "warning: removing symbol:\n"
275-
<< Prev << "\nKeeping:\n"
276-
<< Curr << "\n";
277-
}
273+
// Symbols on macOS don't have address ranges, so if the range
274+
// doesn't match and the size is zero, then we replace the empty
275+
// symbol function info with the current one.
278276
std::swap(Prev, Curr);
279277
} else {
280278
FinalizedFuncs.emplace_back(std::move(Curr));

0 commit comments

Comments
 (0)