[all-commits] [llvm/llvm-project] f7872c: CommandLine: add and use cl::SubCommand::get{All, T...

Nicolai Hähnle via All-commits all-commits at lists.llvm.org
Tue Aug 2 14:50:00 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f7872cdce1102a5c12633dad462a1d9763a578d3
  Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
  Date:   2022-08-02 (Tue, 02 Aug 2022)

  Changed paths:
    M bolt/lib/Utils/CommandLineOpts.cpp
    M bolt/tools/driver/llvm-bolt.cpp
    M clang/lib/Tooling/CommonOptionsParser.cpp
    M clang/tools/clang-refactor/ClangRefactor.cpp
    M llvm/include/llvm/Support/CommandLine.h
    M llvm/lib/Support/CommandLine.cpp
    M llvm/tools/llvm-xray/llvm-xray.cpp
    M llvm/unittests/Support/CommandLineInit/CommandLineInitTest.cpp
    M llvm/unittests/Support/CommandLineTest.cpp

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

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

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

More information about the All-commits mailing list