This is an archive of the discontinued LLVM Phabricator instance.

CommandLine: add and use cl::SubCommand::get{All,TopLevel}

Authored by nhaehnle on Jul 5 2022, 2:15 AM.



Prefer using these accessors to access the special sub-commands
corresponding to the top-level (no subcommand) and all sub-commands.

This is a preparatory step towards removing the use of ManagedStatic:
with a subsequent change, these global instances will be moved to
be regular function-scope statics.

It is split up to give downstream projects a (albeit short) window in
which they can switch to using the accessors in a forward-compatible

Diff Detail

Event Timeline

nhaehnle created this revision.Jul 5 2022, 2:15 AM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
nhaehnle requested review of this revision.Jul 5 2022, 2:15 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 5 2022, 2:15 AM
This revision is now accepted and ready to land.Jul 29 2022, 1:47 PM
This revision was landed with ongoing or failed builds.Aug 2 2022, 2:49 PM
This revision was automatically updated to reflect the committed changes.