[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:12:37 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:

Added comment 
` This lets libraries move off cl::opt while tools still parse argv with cl::, and goes away once tools parse argv without cl::.`

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


More information about the llvm-commits mailing list