From 844c1c908ca5f8a961dc4672178031d353697dd2 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sat, 19 Nov 2016 18:49:38 +0000 Subject: [PATCH] Simplify "missing argument" error message. We do not have an option taking more than one arguments, so we can just say "missing argument" instead of "missing argument(s)". llvm-svn: 287454 --- lld/ELF/DriverUtils.cpp | 4 +--- lld/test/ELF/basic.s | 2 +- lld/test/ELF/libsearch.s | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp index e2ee469..0ec6cb3 100644 --- a/lld/ELF/DriverUtils.cpp +++ b/lld/ELF/DriverUtils.cpp @@ -81,9 +81,7 @@ opt::InputArgList ELFOptTable::parse(ArrayRef Argv) { // Parse options and then do error checking. Args = this->ParseArgs(Vec, MissingIndex, MissingCount); if (MissingCount) - error(Twine("missing arg value for \"") + Args.getArgString(MissingIndex) + - "\", expected " + Twine(MissingCount) + - (MissingCount == 1 ? " argument.\n" : " arguments")); + error(Twine(Args.getArgString(MissingIndex)) + ": missing argument"); for (auto *Arg : Args.filtered(OPT_UNKNOWN)) error("unknown argument: " + Arg->getSpelling()); diff --git a/lld/test/ELF/basic.s b/lld/test/ELF/basic.s index a596a22..5c10d45 100644 --- a/lld/test/ELF/basic.s +++ b/lld/test/ELF/basic.s @@ -230,7 +230,7 @@ _start: # CANNOT_OPEN: cannot open {{.*}}.no.such.file: {{[Nn]}}o such file or directory # RUN: not ld.lld %t -o 2>&1 | FileCheck --check-prefix=NO_O_VAL %s -# NO_O_VAL: missing arg value for "-o", expected 1 argument. +# NO_O_VAL: -o: missing argument # RUN: not ld.lld --foo 2>&1 | FileCheck --check-prefix=UNKNOWN %s # UNKNOWN: unknown argument: --foo diff --git a/lld/test/ELF/libsearch.s b/lld/test/ELF/libsearch.s index 2c7d868..730445b 100644 --- a/lld/test/ELF/libsearch.s +++ b/lld/test/ELF/libsearch.s @@ -15,7 +15,7 @@ // Should fail if no library specified // RUN: not ld.lld -l 2>&1 \ // RUN: | FileCheck --check-prefix=NOLIBRARY %s -// NOLIBRARY: missing arg value for "-l", expected 1 argument. +// NOLIBRARY: -l: missing argument // Should link normally, because _bar is not used // RUN: ld.lld -o %t3 %t.o -- 2.7.4