[PATCH] D123682: [clang-tblgen] Automatically document options values

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 13 15:29:43 PDT 2022


MaskRay added subscribers: dexonsmith, aaron.ballman.
MaskRay added a comment.

  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 ) 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'`,
I'm thinking of: `<arg> should be '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'.`
I am thinking of `<arg> should be 'split' or 'single'.`



================
Comment at: clang/utils/TableGen/ClangOptionDocEmitter.cpp:241
 
+static StringRef DefaultMetaVarName = "<arg>";
+
----------------
constexpr StringLiteral

const variable at a namespace scope is automatically internal linkage, except some weird corner cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123682



More information about the cfe-commits mailing list