[cfe-commits] r158664 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/msvc_forward.c
Michael J. Spencer
bigcheesegs at gmail.com
Mon Jun 18 09:56:05 PDT 2012
Author: mspencer
Date: Mon Jun 18 11:56:04 2012
New Revision: 158664
URL: http://llvm.org/viewvc/llvm-project?rev=158664&view=rev
Log:
[VS Toolchain] Correctly forward -l linker inputs to link.exe.
Patch by Nikola Smiljanic!
Added:
cfe/trunk/test/Driver/msvc_forward.c
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=158664&r1=158663&r2=158664&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Jun 18 11:56:04 2012
@@ -5739,7 +5739,14 @@
CmdArgs.push_back("-nologo");
- AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
+ Args.AddAllArgValues(CmdArgs, options::OPT_l);
+
+ // Add filenames immediately.
+ for (InputInfoList::const_iterator
+ it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) {
+ if (it->isFilename())
+ CmdArgs.push_back(it->getFilename());
+ }
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("link.exe"));
Added: cfe/trunk/test/Driver/msvc_forward.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/msvc_forward.c?rev=158664&view=auto
==============================================================================
--- cfe/trunk/test/Driver/msvc_forward.c (added)
+++ cfe/trunk/test/Driver/msvc_forward.c Mon Jun 18 11:56:04 2012
@@ -0,0 +1,5 @@
+// RUN: %clang -target i686-pc-win32 -lkernel32.lib -luser32.lib -### %s 2>&1 | FileCheck %s
+// CHECK-NOT: "-lkernel32.lib"
+// CHECK-NOT: "-luser32.lib"
+// CHECK: "kernel32.lib"
+// CHECK: "user32.lib"
More information about the cfe-commits
mailing list