[all-commits] [llvm/llvm-project] 0db9df: [Driver] Update BoolOption to handle Visibility. NFC

Justin Bogner via All-commits all-commits at lists.llvm.org
Tue Aug 15 13:14:05 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0db9dfb19329b7fcb33394cf7b46805abeef3548
  Author: Justin Bogner <mail at justinbogner.com>
  Date:   2023-08-15 (Tue, 15 Aug 2023)

  Changed paths:
    M clang/include/clang/Driver/Options.h
    M clang/include/clang/Driver/Options.td

  Log Message:
  [Driver] Update BoolOption to handle Visibility. NFC

This updates the BoolOption family of option definitions to do the
right thing with llvm::opt::Visibility. The only meaningful visibility
at this point is llvm::opt::DefaultVis - in the interest of clarity we
add an alias for this called "ClangOption" and update PosFlag,
NegFlag, and BothFlags definitions to specify that.

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, [ClangOption]\3/g'
  sed -E 's/(BothFlags<\[[^]]*\])(, ")/\1, [ClangOption], "/'
  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.

Differential Revision: https://reviews.llvm.org/D157150

More information about the All-commits mailing list