[PATCH] D42766: [DebugInfo] Support DWARFv5 source code embedding extension

Paul Robinson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 23 15:55:47 PST 2018


probinson added a comment.

Looks generally straightforward.  I'd give other people a chance to chime in but I have only minor comments.



================
Comment at: lib/CodeGen/CGDebugInfo.cpp:411
     // If the location is not valid then use main input file.
-    return DBuilder.createFile(remapDIPath(TheCU->getFilename()),
-                               remapDIPath(TheCU->getDirectory()),
-                               TheCU->getFile()->getChecksumKind(),
-                               TheCU->getFile()->getChecksum());
+    return getOrCreateMainFile();
 
----------------
Looks like this simplification (replace two calls to createFile() with getOrCreateMainFile()) could be its own NFC commit and simplify this patch slightly.


================
Comment at: lib/Driver/ToolChains/Clang.cpp:3021
+  if (Args.hasFlag(options::OPT_gembed_source, options::OPT_gno_embed_source, false)) {
+    // Source embedding is a DWARFv5 extension. By now we have checked if a
+    // DWARF version was stated explicitly, and have otherwise fallen back to
----------------
Maybe "is an extension to DWARF v5" to clarify it's not actually part of DWARF v5.


Repository:
  rC Clang

https://reviews.llvm.org/D42766





More information about the cfe-commits mailing list