This is an archive of the discontinued LLVM Phabricator instance.

[clang][cli] NFC: Simplify BoolOption API
ClosedPublic

Authored by jansvoboda11 on Jan 25 2021, 3:34 AM.

Details

Summary

The Bool{,F,G}Option TableGen classes were designed after Opt{In,Out}FFlag, which put marshalling info on only one of the boolean options. To encode which record is supposed to carry the marshalling info (and be visible on -cc1 command-line), we used the ChangedBy and ResetBy classes.

However, we need to put marshalling info on both records anyways (see D93008 for details). This means we don't really need the distinction between ChangedBy/ResetBy + BoolOption and FlagDef + BoolOptionBase anymore.

This patch reduces the number of ways one can encode the marshalling information for pairs of boolean flags. Regardless of whether the key path value defaults to a statically known boolean, or a result of an expression, one can always use the new BoolOption and PosFlag<SetTrue>, NegFlag<SetFalse> syntax.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Jan 25 2021, 3:34 AM
jansvoboda11 requested review of this revision.Jan 25 2021, 3:34 AM
Herald added a project: Restricted Project. · View Herald Transcript
jansvoboda11 edited the summary of this revision. (Show Details)Jan 25 2021, 3:44 AM
This revision is now accepted and ready to land.Jan 25 2021, 12:01 PM
This revision was landed with ongoing or failed builds.Jan 25 2021, 11:41 PM
This revision was automatically updated to reflect the committed changes.