[llvm] [Option] Declare library command line options in TableGen (PR #226087)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 17:52:32 PDT 2026


================
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+include "llvm/Option/OptParser.td"
+
+def CGDataOptions : OptionsStruct;
+
+defm CodeGenDataGenerate : BoolField<"codegen-data-generate", "false",
+  "Emit CodeGen Data into custom sections">;
----------------
MaskRay wrote:

I like this. As some point we can do `let Kind = "Debug" in { ... }` in the .td file to classify options.

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


More information about the llvm-commits mailing list