dblaikie added inline comments.

================
Comment at: clang/include/clang/Driver/Options.td:2145-2146
   HelpText<"Generate source-level debug information with dwarf version 5">;
+def gdwarf64 : Flag<["-"], "gdwarf64">, Group<g_Group>, Flags<[CC1Option]>,
+  HelpText<"Generate DWARF64 debug information.">;
 
----------------
Does this actually enable debug info emission (the -gdwarf-N versions do cause 
debug info to be emitted, and set the dwarf version - but, say -ggnu-pubnames 
does not cause debug info to be emitted if it isn't otherwise requested). 
Experience has shown it's probably better to have flags like this not enable 
debug info emission - so they can be used orthogonally (eg: if a project is 
large, it can add -gdwarf64 to its flags permanently, even though maybe only 
some build modes, etc, enable debug info (with -g))

If this doesn't enable debug info emission, the phrasing of the help text might 
be worth changing somewhat (I wonder how we document -ggnu-pubnames, for 
instance/comparison/inspiration)


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4022-4023
+    if (DWARFVersion < 3)
+      D.Diag(diag::err_drv_argument_only_allowed_with)
+          << A->getAsString(Args) << "-gdwarf-5, -gdwarf-4, -gdwarf-3";
+    else if (!RawTriple.isArch64Bit())
----------------
perhaps we could phrase this more generally (so it's true even when DWARFv6 
comes along - and doesn't get unwieldy listing all the DWARF versions).

"DWARFv3 or later" ?


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4025
+          << A->getAsString(Args) << "64 bit architecutre";
+    else
+      CmdArgs.push_back("-gdwarf64");
----------------
ikudrin wrote:
> We also should check that the output format is ELF.
Is DWARF64 not supported on MachO, for instance? (I'd have DWARF64 would be 
pretty usable on any platform that supported DWARF in general - certainly some 
system tools that are DWARF aware (including actual debuggers) might not be up 
to the task of using it - but if we can correctly generate it in the object 
files, it seems OK to accept the request (useful for folks testing 
out/implementing DWARF64 consumers on those platforms))


================
Comment at: clang/test/Driver/debug-options.c:390
+// GDWARF64_OFF:  error: invalid argument '-gdwarf64' only allowed with 
'-gdwarf-5, -gdwarf-4, -gdwarf-3'
+// GDWARF64_32ARCH: error: invalid argument '-gdwarf64' only allowed with '64 
bit architecutre'
----------------
Typo in "architecture"


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90507/new/

https://reviews.llvm.org/D90507

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to