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 device_linker_args_EQ : Joined<["--"], "device-linker=">,
29 Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
30 HelpText<"Arguments to pass to the device linker 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">;
55 def wrapper_time_trace_eq : Joined<["--"], "wrapper-time-trace=">,
56 Flags<[WrapperOnlyOption]>, MetaVarName<"<file>">,
57 HelpText<"Enable time-trace and write the output to <file>">;
58 def wrapper_time_trace_granularity : Joined<["--"], "wrapper-time-trace-granularity=">,
59 Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
60 HelpText<"Set the granularity of time-trace updates">;
62 // Flags passed to the device linker.
63 def arch_EQ : Joined<["--"], "arch=">,
64 Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<arch>">,
65 HelpText<"The device subarchitecture">;
66 def triple_EQ : Joined<["--"], "triple=">,
67 Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<triple>">,
68 HelpText<"The device target triple">;
69 def whole_program : Flag<["--"], "whole-program">,
70 Flags<[DeviceOnlyOption, HelpHidden]>,
71 HelpText<"LTO has visibility of all input files">;
72 def linker_arg_EQ : Joined<["--"], "linker-arg=">,
73 Flags<[DeviceOnlyOption, HelpHidden]>,
74 HelpText<"An extra argument to be passed to the linker">;
76 // Separator between the linker wrapper and host linker flags.
77 def separator : Flag<["--"], "">, Flags<[WrapperOnlyOption]>,
78 HelpText<"The separator for the wrapped linker arguments">;
80 // Arguments for the LLVM backend.
81 def mllvm : Separate<["-"], "mllvm">, Flags<[WrapperOnlyOption]>,
82 MetaVarName<"<arg>">, HelpText<"Arguments passed to the LLVM invocation">;
83 def offload_opt_eq_minus : Joined<["--", "-"], "offload-opt=-">, Flags<[HelpHidden, WrapperOnlyOption]>,
84 HelpText<"Options passed to LLVM">;
86 // Standard linker flags also used by the linker wrapper.
87 def sysroot_EQ : Joined<["--"], "sysroot">, HelpText<"Set the system root">;
89 def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
90 HelpText<"Path to file to write output">;
91 def output_EQ : Joined<["--"], "output=">, Alias<o>, Flags<[HelpHidden]>,
92 HelpText<"Alias for -o">;
93 def output : Separate<["--"], "output">, Alias<o>, Flags<[HelpHidden]>,
94 HelpText<"Alias for -o">;
96 def library_path : JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
97 HelpText<"Add <dir> to the library search path">;
98 def library_path_S : Separate<["--", "-"], "library-path">, Flags<[HelpHidden]>,
100 def library_path_EQ : Joined<["--", "-"], "library-path=">, Flags<[HelpHidden]>,
103 def library : JoinedOrSeparate<["-"], "l">, MetaVarName<"<libname>">,
104 HelpText<"Search for library <libname>">;
105 def library_S : Separate<["--", "-"], "library">, Flags<[HelpHidden]>,
107 def library_EQ : Joined<["--", "-"], "library=">, Flags<[HelpHidden]>,
110 def as_needed : Flag<["--", "-"], "as-needed">;
111 def no_as_needed : Flag<["--", "-"], "no-as-needed">;
113 def rpath : Separate<["--", "-"], "rpath">;
114 def rpath_EQ : Joined<["--", "-"], "rpath=">, Flags<[HelpHidden]>, Alias<rpath>;
116 def dynamic_linker : Separate<["--", "-"], "dynamic-linker">;
117 def dynamic_linker_EQ : Joined<["--", "-"], "dynamic-linker=">, Alias<dynamic_linker>;
119 def v : Flag<["--", "-"], "v">, HelpText<"Display the version number and exit">;
120 def version : Flag<["--", "-"], "version">, Flags<[HelpHidden]>, Alias<v>;