@@ -82,7 +82,6 @@ struct llvm::gsym::CUInfo {
82
82
}
83
83
};
84
84
85
-
86
85
static DWARFDie GetParentDeclContextDIE (DWARFDie &Die) {
87
86
if (DWARFDie SpecDie =
88
87
Die.getAttributeValueAsReferencedDie (dwarf::DW_AT_specification)) {
@@ -170,7 +169,7 @@ getQualifiedNameIndex(DWARFDie &Die, uint64_t Language, GsymCreator &Gsym) {
170
169
// templates
171
170
if (ParentName.front () == ' <' && ParentName.back () == ' >' )
172
171
Name = " {" + ParentName.substr (1 , ParentName.size () - 2 ).str () + " }" +
173
- " ::" + Name;
172
+ " ::" + Name;
174
173
else
175
174
Name = ParentName.str () + " ::" + Name;
176
175
}
@@ -432,7 +431,7 @@ static void convertFunctionLineTable(OutputAggregator &Out, CUInfo &CUI,
432
431
// Skip multiple line entries for the same file and line.
433
432
auto LastLE = FI.OptLineTable ->last ();
434
433
if (LastLE && LastLE->File == FileIdx && LastLE->Line == Row.Line )
435
- continue ;
434
+ continue ;
436
435
// Only push a row if it isn't an end sequence. End sequence markers are
437
436
// included for the last address in a function or the last contiguous
438
437
// address in a sequence.
@@ -629,6 +628,10 @@ Error DwarfTransformer::convert(uint32_t NumThreads, OutputAggregator &Out) {
629
628
size_t NumBefore = Gsym.getNumFunctionInfos ();
630
629
auto getDie = [&](DWARFUnit &DwarfUnit) -> DWARFDie {
631
630
DWARFDie ReturnDie = DwarfUnit.getUnitDIE (false );
631
+ // Apple uses DW_AT_GNU_dwo_id for things other than split DWARF.
632
+ if (IsMachO)
633
+ return ReturnDie;
634
+
632
635
if (DwarfUnit.getDWOId ()) {
633
636
DWARFUnit *DWOCU = DwarfUnit.getNonSkeletonUnitDIE (false ).getDwarfUnit ();
634
637
if (!DWOCU->isDWOUnit ())
@@ -718,8 +721,8 @@ llvm::Error DwarfTransformer::verify(StringRef GsymPath,
718
721
for (uint32_t I = 0 ; I < NumAddrs; ++I) {
719
722
auto FuncAddr = Gsym->getAddress (I);
720
723
if (!FuncAddr)
721
- return createStringError (std::errc::invalid_argument,
722
- " failed to extract address[%i]" , I);
724
+ return createStringError (std::errc::invalid_argument,
725
+ " failed to extract address[%i]" , I);
723
726
724
727
auto FI = Gsym->getFunctionInfo (*FuncAddr);
725
728
if (!FI)
@@ -734,8 +737,7 @@ llvm::Error DwarfTransformer::verify(StringRef GsymPath,
734
737
if (!LR)
735
738
return LR.takeError ();
736
739
737
- auto DwarfInlineInfos =
738
- DICtx.getInliningInfoForAddress (SectAddr, DLIS);
740
+ auto DwarfInlineInfos = DICtx.getInliningInfoForAddress (SectAddr, DLIS);
739
741
uint32_t NumDwarfInlineInfos = DwarfInlineInfos.getNumberOfFrames ();
740
742
if (NumDwarfInlineInfos == 0 ) {
741
743
DwarfInlineInfos.addFrame (
@@ -773,8 +775,7 @@ llvm::Error DwarfTransformer::verify(StringRef GsymPath,
773
775
continue ;
774
776
}
775
777
776
- for (size_t Idx = 0 , count = LR->Locations .size (); Idx < count;
777
- ++Idx) {
778
+ for (size_t Idx = 0 , count = LR->Locations .size (); Idx < count; ++Idx) {
778
779
const auto &gii = LR->Locations [Idx];
779
780
if (Idx < NumDwarfInlineInfos) {
780
781
const auto &dii = DwarfInlineInfos.getFrame (Idx);
0 commit comments