[PATCH] D13221: Make CompilerInvocation's use of the debug options more understandable.

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 2 18:43:29 PDT 2015


jyknight added a comment.

This certainly seems a big improvement.

However, I don't think that you actually fixed specifying both -gline-tables-only and a Dwarf version, because that requires actually handling multiple options from g_group, instead of just the last one. E.g. "-gdwarf-2 -g1" should cause the dwarf level to be set to 2, and enable line-tables. I expect the correct thing for Driver to do is to process *all* the args and apply them one at a time to the state variables, rather than just take the last arg.

(Not that I'm recommending that you fix that also in this commit, just not to claim it now works unless it does)


================
Comment at: include/clang/Driver/CC1Options.td:135
@@ -134,1 +134,3 @@
 
+def debug_info_kind_EQ : Joined<["-"], "di-kind=">;
+def dwarf_version_EQ : Joined<["-"], "dwarf-version=">;
----------------
I'd suggest to keep the name of thevar and the string the same for easy searching.

================
Comment at: lib/Driver/Tools.cpp:2353
@@ +2352,3 @@
+  }
+  switch (DwarfVersion) {
+  case 2:
----------------
How about:
  if (DwarfVersion > 0) CmdArgs.push_back("-dwarf-version=" + DwarfVersion);


http://reviews.llvm.org/D13221





More information about the cfe-commits mailing list