lld-link: Add /lib to Options.td so that it appears in lld-link's help output.

https://reviews.llvm.org/D49319

llvm-svn: 337086
This commit is contained in:
Nico Weber 2018-07-14 04:07:51 +00:00
parent 4ce0a916f0
commit c421fe5ef4
3 changed files with 12 additions and 0 deletions

View File

@ -821,6 +821,10 @@ opt::InputArgList ArgParser::parse(ArrayRef<const char *> Argv) {
for (auto *Arg : Args.filtered(OPT_UNKNOWN))
warn("ignoring unknown argument: " + Arg->getSpelling());
if (Args.hasArg(OPT_lib))
warn("ignoring /lib since it's not the first argument");
return Args;
}

View File

@ -36,6 +36,8 @@ def guard : P<"guard", "Control flow guard">;
def heap : P<"heap", "Size of the heap">;
def ignore : P<"ignore", "Specify warning codes to ignore">;
def implib : P<"implib", "Import library name">;
def lib : F<"lib">,
HelpText<"Act like lib.exe; must be first argument if present">;
def libpath : P<"libpath", "Additional library search path">;
def linkrepro : P<"linkrepro", "Dump linker invocation and input files for debugging">;
def lldltocache : P<"lldltocache", "Path to ThinLTO cached object file directory">;

View File

@ -9,3 +9,9 @@ VERSION: {{LLD [0-9]+\.[0-9]+}}
# RUN: lld-link /out:%t.dll /dll %t.obj
# RUN: not lld-link /out:%t.exe %t.dll 2>&1 | FileCheck -check-prefix=BADFILE %s
BADFILE: bad file type. Did you specify a DLL instead of an import library?
# RUN: lld-link /lib /? | FileCheck -check-prefix=LIBHELP %s
LIBHELP: OVERVIEW: LLVM Lib
# RUN: not lld-link /WX /lib 2>&1 | FileCheck -check-prefix=LIBBAD %s
LIBBAD: ignoring /lib since it's not the first argument