[PATCH] D43700: Emit proper CodeView even when not using the cl driver.

Zachary Turner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 23 15:54:15 PST 2018


zturner created this revision.
zturner added a reviewer: rnk.

Although the supported way of invoking clang on Windows is via the cl driver, some people may wish to use the g++ driver. and manually specify `-gcodeview`.  This codepath is currently broken, as it will cause column information to be emitted, which causes debuggers to not work.

While we still don't claim to support clang on Windows without the cl driver, this is a straightforward patch to make things slightly better for people who want to go this route anyway.


https://reviews.llvm.org/D43700

Files:
  clang/lib/Driver/ToolChains/Clang.cpp


Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -2965,7 +2965,7 @@
 
   // Forward -gcodeview. EmitCodeView might have been set by CL-compatibility
   // argument parsing.
-  if (Args.hasArg(options::OPT_gcodeview) || EmitCodeView) {
+  if (EmitCodeView) {
     // DWARFVersion remains at 0 if no explicit choice was made.
     CmdArgs.push_back("-gcodeview");
   } else if (DWARFVersion == 0 &&
@@ -3552,6 +3552,8 @@
   types::ID InputType = Input.getType();
   if (D.IsCLMode())
     AddClangCLArgs(Args, InputType, CmdArgs, &DebugInfoKind, &EmitCodeView);
+  else
+    EmitCodeView = Args.hasArg(options::OPT_gcodeview);
 
   const Arg *SplitDWARFArg = nullptr;
   RenderDebugOptions(getToolChain(), D, RawTriple, Args, EmitCodeView,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43700.135723.patch
Type: text/x-patch
Size: 889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180223/96946f85/attachment.bin>


More information about the cfe-commits mailing list