[PATCH] D42707: [DWARFv5] Emit .debug_line_str (in a non-DWO file)

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 14:27:11 PST 2018


dblaikie added inline comments.


================
Comment at: llvm/lib/MC/MCDwarf.cpp:78
+  /// Indicate whether we're emitting a .debug_line_str section.
+  operator bool() { return LineStrLabel != nullptr; }
+};
----------------
Any op bool should be marked explicit - otherwise there's all manner of implicit conversions that can get weird.


================
Comment at: llvm/lib/MC/MCDwarf.cpp:482
   if (LineTableVersion >= 5)
-    emitV5FileDirTables(MCOS);
+    emitV5FileDirTables(MCOS, LineStr);
   else
----------------
I'm not quite sure - is there a reason that emitV5FileDirTables handle the whole MCDwarfLineStr functionality internally without having to pass in an MCDwarfLineStr object? (emitV5FileDirTables could create the MCDwarfLineStr locally, potentially & emit it immediately?)?


================
Comment at: llvm/test/MC/ELF/debug-md5.s:20-25
+# CHECK: .debug_line_str contents:
+# CHECK-NEXT: 0x00000000: ""
+# CHECK-NEXT: 0x00000001: "dir1"
+# CHECK-NEXT: 0x00000006: "dir2"
+# CHECK-NEXT: 0x0000000b: "foo"
+# CHECK-NEXT: 0x0000000f: "bar"
----------------
Any way to test that the line table is actually using the indexes into the debug_line_str section?


Repository:
  rL LLVM

https://reviews.llvm.org/D42707





More information about the llvm-commits mailing list