@@ -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
}
@@ -338,9 +337,13 @@ static void convertFunctionLineTable(OutputAggregator &Out, CUInfo &CUI,
338
337
if (FilePath.empty ()) {
339
338
// If we had a DW_AT_decl_file, but got no file then we need to emit a
340
339
// warning.
340
+ const uint64_t DwarfFileIdx = dwarf::toUnsigned (
341
+ Die.findRecursively (dwarf::DW_AT_decl_file), UINT32_MAX);
342
+ // Check if there is no DW_AT_decl_line attribute, and don't report an
343
+ // error if it isn't there.
344
+ if (DwarfFileIdx == UINT32_MAX)
345
+ return ;
341
346
Out.Report (" Invalid file index in DW_AT_decl_file" , [&](raw_ostream &OS) {
342
- const uint64_t DwarfFileIdx = dwarf::toUnsigned (
343
- Die.findRecursively (dwarf::DW_AT_decl_file), UINT32_MAX);
344
347
OS << " error: function DIE at " << HEX32 (Die.getOffset ())
345
348
<< " has an invalid file index " << DwarfFileIdx
346
349
<< " in its DW_AT_decl_file attribute, unable to create a single "
@@ -432,7 +435,7 @@ static void convertFunctionLineTable(OutputAggregator &Out, CUInfo &CUI,
432
435
// Skip multiple line entries for the same file and line.
433
436
auto LastLE = FI.OptLineTable ->last ();
434
437
if (LastLE && LastLE->File == FileIdx && LastLE->Line == Row.Line )
435
- continue ;
438
+ continue ;
436
439
// Only push a row if it isn't an end sequence. End sequence markers are
437
440
// included for the last address in a function or the last contiguous
438
441
// address in a sequence.
@@ -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