]> granicus.if.org Git - clang/commitdiff
clang-cl: pass -debug flag to the linker when compiling with debug info
authorHans Wennborg <hans@hanshq.net>
Fri, 25 Apr 2014 16:24:19 +0000 (16:24 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 25 Apr 2014 16:24:19 +0000 (16:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207233 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/cl-link.c

index 0a45fa190a1caf55605e09afcced2776d71f8b6e..924e040246db3625af86992f0926b4e2b38e16f0 100644 (file)
@@ -7435,6 +7435,10 @@ void visualstudio::Link::ConstructJob(Compilation &C, const JobAction &JA,
 
   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) {
index 24e0702c8ab3da96adfd8948d59df788502b794a..309c27dab145fedfc051fe832a0bc30abb0f2201 100644 (file)
@@ -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"