[PATCH] D97069: [clang] BoolMOption helper in Options.td

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 13:10:41 PST 2021


rampitec added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:431
+// specified by the OptGroup argument, otherwise Group<m_Group>.
+multiclass BoolMOption<string flag_base,
+                       string HelpStringEnabled, string HelpStringDisabled,
----------------
jansvoboda11 wrote:
> rampitec wrote:
> > jansvoboda11 wrote:
> > > Can you please rename this to `BoolMFlag` and model it after `BoolFFlag`?
> > > 
> > > The `Bool?Option` multiclasses were created for fine-grained control of cc1 flag marshalling, which your implementation doesn't do/need. https://clang.llvm.org/docs/InternalsManual.html#option-marshalling-infrastructure
> > It does not seem that BoolFFlag exists?
> Ah, sorry, I meant `OptInFFlag` and `OptOutFFlag`.
> 
> You probably won't need the `KeyPathAndMacro` and `enablers` parameters, as you're not targeting cc1.
It end up with the same multiclass, just different name? After OptInFFlag is cleaned from marshalling, kpm, enablers and CC1 stuff it looks more or less the same as this one. Plus to get the same behavior as now we need separate help strings and optional group.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97069/new/

https://reviews.llvm.org/D97069



More information about the llvm-commits mailing list