[PATCH] D157150: [Driver] Update BoolOption to handle Visibility. NFC

Justin Bogner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 4 15:52:19 PDT 2023


bogner created this revision.
bogner added a reviewer: MaskRay.
Herald added a subscriber: mcrosier.
Herald added a reviewer: sscalpone.
Herald added a project: All.
bogner requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This updates the BoolOption family of option definitions to do the
right thing with llvm::opt::Visibility. Since the only meaningful
visibility at this point is llvm::opt::Default, we update PosFlag,
NegFlag, and BothFlags definitions to now specify Default.

The updates to option definitions were done with the following three
sed scripts (one to update Pos/NegFlag, one for BothFlags, and one
that just cleans up whitespace a little):

  sed -E 's/((Pos|Neg)Flag<[A-Za-z]*, \[[^]]*\])(, "|>|,$)/\1, [Default]\3/g'
  sed -E 's/(BothFlags<\[[^]]*\])(, ")/\1, [Default], "/'
  sed -E 's/( *)((Pos|Neg)Flag<.*), ((Pos|Neg)Flag)/\1\2,\n\1\4/'

These are idempotent and should be runnable on downstream versions of
Options.td if needed to update any additional flags that are present.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157150

Files:
  clang/include/clang/Driver/Options.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157150.547383.patch
Type: text/x-patch
Size: 104024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230804/33f3993e/attachment-0001.bin>


More information about the cfe-commits mailing list