<div dir="ltr">Should we key the default off the triple? (I thought that what was the patch did, but I misread.) I.e. with an MSVC triple, default to emitting codeview?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 26, 2018 at 5:55 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: Mon Feb 26 14:55:33 2018<br>
New Revision: 326141<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=326141&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=326141&view=rev</a><br>
Log:<br>
Re-land "Emit proper CodeView when -gcodeview is passed without the cl driver."<br>
<br>
Reverts r326116 and re-lands r326113 with a fix to ASan so that it<br>
enables column info in its test suite.<br>
<br>
Added:<br>
cfe/trunk/test/Driver/<wbr>codeview-column-info.c<br>
Modified:<br>
cfe/trunk/lib/Driver/<wbr>ToolChains/Clang.cpp<br>
<br>
Modified: cfe/trunk/lib/Driver/<wbr>ToolChains/Clang.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=326141&r1=326140&r2=326141&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Driver/<wbr>ToolChains/Clang.cpp?rev=<wbr>326141&r1=326140&r2=326141&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Driver/<wbr>ToolChains/Clang.cpp (original)<br>
+++ cfe/trunk/lib/Driver/<wbr>ToolChains/Clang.cpp Mon Feb 26 14:55:33 2018<br>
@@ -2968,7 +2968,7 @@ static void RenderDebugOptions(const Too<br>
<br>
// Forward -gcodeview. EmitCodeView might have been set by CL-compatibility<br>
// argument parsing.<br>
- if (Args.hasArg(options::OPT_<wbr>gcodeview) || EmitCodeView) {<br>
+ if (EmitCodeView) {<br>
// DWARFVersion remains at 0 if no explicit choice was made.<br>
CmdArgs.push_back("-gcodeview"<wbr>);<br>
} else if (DWARFVersion == 0 &&<br>
@@ -3567,6 +3567,8 @@ void Clang::ConstructJob(<wbr>Compilation &C,<br>
types::ID InputType = Input.getType();<br>
if (D.IsCLMode())<br>
AddClangCLArgs(Args, InputType, CmdArgs, &DebugInfoKind, &EmitCodeView);<br>
+ else<br>
+ EmitCodeView = Args.hasArg(options::OPT_<wbr>gcodeview);<br>
<br>
const Arg *SplitDWARFArg = nullptr;<br>
RenderDebugOptions(<wbr>getToolChain(), D, RawTriple, Args, EmitCodeView,<br>
<br>
Added: cfe/trunk/test/Driver/<wbr>codeview-column-info.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/codeview-column-info.c?rev=326141&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/Driver/<wbr>codeview-column-info.c?rev=<wbr>326141&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Driver/<wbr>codeview-column-info.c (added)<br>
+++ cfe/trunk/test/Driver/<wbr>codeview-column-info.c Mon Feb 26 14:55:33 2018<br>
@@ -0,0 +1,13 @@<br>
+// Check that -dwarf-column-info does not get added to the cc1 line:<br>
+// 1) When -gcodeview is present via the clang or clang++ driver<br>
+// 2) When /Z7 is present via the cl driver.<br>
+<br>
+// RUN: %clang -### -c -g -gcodeview %s 2> %t1<br>
+// RUN: FileCheck < %t1 %s<br>
+// RUN: %clangxx -### -c -g -gcodeview %s 2> %t2<br>
+// RUN: FileCheck < %t2 %s<br>
+// RUN: %clang_cl -### /c /Z7 %s 2> %t2<br>
+// RUN: FileCheck < %t2 %s<br>
+<br>
+// CHECK: "-cc1"<br>
+// CHECK-NOT: "-dwarf-column-info"<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>