llvm-project
llvm-project copied to clipboard
Missing options in `clang -help` and `flang-new -help`
Clang's driver library doesn't print -fsyntax-only
or -O{0|1|2|3}
options when using the -help
option. This can be reproduced with clang
as well as flang-new
(which is built in terms of clangDriver
):
$ clang -help | grep syntax
-objcmt-migrate-property-dot-syntax
Enable migration of setter/getter messages to property-dot syntax
$
(-fsyntax-only
is missing). I suspect that this might affect other options too. Printing happens via OptTable::printHelp, but I don't see any obvious issues with that method.
This isn't that noticeable in Clang as clang -help | wc -l
gives me ~1200. But for flang-new
this is ~50. Checked with 333f98b4b688.
Thanks, -Andrzej
@llvm/issue-subscribers-good-first-issue
@llvm/issue-subscribers-clang-driver
@llvm/issue-subscribers-flang-driver
Clang has a --help-hidden
flag which prints a few more options, but still no -fsyntax-only
. It has no HelpText text in https://github.com/llvm/llvm-project/blob/b83d0d46c0b197c36c671493a3339d8d7a8bcd6a/clang/include/clang/Driver/Options.td#L2797
It has no HelpText text
Ah, that's the badger! No help text, no output in clang/flang-new -help
: https://github.com/llvm/llvm-project/blob/e5e93b6130bde96d7e14851e218c5bf055f8a834/llvm/lib/Option/OptTable.cpp#L670-L674
Well spotted @Meinersbur ! So one just needs to add some basic description.
Hi, I would like to try myself in solving this issue.
I have attached a patch with a fix here https://reviews.llvm.org/D131808
ping, reviewers.