[PATCH] D34704: [DWARF] NFC: Combine relocs with DataExtractor

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 19:27:05 PDT 2017


dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.


================
Comment at: include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h:48
 public:
-  DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection,
-                        const RelocAddrMap &Relocs)
-    : AccelSection(AccelSection), StringSection(StringSection), Relocs(Relocs) {}
+  DWARFAcceleratorTable(DWARFDataExtractor AccelSection,
+                        DataExtractor StringSection)
----------------
Most other places seem to be passing DWARFDataExtractor by const ref rather than by value. Pick one? Or is there something I'm missing that motivates the difference?


================
Comment at: include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:32
+  DWARFDataExtractor(StringRef Data, bool IsLittleEndian, uint8_t AddressSize)
+    : DataExtractor(Data, IsLittleEndian, AddressSize), RelocMap(nullptr) {}
+
----------------
Could use a non-static data member initializer to initializer RelocMap to null & omit it from the init list here, if you like.


================
Comment at: include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:29
 public:
-  DWARFDebugLine(const RelocAddrMap *LineInfoRelocMap)
-      : RelocMap(LineInfoRelocMap) {}
+  DWARFDebugLine() {}
 
----------------
Drop this if it's the default/implicit


================
Comment at: include/llvm/DebugInfo/DWARF/DWARFUnit.h:200-203
+  DWARFDataExtractor getDebugInfoExtractor() const {
+    return DWARFDataExtractor(InfoSection, isLittleEndian,
+                              getAddressByteSize());
   }
----------------
Was the original code incorrect here? (since it wasn't using relocs for whoever was calling it previously? Or have those callers been using getRelocated* and have been migrated by this change?)


https://reviews.llvm.org/D34704





More information about the llvm-commits mailing list