[llvm-dev] Making llvm-xyz -help useful

Serge Guelton via llvm-dev llvm-dev at lists.llvm.org
Thu May 9 09:23:35 PDT 2019


Hi folks,

today, I wanted to concatenate two .ll, and naively typed:

    $ llvm-cat -help

This is the not-so-helpful output I had:

    OVERVIEW: Module concatenation
    USAGE: llvm-cat [options] <input  files>

    OPTIONS:

    General options:

      -aarch64-neon-syntax                              - Choose style of NEON code to emit from AArch64 backend:
        =generic                                        -   Emit generic NEON assembly
        =apple                                          -   Emit Apple-style NEON assembly
      -amdgpu-dump-hsa-metadata                         - Dump AMDGPU HSA Metadata
      -amdgpu-enable-merge-m0                           - Merge and hoist M0 initializations
      -amdgpu-sdwa-peephole                             - Enable SDWA peepholer
    [...]

Surely, the style of NEON code to emit from AArch64 backend is not the information I was looking for...

I've implemented a straight-forward patch for llvm-cat here https://reviews.llvm.org/D61740, and the result becomes:

    OVERVIEW: Module concatenation
    USAGE: llvm-cat [options] <input  files>

    OPTIONS:

    Generic Options:

      --help        - Display available options (--help-hidden for more)
      --help-list   - Display list of available options (--help-list-hidden for more)
      --version     - Display the version of this program

    llvm-cat Options:

      -b            - Whether to perform binary concatenation
      -o=<filename> - Output filename


Depending on the tools, the filtering imposed by llvm::cl::HideUnrelatedOptions may be too harsh, but there's still -help-hidden for the curious!

Any thoughts on that approach? Should I go on that way for other tools? If so, anyone willing to be auto-added as a reviewer?

++
Serge


More information about the llvm-dev mailing list