@@ -644,7 +644,6 @@ void DWARFRewriter::updateDebugInfo() {
644
644
std::move (DWORangeListsSectionWriter);
645
645
}
646
646
AddressWritersByCU[CU.getOffset ()] = std::move (AddrW);
647
-
648
647
} else {
649
648
auto AddrW =
650
649
std::make_unique<DebugAddrWriter>(&BC, CU.getAddressByteSize ());
@@ -669,18 +668,17 @@ void DWARFRewriter::updateDebugInfo() {
669
668
DWPState State;
670
669
if (opts::WriteDWP)
671
670
initDWPState (State);
672
- auto processSplitCU = [&](DWARFUnit * Unit, DIEBuilder * DIEBlder) {
671
+ auto processSplitCU = [&](DWARFUnit & Unit, DIEBuilder & DIEBlder) {
673
672
std::optional<DWARFUnit *> SplitCU;
674
- std::optional<uint64_t > RangesBase;
675
- std::optional<uint64_t > DWOId = Unit->getDWOId ();
673
+ std::optional<uint64_t > DWOId = Unit.getDWOId ();
676
674
if (DWOId)
677
675
SplitCU = BC.getDWOCU (*DWOId);
678
676
if (!SplitCU)
679
677
return ;
680
678
DebugAddrWriter &AddressWriter =
681
- *AddressWritersByCU[Unit-> getOffset ()].get ();
679
+ *AddressWritersByCU[Unit. getOffset ()].get ();
682
680
DIEBuilder DWODIEBuilder (BC, &(*SplitCU)->getContext (), DebugNamesTable,
683
- Unit);
681
+ & Unit);
684
682
DWODIEBuilder.buildDWOUnit (**SplitCU);
685
683
std::string DWOName = " " ;
686
684
std::optional<std::string> DwarfOutputPath =
@@ -689,56 +687,56 @@ void DWARFRewriter::updateDebugInfo() {
689
687
: std::optional<std::string>(opts::DwarfOutputPath.c_str ());
690
688
{
691
689
std::lock_guard<std::mutex> Lock (AccessMutex);
692
- DWOName = DIEBlder-> updateDWONameCompDir (
693
- *StrOffstsWriter, *StrWriter, * Unit, DwarfOutputPath, std::nullopt);
690
+ DWOName = DIEBlder. updateDWONameCompDir (
691
+ *StrOffstsWriter, *StrWriter, Unit, DwarfOutputPath, std::nullopt);
694
692
}
695
693
DebugStrOffsetsWriter DWOStrOffstsWriter (BC);
696
694
DebugStrWriter DWOStrWriter ((*SplitCU)->getContext (), true );
697
695
DWODIEBuilder.updateDWONameCompDirForTypes (
698
696
DWOStrOffstsWriter, DWOStrWriter, **SplitCU, DwarfOutputPath, DWOName);
699
- DebugLoclistWriter DebugLocDWoWriter (* Unit, Unit-> getVersion (), true ,
697
+ DebugLoclistWriter DebugLocDWoWriter (Unit, Unit. getVersion (), true ,
700
698
AddressWriter);
701
699
DebugRangesSectionWriter *TempRangesSectionWriter =
702
- Unit-> getVersion () >= 5 ? RangeListsWritersByCU[*DWOId].get ()
700
+ Unit. getVersion () >= 5 ? RangeListsWritersByCU[*DWOId].get ()
703
701
: LegacyRangesWritersByCU[*DWOId].get ();
704
702
705
703
updateUnitDebugInfo (*(*SplitCU), DWODIEBuilder, DebugLocDWoWriter,
706
704
*TempRangesSectionWriter, AddressWriter);
707
705
DebugLocDWoWriter.finalize (DWODIEBuilder,
708
706
*DWODIEBuilder.getUnitDIEbyUnit (**SplitCU));
709
- if (Unit-> getVersion () >= 5 )
707
+ if (Unit. getVersion () >= 5 )
710
708
TempRangesSectionWriter->finalizeSection ();
711
709
712
- emitDWOBuilder (DWOName, DWODIEBuilder, *this , **SplitCU, * Unit, State,
710
+ emitDWOBuilder (DWOName, DWODIEBuilder, *this , **SplitCU, Unit, State,
713
711
DebugLocDWoWriter, DWOStrOffstsWriter, DWOStrWriter,
714
712
GDBIndexSection);
715
713
};
716
- auto processMainBinaryCU = [&](DWARFUnit * Unit, DIEBuilder * DIEBlder,
717
- DebugLocWriter * DebugLocWriter) {
714
+ auto processMainBinaryCU = [&](DWARFUnit & Unit, DIEBuilder & DIEBlder,
715
+ DebugLocWriter & DebugLocWriter) {
718
716
DebugAddrWriter &AddressWriter =
719
- *AddressWritersByCU[Unit-> getOffset ()].get ();
717
+ *AddressWritersByCU[Unit. getOffset ()].get ();
720
718
DebugRangesSectionWriter &RangesSectionWriter =
721
- Unit-> getVersion () >= 5 ? *RangeListsSectionWriter.get ()
719
+ Unit. getVersion () >= 5 ? *RangeListsSectionWriter.get ()
722
720
: *LegacyRangesSectionWriter.get ();
723
721
std::optional<uint64_t > RangesBase;
724
722
std::optional<DWARFUnit *> SplitCU;
725
- std::optional<uint64_t > DWOId = Unit-> getDWOId ();
723
+ std::optional<uint64_t > DWOId = Unit. getDWOId ();
726
724
if (DWOId)
727
725
SplitCU = BC.getDWOCU (*DWOId);
728
- if (Unit-> getVersion () >= 5 ) {
729
- RangesBase = RangesSectionWriter-> getSectionOffset () +
726
+ if (Unit. getVersion () >= 5 ) {
727
+ RangesBase = RangesSectionWriter. getSectionOffset () +
730
728
getDWARF5RngListLocListHeaderSize ();
731
- RangesSectionWriter-> initSection (* Unit);
732
- StrOffstsWriter->finalizeSection (* Unit, * DIEBlder);
729
+ RangesSectionWriter. initSection (Unit);
730
+ StrOffstsWriter->finalizeSection (Unit, DIEBlder);
733
731
} else if (SplitCU) {
734
732
RangesBase = LegacyRangesSectionWriter.get ()->getSectionOffset ();
735
733
}
736
734
737
- updateUnitDebugInfo (* Unit, * DIEBlder, * DebugLocWriter, RangesSectionWriter,
735
+ updateUnitDebugInfo (Unit, DIEBlder, DebugLocWriter, RangesSectionWriter,
738
736
AddressWriter, RangesBase);
739
- DebugLocWriter-> finalize (* DIEBlder, *DIEBlder-> getUnitDIEbyUnit (* Unit));
740
- if (Unit-> getVersion () >= 5 )
741
- RangesSectionWriter-> finalizeSection ();
737
+ DebugLocWriter. finalize (DIEBlder, *DIEBlder. getUnitDIEbyUnit (Unit));
738
+ if (Unit. getVersion () >= 5 )
739
+ RangesSectionWriter. finalizeSection ();
742
740
};
743
741
744
742
DIEBuilder DIEBlder (BC, BC.DwCtx .get (), DebugNamesTable);
0 commit comments