diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-05-23 17:58:33 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-05-23 17:58:33 +0000 |
commit | 9b2830b46e1c8fb1418956d8835d85225949e3c7 (patch) | |
tree | 922271ba0c4b46bd4bf50dc422e46ce961e94f58 /clang/test/Frontend | |
parent | 2049e4dd8f61100f88f14db33bd95d197bcbfbbc (diff) | |
download | bcm5719-llvm-9b2830b46e1c8fb1418956d8835d85225949e3c7.tar.gz bcm5719-llvm-9b2830b46e1c8fb1418956d8835d85225949e3c7.zip |
lld-link, clang: Treat non-existent input files as possible spellos for option flags
OptTable treats arguments starting with / that aren't a known option
as filenames. This means lld-link's and clang-cl's typo correction for
unknown flags didn't do spell checking for misspelled options that start
with /.
I first tried changing OptTable, but that got pretty messy, see PR41787
comments 2 and 3.
Instead, let lld-link's and clang's (including clang-cl's) "file not
found" diagnostic check if a non-existent file looks like it could be a
mis-spelled option, and if so add a "did you mean" suggestion to the
"file not found" diagnostic.
While here, make formatting of a few diagnostics a bit more
self-consistent.
Fixes PR41787.
Differential Revision: https://reviews.llvm.org/D62276
llvm-svn: 361518
Diffstat (limited to 'clang/test/Frontend')
-rw-r--r-- | clang/test/Frontend/unknown-arg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Frontend/unknown-arg.c b/clang/test/Frontend/unknown-arg.c index 00f2da6242c..eb2fb1aee2d 100644 --- a/clang/test/Frontend/unknown-arg.c +++ b/clang/test/Frontend/unknown-arg.c @@ -6,4 +6,4 @@ // RUN: FileCheck %s --check-prefix=DID-YOU-MEAN // CHECK: error: unknown argument: '--helium' -// DID-YOU-MEAN: error: unknown argument '--hel[', did you mean '--help'? +// DID-YOU-MEAN: error: unknown argument '--hel['; did you mean '--help'? |