[PATCH] D42802: [DWARF] Regularize dumping strings from line tables.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 11:17:22 PST 2018


dblaikie added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:553
           if (OS)
-            *OS << " (" << FileEntry.Name.str()
+            *OS << " (" << FileEntry.Name.getAsCString().getValue()
                 << ", dir=" << FileEntry.DirIdx << ", mod_time="
----------------
Might be worth saving the CStr upfront/above, rather than having to go through the process of pulling it out of the DWARFFormValue 7 lines later down here?


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:927
   uint64_t IncludeDirIndex = Entry.DirIdx;
-  StringRef IncludeDir;
+  DWARFFormValue IncludeDir;
   // Be defensive about the contents of Entry.
----------------
Should this remain as a StringRef & the 'if' clause following be changed to contain the 'getAsCString().getValue()' part?


================
Comment at: llvm/test/DebugInfo/X86/dwarfdump-header.s:327-328
 # CHECK: max_ops_per_inst: 1
-# CHECK: include_directories[  0] = 'Directory5a'
-# CHECK: include_directories[  1] = 'Directory5b'
+# CHECK: include_directories[  0] = .debug_str[0x00000045] = "Directory5a"
+# CHECK: include_directories[  1] = .debug_str[0x00000051] = "Directory5b"
 # CHECK-NOT: include_directories
----------------
Should this print as ".debug_line_str"?


Repository:
  rL LLVM

https://reviews.llvm.org/D42802





More information about the llvm-commits mailing list