Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Support]Look up in top-level subcommand as a fallback when looking options for a custom subcommand. #71776

Merged
merged 5 commits into from
Nov 10, 2023

Commits on Nov 9, 2023

  1. [Support]Look up in top-level subcommand as a fallback when looking

    options for a custom subcommand.
    
    Context:
    
      In https://lists.llvm.org/pipermail/llvm-dev/2016-June/101804.html and commit 07670b3, cl::SubCommand is introduced.
    
      Options that don't specify subcommand goes intoa special 'top level' subcommand.
    
    Motivating Use Case:
      The motivating use case is to refactor llvm-profdata to use cl::SubCommand to organize subcommands. See pr/71328. A valid use case that's not supported before this patch
    
      // show-option{1,2} are associated with 'show' subcommand.
      // top-level-option3 is in top-level subcomand (e.g., `profile-isfs` in SampleProfReader.cpp)
      llvm-profdata show --show-option1 --show-option2 --top-level-option3
    
      - Before this patch, option handler look-up will fail with the following error message
        "Unknown command line argument --top-level-option3".
      - After this patch, option handler look-up will look up in sub-command options first,
        and use top-level subcommand as a fallback, so 'top-level-option3' is parsed correctly.
    minglotus-6 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    444a635 View commit details
    Browse the repository at this point in the history
  2. resolve feedback

    minglotus-6 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    707dcab View commit details
    Browse the repository at this point in the history
  3. Integrate offline feedback. Use CamelCase variable name that starts w…

    …ith upper case letter; and use std::pair initializer.
    minglotus-6 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    5d90e44 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d76b4d9 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2023

  1. resolve feedback

    minglotus-6 committed Nov 10, 2023
    Configuration menu
    Copy the full SHA
    40840d3 View commit details
    Browse the repository at this point in the history