[llvm] [CGData] Declare command line options in TableGen, one struct per library (PR #226087)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 23:10:49 PDT 2026


================
@@ -2316,6 +2317,33 @@ LLVM_ABI void ResetCommandLineParser();
 /// Parses `Arg` into the option handler `Handler`.
 LLVM_ABI bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i);
 
+/// The options of a library that declares them in TableGen rather than as
+/// cl::opt (see llvm/Option/LibraryOptions.h). ParseCommandLineOptions hands
+/// every argument naming one of them to parse().
+class LLVM_ABI LibraryOptions {
----------------
MaskRay wrote:

This class will get indirect users as we migrate libraries. However, no migrated library names `cl::LibraryOptions`.  The cl:: connection lives only in LibraryOptionsParser and in RegisterLibraryOptions's constructor. 

It will be feasible to replace the parser underneath when all cl::opt options are migrated.

https://github.com/llvm/llvm-project/pull/226087


More information about the llvm-commits mailing list