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

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 08:28:05 PDT 2017


probinson marked 4 inline comments as done.
probinson added a comment.

Thanks for taking time with this!



================
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)
----------------
dblaikie wrote:
> 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?
No, just missed one place.


================
Comment at: include/llvm/DebugInfo/DWARF/DWARFUnit.h:200-203
+  DWARFDataExtractor getDebugInfoExtractor() const {
+    return DWARFDataExtractor(InfoSection, isLittleEndian,
+                              getAddressByteSize());
   }
----------------
dblaikie wrote:
> 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?)
The latter.  In fact before I did this, I had tripped over a case where I incorrectly attached the .debug_line relocations to a use of .debug_line.dwo, and this turned out to be a good refactoring to avoid that kind of mistake.


https://reviews.llvm.org/D34704





More information about the llvm-commits mailing list