This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Don't try to spell check unsupported options
ClosedPublic

Authored by bogner on Aug 2 2023, 11:13 AM.

Details

Summary

We currently spell check options that are listed as unsupported, but
this doesn't make much sense. If an option is explicitly unsupported
why would one that's spelled similarly be useful?

It looks like the reason this was added was that we explicitly mark
all --something flags as Unsupported rather than just leaving them
undefined and treating them as unknown. Drop that handling so that we
don't regress on things like misspelling --help.

Diff Detail

Event Timeline

bogner created this revision.Aug 2 2023, 11:13 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added a subscriber: mcrosier. · View Herald Transcript
bogner requested review of this revision.Aug 2 2023, 11:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 11:13 AM
MaskRay accepted this revision.EditedAug 2 2023, 2:14 PM

Looks great! Nice example of fixing a problem by deleting code.

We've had def _ : Joined<"--"> since commit 46fffee081b583a617fa94397b0c758bdf3a4a80 (2009) when TableGen based options were introduced.

Due to it, the error messages are slightly different, but I agree that it is not a meaningful difference:

% fclang -qqq -c a.c
clang: error: unknown argument: '-qqq'
% fclang --qqq -c a.c
clang: error: unsupported option '--qqq'
This revision is now accepted and ready to land.Aug 2 2023, 2:14 PM
This revision was landed with ongoing or failed builds.Aug 2 2023, 2:36 PM
This revision was automatically updated to reflect the committed changes.