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 bitcode_library_EQ : Joined<["--"], "bitcode-library=">,
26 Flags<[WrapperOnlyOption]>, MetaVarName<"<kind>-<triple>-<arch>=<path>">,
27 HelpText<"Extra bitcode library to link">;
28 def builtin_bitcode_EQ : Joined<["--"], "builtin-bitcode=">,
29 Flags<[WrapperOnlyOption]>, MetaVarName<"<triple>=<path>">,
30 HelpText<"Perform a special internalizing link on the bitcode file. "
31 "This is necessary for some vendor libraries to be linked correctly">;
32 def device_linker_args_EQ : Joined<["--"], "device-linker=">,
33 Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
34 HelpText<"Arguments to pass to the device linker invocation">;
35 def clang_backend : Flag<["--"], "clang-backend">,
36 Flags<[WrapperOnlyOption]>,
37 HelpText<"Run the backend using clang rather than the LTO backend">;
38 def dry_run : Flag<["--"], "dry-run">,
39 Flags<[WrapperOnlyOption]>,
40 HelpText<"Print program arguments without running">;
41 def verbose : Flag<["--"], "wrapper-verbose">,
42 Flags<[WrapperOnlyOption]>, HelpText<"Verbose output from tools">;
43 def embed_bitcode : Flag<["--"], "embed-bitcode">,
44 Flags<[WrapperOnlyOption]>, HelpText<"Embed linked bitcode in the module">;
45 def debug : Flag<["--"], "device-debug">, Flags<[WrapperOnlyOption]>,
46 HelpText<"Use debugging">;
47 def ptxas_arg : Joined<["--"], "ptxas-arg=">,
48 Flags<[WrapperOnlyOption]>,
49 HelpText<"Argument to pass to the 'ptxas' invocation">;
50 def pass_remarks_EQ : Joined<["--"], "pass-remarks=">,
51 Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
52 def pass_remarks_missed_EQ : Joined<["--"], "pass-remarks-missed=">,
53 Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
54 def pass_remarks_analysis_EQ : Joined<["--"], "pass-remarks-analysis=">,
55 Flags<[WrapperOnlyOption]>, HelpText<"Pass remarks for LTO">;
56 def print_wrapped_module : Flag<["--"], "print-wrapped-module">,
57 Flags<[WrapperOnlyOption]>,
58 HelpText<"Print the wrapped module's IR for testing">;
59 def save_temps : Flag<["--"], "save-temps">,
60 Flags<[WrapperOnlyOption]>, HelpText<"Save intermediate results">;
62 def wrapper_time_trace_eq : Joined<["--"], "wrapper-time-trace=">,
63 Flags<[WrapperOnlyOption]>, MetaVarName<"<file>">,
64 HelpText<"Enable time-trace and write the output to <file>">;
65 def wrapper_time_trace_granularity : Joined<["--"], "wrapper-time-trace-granularity=">,
66 Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
67 HelpText<"Set the granularity of time-trace updates">;
69 def wrapper_jobs : Joined<["--"], "wrapper-jobs=">,
70 Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
71 HelpText<"Sets the number of parallel jobs to use for device linking">;
73 // Flags passed to the device linker.
74 def arch_EQ : Joined<["--"], "arch=">,
75 Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<arch>">,
76 HelpText<"The device subarchitecture">;
77 def triple_EQ : Joined<["--"], "triple=">,
78 Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<triple>">,
79 HelpText<"The device target triple">;
80 def whole_program : Flag<["--"], "whole-program">,
81 Flags<[DeviceOnlyOption, HelpHidden]>,
82 HelpText<"LTO has visibility of all input files">;
83 def linker_arg_EQ : Joined<["--"], "linker-arg=">,
84 Flags<[DeviceOnlyOption, HelpHidden]>,
85 HelpText<"An extra argument to be passed to the linker">;
87 // Separator between the linker wrapper and host linker flags.
88 def separator : Flag<["--"], "">, Flags<[WrapperOnlyOption]>,
89 HelpText<"The separator for the wrapped linker arguments">;
91 // Arguments for the LLVM backend.
92 def mllvm : Separate<["-"], "mllvm">, Flags<[WrapperOnlyOption]>,
93 MetaVarName<"<arg>">, HelpText<"Arguments passed to the LLVM invocation">;
94 def offload_opt_eq_minus : Joined<["--", "-"], "offload-opt=-">, Flags<[HelpHidden, WrapperOnlyOption]>,
95 HelpText<"Options passed to LLVM">;
97 // Standard linker flags also used by the linker wrapper.
98 def sysroot_EQ : Joined<["--"], "sysroot=">, HelpText<"Set the system root">;
100 def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
101 HelpText<"Path to file to write output">;
102 def output_EQ : Joined<["--"], "output=">, Alias<o>, Flags<[HelpHidden]>,
103 HelpText<"Alias for -o">;
104 def output : Separate<["--"], "output">, Alias<o>, Flags<[HelpHidden]>,
105 HelpText<"Alias for -o">;
107 def library_path : JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
108 HelpText<"Add <dir> to the library search path">;
109 def library_path_S : Separate<["--", "-"], "library-path">, Flags<[HelpHidden]>,
111 def library_path_EQ : Joined<["--", "-"], "library-path=">, Flags<[HelpHidden]>,
114 def library : JoinedOrSeparate<["-"], "l">, MetaVarName<"<libname>">,
115 HelpText<"Search for library <libname>">;
116 def library_S : Separate<["--", "-"], "library">, Flags<[HelpHidden]>,
118 def library_EQ : Joined<["--", "-"], "library=">, Flags<[HelpHidden]>,
121 def rpath : Separate<["--", "-"], "rpath">;
122 def rpath_EQ : Joined<["--", "-"], "rpath=">, Flags<[HelpHidden]>, Alias<rpath>;
124 def v : Flag<["--", "-"], "v">, HelpText<"Display the version number and exit">;
125 def version : Flag<["--", "-"], "version">, Flags<[HelpHidden]>, Alias<v>;
127 def whole_archive : Flag<["--", "-"], "whole-archive">, Flags<[HelpHidden]>;
128 def no_whole_archive : Flag<["--", "-"], "no-whole-archive">, Flags<[HelpHidden]>;