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

Douglas Katzman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 08:04:00 PDT 2015


dougk marked an inline comment as done.
dougk added a comment.

James, you're right, 'gdwarf-2' followed by 'line-tables-only' works, but the opposite order doesn't.
So it halfway works, which is better than not working at all.


================
Comment at: lib/Driver/Tools.cpp:2353
@@ +2352,3 @@
+  }
+  switch (DwarfVersion) {
+  case 2:
----------------
jyknight wrote:
> How about:
>   if (DwarfVersion > 0) CmdArgs.push_back("-dwarf-version=" + DwarfVersion);
minor point: the "+" syntax you've used is actually pointer arithmetic, but giving the benefit of doubt there, and writing it as to_string(DwarfVersion), the annoying thing is that CmdArgs wants a 'const char*'.
To get one, you have to call MakeArgString which is a method on Args, not CmdArgs, so you have to pass both.
I did that in the latest patch, see what you think.


http://reviews.llvm.org/D13221





More information about the cfe-commits mailing list