[PATCH] D92775: [clang][cli] Add flexible TableGen multiclass for boolean options

Jan Svoboda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 10:09:18 PST 2020


jansvoboda11 created this revision.
jansvoboda11 added reviewers: dexonsmith, Bigcheese.
Herald added a subscriber: dang.
jansvoboda11 requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

This introduces more flexible multiclass for declaring two flags controlling the same boolean keypath.

Compared to existing Opt{In,Out}FFlag multiclasses, the new syntax makes it easier to read option declarations and reason about the keypath.

This also makes specifying common properties of both flags possible.

I'm open to suggestions on the class names. Not 100% sure the benefits are worth the added complexity.

Depends on D92774 <https://reviews.llvm.org/D92774>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92775

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/unittests/Frontend/CompilerInvocationTest.cpp
  llvm/include/llvm/Option/OptParser.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92775.309945.patch
Type: text/x-patch
Size: 24114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201207/f4f63963/attachment.bin>


More information about the llvm-commits mailing list