<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 4, 2011, at 12:54 PM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Fri, Nov 4, 2011 at 12:28 PM, Chad Rosier <span dir="ltr"><<a href="mailto:mcrosier@apple.com">mcrosier@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":3to">Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=143732&r1=143731&r2=143732&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=143732&r1=143731&r2=143732&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Nov 4 14:28:44 2011<br>
@@ -1455,8 +1455,24 @@<br>
// wrong.<br>
Args.ClaimAllArgs(options::OPT_g_Group);<br>
if (Arg *A = Args.getLastArg(options::OPT_g_Group))<br>
- if (!A->getOption().matches(options::OPT_g0))<br>
- CmdArgs.push_back("-g");<br>
+ if (!A->getOption().matches(options::OPT_g0)) {<br>
+ StringRef ArgString = A->getAsString(Args);<br>
+ bool Valid_g = llvm::StringSwitch<bool>(ArgString)<br>
+ .Case("-g", true)<br>
+ .Case("-g3", true)<br>
+ .Case("-gdwarf-2", true)<br>
+ .Case("-gstabs", true)<br>
+ .Case("-gstabs+", true)<br>
+ .Case("-gstabs1", true)<br>
+ .Case("-gstabs2", true)<br>
+ .Case("-gfull", true)<br>
+ .Case("-gused", true)<br>
+ .Default(false);</div></blockquote></div><br><div>Alternatively, we could avoid treating these as a '-g' flag with a value and instead treat them as separate flags. I think that would be slightly cleaner as it would move this logic out of C++ code and into the tablegen file.</div>
</blockquote></div><br><div>Good suggestion, Chandler. I'll see if can get to this in the next few days.</div><div><br></div><div> Chad</div></body></html>