1 include "llvm/Option/OptParser.td"
3 def WrapperOnlyOption : OptionFlag;
4 def DeviceOnlyOption : OptionFlag;
6 def help : Flag<["--"], "help">,
7 HelpText<"Display available options (--help-hidden for more)">;
9 def help_hidden : Flag<["--"], "help-hidden">,
10 HelpText<"Display all available options">;
12 // Flags for the linker wrapper.
13 def linker_path_EQ : Joined<["--"], "linker-path=">,
14 Flags<[WrapperOnlyOption]>, MetaVarName<"<path>">,
15 HelpText<"The linker executable to invoke">;
16 def cuda_path_EQ : Joined<["--"], "cuda-path=">,
17 Flags<[WrapperOnlyOption]>, MetaVarName<"<dir>">,
18 HelpText<"Set the system CUDA path">;
19 def host_triple_EQ : Joined<["--"], "host-triple=">,
20 Flags<[WrapperOnlyOption]>, MetaVarName<"<triple>">,
21 HelpText<"Triple to use for the host compilation">;
22 def opt_level : Joined<["--"], "opt-level=">,
23 Flags<[WrapperOnlyOption]>, MetaVarName<"<O0, O1, O2, or O3>">,
24 HelpText<"Optimization level for LTO">;
25 def device_linker_args_EQ : Joined<["--"], "device-linker=">,
26 Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
27 HelpText<"Arguments to pass to the device linker invocation">;
28 def device_compiler_args_EQ : Joined<["--"], "device-compiler=">,
29 Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
30 HelpText<"Arguments to pass to the device compiler invocation">;
31 def dry_run : Flag<["--"], "dry-run">,
32 Flags<[WrapperOnlyOption]>,
33 HelpText<"Print program arguments without running">;
34 def verbose : Flag<["--"], "wrapper-verbose">,
35 Flags<[WrapperOnlyOption]>, HelpText<"Verbose output from tools">;
36 def embed_bitcode : Flag<["--"], "embed-bitcode">,
37 Flags<[WrapperOnlyOption]>, HelpText<"Embed linked bitcode in the module">;
38 def debug : Flag<["--"], "device-debug">, Flags<[WrapperOnlyOption]>,
39 HelpText<"Use debugging">;
40 def ptxas_arg : Joined<["--"], "ptxas-arg=">,
41 Flags<[WrapperOnlyOption]>,
42 HelpText<"Argument to pass to the 'ptxas' invocation">;
43 def pass_remarks_EQ : Joined<["--"], "pass-remarks=">,
44 Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
45 def pass_remarks_missed_EQ : Joined<["--"], "pass-remarks-missed=">,
46 Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
47 def pass_remarks_analysis_EQ : Joined<["--"], "pass-remarks-analysis=">,
48 Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
49 def print_wrapped_module : Flag<["--"], "print-wrapped-module">,
50 Flags<[WrapperOnlyOption]>,
51 HelpText<"Print the wrapped module's IR for testing">;
52 def save_temps : Flag<["--"], "save-temps">,
53 Flags<[WrapperOnlyOption]>, HelpText<"Save intermediate results">;
54 def compress : Flag<["--"], "compress">,
55 Flags<[WrapperOnlyOption]>, HelpText<"Compress bundled files">;
56 def compression_level_eq : Joined<["--"], "compression-level=">,
57 Flags<[WrapperOnlyOption]>, HelpText<"Specify the compression level (integer)">;
59 def wrapper_time_trace_eq : Joined<["--"], "wrapper-time-trace=">,
60 Flags<[WrapperOnlyOption]>, MetaVarName<"<file>">,
61 HelpText<"Enable time-trace and write the output to <file>">;
62 def wrapper_time_trace_granularity : Joined<["--"], "wrapper-time-trace-granularity=">,
63 Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
64 HelpText<"Set the granularity of time-trace updates">;
66 def wrapper_jobs : Joined<["--"], "wrapper-jobs=">,
67 Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
68 HelpText<"Sets the number of parallel jobs to use for device linking">;
70 def override_image : Joined<["--"], "override-image=">,
71 Flags<[WrapperOnlyOption]>, MetaVarName<"<kind=file>">,
72 HelpText<"Uses the provided file as if it were the output of the device link step">;
74 // Flags passed to the device linker.
75 def arch_EQ : Joined<["--"], "arch=">,
76 Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<arch>">,
77 HelpText<"The device subarchitecture">;
78 def triple_EQ : Joined<["--"], "triple=">,
79 Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<triple>">,
80 HelpText<"The device target triple">;
81 def whole_program : Flag<["--"], "whole-program">,
82 Flags<[DeviceOnlyOption, HelpHidden]>,
83 HelpText<"LTO has visibility of all input files">;
84 def linker_arg_EQ : Joined<["--"], "linker-arg=">,
85 Flags<[DeviceOnlyOption, HelpHidden]>,
86 HelpText<"An extra argument to be passed to the linker">;
87 def compiler_arg_EQ : Joined<["--"], "compiler-arg=">,
88 Flags<[DeviceOnlyOption, HelpHidden]>,
89 HelpText<"An extra argument to be passed to the compiler">;
91 // Arguments for the LLVM backend.
92 def mllvm : Separate<["-"], "mllvm">, Flags<[WrapperOnlyOption]>,
94 HelpText<"Arguments passed to LLVM, including Clang invocations, for which "
95 "the '-mllvm' prefix is preserved. Use '-mllvm --help' for a list "
97 def offload_opt_eq_minus : Joined<["--", "-"], "offload-opt=">, Flags<[HelpHidden, WrapperOnlyOption]>,
98 HelpText<"Options passed to LLVM, not including the Clang invocation. Use "
99 "'--offload-opt=--help' for a list of options.">;
101 // Standard linker flags also used by the linker wrapper.
102 def sysroot_EQ : Joined<["--"], "sysroot=">, HelpText<"Set the system root">;
104 def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
105 HelpText<"Path to file to write output">;
106 def output_EQ : Joined<["--"], "output=">, Alias<o>, Flags<[HelpHidden]>,
107 HelpText<"Alias for -o">;
108 def output : Separate<["--"], "output">, Alias<o>, Flags<[HelpHidden]>,
109 HelpText<"Alias for -o">;
111 def library_path : JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
112 HelpText<"Add <dir> to the library search path">;
113 def library_path_S : Separate<["--", "-"], "library-path">, Flags<[HelpHidden]>,
115 def library_path_EQ : Joined<["--", "-"], "library-path=">, Flags<[HelpHidden]>,
118 def library : JoinedOrSeparate<["-"], "l">, MetaVarName<"<libname>">,
119 HelpText<"Search for library <libname>">;
120 def library_S : Separate<["--", "-"], "library">, Flags<[HelpHidden]>,
122 def library_EQ : Joined<["--", "-"], "library=">, Flags<[HelpHidden]>,
125 def rpath : Separate<["--", "-"], "rpath">;
126 def rpath_EQ : Joined<["--", "-"], "rpath=">, Flags<[HelpHidden]>, Alias<rpath>;
128 def v : Flag<["--", "-"], "v">, HelpText<"Display the version number and exit">;
129 def version : Flag<["--", "-"], "version">, Flags<[HelpHidden]>, Alias<v>;
131 def whole_archive : Flag<["--", "-"], "whole-archive">, Flags<[HelpHidden]>;
132 def no_whole_archive : Flag<["--", "-"], "no-whole-archive">, Flags<[HelpHidden]>;
134 def relocatable : Flag<["--", "-"], "relocatable">,
135 HelpText<"Link device code to create a relocatable offloading application">;
136 def r : Flag<["-"], "r">, Alias<relocatable>;
138 // link.exe-style linker options.
139 def out : Joined<["/", "-", "/?", "-?"], "out:">, Flags<[HelpHidden]>;
140 def libpath : Joined<["/", "-", "/?", "-?"], "libpath:">, Flags<[HelpHidden]>;
141 def wholearchive_flag : Joined<["/", "-", "/?", "-?"], "wholearchive">, Flags<[HelpHidden]>;