[PATCH] D122654: [doc] Improve clang auto-generated help

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 08:42:44 PDT 2022


awarzynski added a comment.
Herald added a reviewer: awarzynski.

Hi @serge-sans-paille,  I just saw your comment on Discourse <https://discourse.llvm.org/t/small-clean-up-in-options-td/61489>. Looking specifically at:

  ! HELP-FC1-NEXT: -std={c89,c90,iso9899:1990,iso9899:199409,gnu89,gnu90,c99,iso9899:1999,c9x,iso9899:199x,gnu99,gnu9x,c11,iso9899:2011,c1x,iso9899:201x,gnu11,gnu1x,c17,iso9899:2017,c18,iso9899:2018,gnu17,gnu18,c2x,gnu2x,c++98,c++03,gnu++98,gnu++03,c++11,c++0x,gnu++11,gnu++0x,c++14,c++1y,gnu++14,gnu++1y,c++17,c++1z,gnu++17,gnu++1z,c++20,c++2a,gnu++20,gnu++2a,c++2b,gnu++2b,cl1.0,cl,cl1.1,cl1.2,cl2.0,cl3.0,clc++1.0,clc++,clc++2021,CL,CL1.1,CL1.2,CL2.0,CL3.0,CLC++,CLC++1.0,CLC++2021,cuda,hip,hlsl,hlsl2015,hlsl2016,hlsl2017,hlsl2018,hlsl2021,hlsl202x,}

I think that listing the available options for `-std=` is helpful, but I'm not sure whether `clang -help` is the right place. It's already quite cluttered and impossible to navigate without piping to e.g. `grep`. In the past, we tried using `DocBrief` in Options.td for longer option comments. That wouldn't change the contents of `clang -help`, but IIRC, would be included in https://clang.llvm.org/docs/ClangCommandLineReference.html. In general, I think that it would be great to re-factor and organise `clang -help` a bit, but that would be a bigger job.

On a different note, we should definitely avoiding making `flang-new` display various C or C++ standards as available options for `-std=<val>`. Basically, `-std=c++98` (and other similar options) are not supported by `flang-new` and should not be printed in `flang-new -help`.

HTH,
Andrzej


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122654/new/

https://reviews.llvm.org/D122654



More information about the llvm-commits mailing list