[clang] [clang-tools-extra] [lld] [llvm] [llvm] Add subcommand support for OptTable (PR #155026)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 5 14:52:57 PDT 2025


================
@@ -400,7 +455,22 @@ static void emitOptionParser(const RecordKeeper &Records, raw_ostream &OS) {
     OS << ", nullptr";
 
     // The option Values (unused for groups).
-    OS << ", nullptr)\n";
+    OS << ", nullptr";
+
+    // The option CommandIDsOffset.
+    OS << ", ";
+    if (R.getValue("CommandGroup") != nullptr) {
+      std::vector<const Record *> CommandGroup =
+          R.getValueAsListOfDefs("CommandGroup");
+      CommandKeyT CommandKey;
+      for (const auto &Command : CommandGroup)
+        CommandKey.push_back(Command->getName());
----------------
PiJoules wrote:

Maybe move this into its own function since it's reused below.

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


More information about the llvm-commits mailing list