This is an archive of the discontinued LLVM Phabricator instance.

[lldb/Interpreter] Make OptionGroupPythonClassWithDict options non-required
ClosedPublic

Authored by mib on Mar 3 2021, 9:43 PM.

Details

Summary

When using OptionGroupPythonClassWithDict options in an OptionGroup
with other Options, it can happen that the combinaison of some options
of each group makes the command invalid.

To solve that issue, this patch adds a bitmask argument to the
OptionGroupPythonClassWithDict constuctor that is used to mark each
option as required (or not).

If the required_options bitmask isn't passed to the constructor, the
class will keep its default behaviour, making the --script-class and
--python-function options required.

rdar://65508855

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Diff Detail

Event Timeline

mib requested review of this revision.Mar 3 2021, 9:43 PM
mib created this revision.
mib updated this revision to Diff 328020.Mar 3 2021, 10:00 PM

Fix header guard length.

JDevlieghere added inline comments.Mar 3 2021, 10:35 PM
lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h
12

We generally include system headers after project headers.

67

I don't mind the bitset but we have a Flags utility that seems like a good fit for this.

Harbormaster completed remote builds in B91969: Diff 328020.
mib marked 2 inline comments as done.Mar 4 2021, 9:32 AM
mib updated this revision to Diff 328213.Mar 4 2021, 9:34 AM

Replace std::bitset by lldb_private::Flags as suggested by @JDevlieghere

mib updated this revision to Diff 328228.Mar 4 2021, 10:16 AM
This revision is now accepted and ready to land.Mar 4 2021, 11:21 AM
This revision was landed with ongoing or failed builds.Mar 4 2021, 11:25 AM
This revision was automatically updated to reflect the committed changes.