[APIDigester] Migrate to shared frontend option tables #37206
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the use of llvm::cl for argument parsing with the shared frontend option tables defined in Options.td. Now that the API digester is a frontend tool, this prevents option definition conflicts with -Xllvm options and any frontend tools that get added in the future. It also means options like
-I
&-F
are parsed the same way by the driver and digester, which will let me remove some hacks in SwiftPM's command line construction for the tool.This change is not quite NFC. It removes the
-include-all
and-api-usrs
flags, which the tool was no longer checking for. Also, some of the long-form options no longer support the-option=arg
form. Because some of the tests rely on it, I am still allowing all of the options to have a single- or double-dash prefix for compatibility.