Make lld-link shout at me less.

This makes the output of some flag names in warning messages consistent with
the output of /? and the output of flags in most other diagnostics.

https://reviews.llvm.org/D44307

llvm-svn: 327261
This commit is contained in:
Nico Weber 2018-03-12 12:45:40 +00:00
parent e3f198d58a
commit f06ae4f3b4
4 changed files with 15 additions and 15 deletions

View File

@ -61,7 +61,7 @@ bool link(ArrayRef<const char *> Args, bool CanExitEarly, raw_ostream &Diag) {
errorHandler().ColorDiagnostics = Diag.has_colors();
errorHandler().ErrorLimitExceededMsg =
"too many errors emitted, stopping now"
" (use /ERRORLIMIT:0 to see all errors)";
" (use /errorlimit:0 to see all errors)";
errorHandler().ExitEarly = CanExitEarly;
Config = make<Configuration>();
Config->Argv = {Args.begin(), Args.end()};
@ -1128,7 +1128,7 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
if (!Config->ManifestInput.empty() &&
Config->Manifest != Configuration::Embed) {
fatal("/MANIFESTINPUT: requires /MANIFEST:EMBED");
fatal("/manifestinput: requires /manifest:embed");
}
// Handle miscellaneous boolean flags.
@ -1146,13 +1146,13 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
Config->MapFile = getMapFile(Args);
if (Config->Incremental && Config->DoGC) {
warn("ignoring '/INCREMENTAL' because REF is enabled; use '/OPT:NOREF' to "
warn("ignoring '/incremental' because REF is enabled; use '/opt:noref' to "
"disable");
Config->Incremental = false;
}
if (Config->Incremental && Config->DoICF) {
warn("ignoring '/INCREMENTAL' because ICF is enabled; use '/OPT:NOICF' to "
warn("ignoring '/incremental' because ICF is enabled; use '/opt:noicf' to "
"disable");
Config->Incremental = false;
}

View File

@ -139,7 +139,7 @@ void parseGuard(StringRef FullArg) {
else if (Arg.equals_lower("cf") || Arg.equals_lower("longjmp"))
Config->GuardCF = GuardCFLevel::Full;
else
fatal("invalid argument to /GUARD: " + Arg);
fatal("invalid argument to /guard: " + Arg);
}
}

View File

@ -3,27 +3,27 @@ RUN: 21 22 2>&1 | FileCheck -check-prefix=DEFAULT %s
DEFAULT: could not open 01
DEFAULT: could not open 20
DEFAULT-NEXT: too many errors emitted, stopping now (use /ERRORLIMIT:0 to see all errors)
DEFAULT-NEXT: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
DEFAULT-NOT: could not open 21
RUN: not lld-link /ERRORLIMIT:5 01 02 03 04 05 06 07 08 09 10 2>&1 \
RUN: not lld-link /errorlimit:5 01 02 03 04 05 06 07 08 09 10 2>&1 \
RUN: | FileCheck -check-prefix=LIMIT5 %s
LIMIT5: could not open 01
LIMIT5: could not open 05
LIMIT5-NEXT: too many errors emitted, stopping now (use /ERRORLIMIT:0 to see all errors)
LIMIT5-NEXT: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
LIMIT5-NOT: could not open 06
RUN: not lld-link /ERRORLIMIT:0 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 \
RUN: not lld-link /errorlimit:0 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 \
RUN: 16 17 18 19 20 21 22 2>&1 | FileCheck -check-prefix=UNLIMITED %s
UNLIMITED: could not open 01
UNLIMITED: could not open 20
UNLIMITED: could not open 21
UNLIMITED: could not open 22
UNLIMITED-NOT: too many errors emitted, stopping now (use /ERRORLIMIT:0 to see all errors)
UNLIMITED-NOT: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
RUN: not lld-link /ERRORLIMIT:XYZ 01 02 03 04 05 06 07 08 09 10 11 12 13 14 \
RUN: not lld-link /errorlimit:XYZ 01 02 03 04 05 06 07 08 09 10 11 12 13 14 \
RUN: 15 16 17 18 19 20 21 22 2>&1 | FileCheck -check-prefix=WRONG %s
WRONG: /ERRORLIMIT: number expected, but got XYZ
WRONG: /errorlimit: number expected, but got XYZ

View File

@ -59,8 +59,8 @@
# RUN: lld-link -out:%t.dll -dll -debug -opt:ref %t.obj
# RUN: ls -l %t.lib | FileCheck -check-prefix=NOKEEP %s
# NOWARN-NOT: ignoring '/INCREMENTAL'
# WARN-ICF: ignoring '/INCREMENTAL' because ICF is enabled; use '/OPT:NOICF' to disable
# WARN-REF: ignoring '/INCREMENTAL' because REF is enabled; use '/OPT:NOREF' to disable
# NOWARN-NOT: ignoring '/incremental'
# WARN-ICF: ignoring '/incremental' because ICF is enabled; use '/opt:noicf' to disable
# WARN-REF: ignoring '/incremental' because REF is enabled; use '/opt:noref' to disable
# KEEP: {{Feb 1 1980|1980-02-01}}
# NOKEEP-NOT: {{Feb 1 1980|1980-02-01}}