This is a port of f5c666742f7bb4ae79ec79c8acf61dced4d37cc9 to clang's tablegen.
The code duplication is a bit sad there :-/
Related to https://reviews.llvm.org/D122378
Differential D123682
[clang-tblgen] Automatically document options values serge-sans-paille on Apr 13 2022, 6:55 AM. Authored by
Details This is a port of f5c666742f7bb4ae79ec79c8acf61dced4d37cc9 to clang's tablegen. Related to https://reviews.llvm.org/D122378
Diff Detail
Event TimelineComment Actions Thank you for improving the tool :) cd clang path/to/clang-tblgen --gen-opt-docs -I ../llvm/include -I include/clang/Driver include/clang/Driver/ClangOptionDocs.td > /tmp/0 nvim -d docs/ClangCommandLineReference.rst /tmp/0 Hope a native speaker (@aaron.ballman @dexonsmith @jhenderson ) can suggest the usage here. For an option with more than 2 choices: the current documentation is <arg> can be one of 'return', 'branch', 'full' or 'none', When there are two choices (-gsplit-dwarf=<arg>), currently the documentation is <arg> can be one of 'split' or 'single'.
Comment Actions Both of these suggestions seem reasonable to me (shorter but equally as clear as before), but we should fix to be consistent in llvm/utils/TableGen/OptRSTEmitter.cpp if we opt to go this route. The changes here LGTM as-is (I'm happy with either current wording or the changed wording). Thanks for this! Comment Actions @aaron.ballman Any thoughs on the above suggestion? I'd be happy to adopt any of those :-) Comment Actions I'd go with: More than two choices: <arg> should be 'return', 'branch', 'full', or 'none' Comment Actions FWIW, I'd actually use "must" rather than "should", but otherwise I agree with this. "should" implies there are cases where it is okay to use a different value, which is obviously not the intent. |
constexpr StringLiteral
const variable at a namespace scope is automatically internal linkage, except some weird corner cases.