[PATCH] D41733: [Driver] Suggest correctly spelled driver options

Brian Gesiak via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 10:07:53 PST 2018


modocache created this revision.
modocache added reviewers: yamaguchi, v.g.vassilev, teemperor, ruiu.

Depends on https://reviews.llvm.org/D41732.

Utilities such as `opt`, when invoked with arguments that are very
nearly spelled correctly, suggest the correctly spelled options:

  bin/opt -hel
  opt: Unknown command line argument '-hel'.  Try: 'bin/opt -help'
  opt: Did you mean '-help'?

Clang, on the other hand, prior to this commit, does not:

  bin/clang -hel
  clang-6.0: error: unknown argument: '-hel'

This commit makes use of the new libLLVMOption API from
https://reviews.llvm.org/D41732 in order to provide correct suggestions:

  bin/clang -hel
  clang-6.0: error: unknown argument: '-hel', did you mean '-help'?

Test Plan: `check-clang`


Repository:
  rC Clang

https://reviews.llvm.org/D41733

Files:
  include/clang/Basic/DiagnosticDriverKinds.td
  lib/Driver/Driver.cpp
  test/Driver/unknown-arg.c
  test/Driver/unsupported-option.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41733.128628.patch
Type: text/x-patch
Size: 6900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180104/7ebe3cc1/attachment.bin>


More information about the cfe-commits mailing list