r207233 - clang-cl: pass -debug flag to the linker when compiling with debug info

Hans Wennborg hans at hanshq.net
Fri Apr 25 09:24:19 PDT 2014


Author: hans
Date: Fri Apr 25 11:24:19 2014
New Revision: 207233

URL: http://llvm.org/viewvc/llvm-project?rev=207233&view=rev
Log:
clang-cl: pass -debug flag to the linker when compiling with debug info

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/cl-link.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=207233&r1=207232&r2=207233&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Apr 25 11:24:19 2014
@@ -7435,6 +7435,10 @@ void visualstudio::Link::ConstructJob(Co
 
   CmdArgs.push_back("-nologo");
 
+  if (Args.hasArg(options::OPT_g_Group)) {
+    CmdArgs.push_back("-debug");
+  }
+
   bool DLL = Args.hasArg(options::OPT__SLASH_LD, options::OPT__SLASH_LDd);
 
   if (DLL) {

Modified: cfe/trunk/test/Driver/cl-link.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-link.c?rev=207233&r1=207232&r2=207233&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-link.c (original)
+++ cfe/trunk/test/Driver/cl-link.c Fri Apr 25 11:24:19 2014
@@ -31,3 +31,7 @@
 // ASAN-DLL: "-incremental:no"
 // ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk-i386.lib"
 // ASAN-DLL: "{{.*}}cl-link{{.*}}.obj"
+
+// RUN: %clang_cl /Zi /Tc%s -### 2>&1 | FileCheck --check-prefix=DEBUG %s
+// DEBUG: link.exe
+// DEBUG: "-debug"





More information about the cfe-commits mailing list