diff --git a/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp b/llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp index c9f9f6c5e6a8e..19e9b65da1747 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 2cb2419bb3f81..6006b86aa3858 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));