<div dir="ltr">Since this flag is new in 3.9, should we merge this there?</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 9, 2016 at 1:23 PM, Reid Kleckner via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rnk<br>
Date: Tue Aug 9 12:23:56 2016<br>
New Revision: 278139<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=278139&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=278139&view=rev</a><br>
Log:<br>
[clang-cl] Make -gline-tables-only imply -gcodeview<br>
<br>
It's surprising that you have to pass /Z7 in addition to -gcodeview to<br>
get debug info. The sanitizer runtime, for example, expects that if the<br>
compiler supports the -gline-tables-only flag, then it will emit debug<br>
info.<br>
<br>
Modified:<br>
cfe/trunk/lib/Driver/Tools.cpp<br>
cfe/trunk/test/Driver/cl-<wbr>options.c<br>
<br>
Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=278139&r1=278138&r2=278139&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>Tools.cpp?rev=278139&r1=<wbr>278138&r2=278139&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Aug 9 12:23:56 2016<br>
@@ -4611,8 +4611,8 @@ void Clang::ConstructJob(<wbr>Compilation &C,<br>
options::OPT_gdwarf_4, options::OPT_gdwarf_5))<br>
DwarfVersion = DwarfVersionNum(A-><wbr>getSpelling());<br>
<br>
- // Forward -gcodeview.<br>
- // 'EmitCodeView might have been set by CL-compatibility argument parsing.<br>
+ // Forward -gcodeview. EmitCodeView might have been set by CL-compatibility<br>
+ // argument parsing.<br>
if (Args.hasArg(options::OPT_<wbr>gcodeview) || EmitCodeView) {<br>
// DwarfVersion remains at 0 if no explicit choice was made.<br>
CmdArgs.push_back("-gcodeview"<wbr>);<br>
@@ -6402,9 +6402,10 @@ void Clang::AddClangCLArgs(const ArgList<br>
CmdArgs.push_back(Args.<wbr>MakeArgString(Twine(<wbr>LangOptions::SSPStrong)));<br>
}<br>
<br>
- // Emit CodeView if -Z7 or -Zd are present.<br>
+ // Emit CodeView if -Z7, -Zd, or -gline-tables-only are present.<br>
if (Arg *DebugInfoArg =<br>
- Args.getLastArg(options::OPT__<wbr>SLASH_Z7, options::OPT__SLASH_Zd)) {<br>
+ Args.getLastArg(options::OPT__<wbr>SLASH_Z7, options::OPT__SLASH_Zd,<br>
+ options::OPT_gline_tables_<wbr>only)) {<br>
*EmitCodeView = true;<br>
if (DebugInfoArg->getOption().<wbr>matches(options::OPT__SLASH_<wbr>Z7))<br>
*DebugInfoKind = codegenoptions::<wbr>LimitedDebugInfo;<br>
<br>
Modified: cfe/trunk/test/Driver/cl-<wbr>options.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=278139&r1=278138&r2=278139&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/Driver/<wbr>cl-options.c?rev=278139&r1=<wbr>278138&r2=278139&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Driver/cl-<wbr>options.c (original)<br>
+++ cfe/trunk/test/Driver/cl-<wbr>options.c Tue Aug 9 12:23:56 2016<br>
@@ -424,6 +424,10 @@<br>
// Z7GMLT: "-gcodeview"<br>
// Z7GMLT: "-debug-info-kind=line-tables-<wbr>only"<br>
<br>
+// RUN: %clang_cl -gline-tables-only /c -### -- %s 2>&1 | FileCheck -check-prefix=ZGMLT %s<br>
+// ZGMLT: "-gcodeview"<br>
+// ZGMLT: "-debug-info-kind=line-tables-<wbr>only"<br>
+<br>
// RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=BreproDefault %s<br>
// BreproDefault: "-mincremental-linker-<wbr>compatible"<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>