[PATCH] D62276: lld-link, clang: Treat non-existent input files as possible spellos for option flags
Hans Wennborg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 23 00:29:57 PDT 2019
hans accepted this revision.
hans added a comment.
This revision is now accepted and ready to land.
Beautiful!
Want to add a line to docs/ReleaseNotes.rst too? :-)
================
Comment at: clang/include/clang/Basic/DiagnosticDriverKinds.td:177
def warn_drv_unknown_argument_clang_cl_with_suggestion : Warning<
- "unknown argument ignored in clang-cl '%0' (did you mean '%1'?)">,
+ "unknown argument ignored in clang-cl '%0', did you mean '%1'?">,
InGroup<UnknownArgument>;
----------------
(grammar nit: I think this is a comma splice (https://en.wikipedia.org/wiki/Comma_splice) so I believe a semicolon would be better. On the other hand, we seem to do this a lot already and I'm not a native speaker so maybe it's fine.)
================
Comment at: clang/include/clang/Driver/Driver.h:398
+ /// Check that the file referenced by Value exists. If it doesn't,
+ /// issue a diagnostic and return false.
+ bool DiagnoseInputExistence(const llvm::opt::DerivedArgList &Args,
----------------
Should the comment say what TypoCorrect does?
================
Comment at: clang/lib/Driver/Driver.cpp:2024
+ if (getOpts().findNearest(Value, Nearest, IncludedFlagsBitmask,
+ ExcludedFlagsBitmask) <= 1) {
+ Diag(clang::diag::err_drv_no_such_file_with_suggestion)
----------------
indentation looks funny; clang-format?
================
Comment at: lld/COFF/Driver.cpp:218
+ else
+ error(Error + "; did you mean '" + Nearest + "'");
+ } else
----------------
I like the semicolon better, but it seems we use comma in other places?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62276/new/
https://reviews.llvm.org/D62276
More information about the llvm-commits
mailing list