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

Brian Gesiak via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 15:58:03 PST 2018

modocache added a comment.

Thank you, @bruno! Good idea, I'll add a `-cc1` invocation test.

Comment at: lib/Driver/Driver.cpp:191
     if (A->getOption().hasFlag(options::Unsupported)) {
-      Diag(diag::err_drv_unsupported_opt) << A->getAsString(Args);
-      ContainsError |= Diags.getDiagnosticLevel(diag::err_drv_unsupported_opt,
-                                                SourceLocation()) >
+      unsigned DiagID;
+      auto ArgString = A->getAsString(Args);
jroelofs wrote:
> No need for this variable.
There's a call below to `Diags.getDiagnosticsLevel`, which takes this ID as an argument. Are you suggesting I leave that line alone, and have it use the diagnostic level of `err_drv_unsupported_opt`, even if `err_drv_unsupported_opt_with_suggestion` is actually emitted here? That seems reasonable to me, but just want to make sure that's what you had in mind.

  rC Clang


More information about the cfe-commits mailing list