clang-cl: Make /link accept an optional joined argument.

For example, "cl.exe a.c /linkfoo bar" is a valid invocation and
forwards "foo" and "bar" to link.exe. This makes clang-cl handle
that kind of invocation.

Depends on LLVM r266394.

llvm-svn: 266395
This commit is contained in:
Hans Wennborg 2016-04-15 00:24:15 +00:00
parent 40cfde3cb8
commit 84ff1d37fc
2 changed files with 4 additions and 3 deletions

View File

@ -45,8 +45,8 @@ class CLCompileJoinedOrSeparate<string name> : Option<["/", "-"], name,
KIND_JOINED_OR_SEPARATE>, Group<cl_compile_Group>,
Flags<[CLOption, DriverOption]>;
class CLRemainingArgs<string name> : Option<["/", "-"], name,
KIND_REMAINING_ARGS>, Group<cl_Group>, Flags<[CLOption, DriverOption]>;
class CLRemainingArgsJoined<string name> : Option<["/", "-"], name,
KIND_REMAINING_ARGS_JOINED>, Group<cl_Group>, Flags<[CLOption, DriverOption]>;
// Aliases:
// (We don't put any of these in cl_compile_Group as the options they alias are
@ -215,7 +215,7 @@ def _SLASH_imsvc : CLJoinedOrSeparate<"imsvc">,
MetaVarName<"<dir>">;
def _SLASH_LD : CLFlag<"LD">, HelpText<"Create DLL">;
def _SLASH_LDd : CLFlag<"LDd">, HelpText<"Create debug DLL">;
def _SLASH_link : CLRemainingArgs<"link">,
def _SLASH_link : CLRemainingArgsJoined<"link">,
HelpText<"Forward options to the linker">, MetaVarName<"<options>">;
def _SLASH_MD : Option<["/", "-"], "MD", KIND_FLAG>, Group<_SLASH_M_Group>,
Flags<[CLOption, DriverOption]>, HelpText<"Use DLL run-time">;

View File

@ -3,6 +3,7 @@
// under /Users.
// RUN: %clang_cl /Tc%s -### /link foo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
// RUN: %clang_cl /Tc%s -### /linkfoo bar baz 2>&1 | FileCheck --check-prefix=LINK %s
// LINK: link.exe
// LINK: "foo"
// LINK: "bar"