[llvm] Reland [CGData] llvm-cgdata #89884 (PR #101461)

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 12:04:42 PDT 2024


================
@@ -0,0 +1,28 @@
+include "llvm/Option/OptParser.td"
+
+class F<string letter, string help> : Flag<["-"], letter>, HelpText<help>;
+
+// General options
+def generic_group : OptionGroup<"Genric Options">, HelpText<"Generic Options">;
+def help : F<"help", "Display this help">, Group<generic_group>;
+def : Flag<["-"], "h">, Alias<help>, HelpText<"Alias for --help">, Group<generic_group>;
+def version : F<"version", "Display the version">, Group<generic_group>;
+def : Flag<["-"], "v">, Alias<version>, HelpText<"Alias for --version">, Group<generic_group>;
+
+// Action options
+def action_group : OptionGroup<"Action">, HelpText<"Action (required)">;
+def show : F<"show", "Show summary of the (indexed) codegen data file.">,
----------------
petrhosek wrote:

I think we should consider extending https://github.com/llvm/llvm-project/blob/main/llvm/lib/Option/Option.cpp to support subcommands akin to https://github.com/llvm/llvm-project/blob/main/llvm/lib/Support/CommandLine.cpp.

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


More information about the llvm-commits mailing list