Debian Codegraph @

clang/tools/clang-linker-wrapper/LinkerWrapperOpts.td

raw
1 include "llvm/Option/OptParser.td"
2
3 def WrapperOnlyOption : OptionFlag;
4 def DeviceOnlyOption : OptionFlag;
5
6 def help : Flag<["--"], "help">,
7 HelpText<"Display available options (--help-hidden for more)">;
8
9 def help_hidden : Flag<["--"], "help-hidden">,
10 HelpText<"Display all available options">;
11
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]>,
21 MetaVarName<"<triple>">,
22 HelpText<"Triple to use for the host compilation">;
23 def device_linker_args_EQ : Joined<["--"], "device-linker=">,
24 Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
25 HelpText<"Arguments to pass to the device linker invocation">;
26 def device_compiler_args_EQ : Joined<["--"], "device-compiler=">,
27 Flags<[WrapperOnlyOption]>, MetaVarName<"<value> or <triple>=<value>">,
28 HelpText<"Arguments to pass to the device compiler invocation">;
29 def dry_run : Flag<["--"], "dry-run">,
30 Flags<[WrapperOnlyOption]>,
31 HelpText<"Print program arguments without running">;
32 def verbose : Flag<["--"], "wrapper-verbose">,
33 Flags<[WrapperOnlyOption]>, HelpText<"Verbose output from tools">;
34 def embed_bitcode : Flag<["--"], "embed-bitcode">,
35 Flags<[WrapperOnlyOption]>,
36 HelpText<"Embed linked bitcode in the module">;
37 def print_wrapped_module : Flag<["--"], "print-wrapped-module">,
38 Flags<[WrapperOnlyOption]>,
39 HelpText<"Print the wrapped module's IR for testing">;
40 def save_temps : Flag<["--"], "save-temps">,
41 Flags<[WrapperOnlyOption]>, HelpText<"Save intermediate results">;
42 def compress : Flag<["--"], "compress">,
43 Flags<[WrapperOnlyOption]>, HelpText<"Compress bundled files">;
44 def compression_level_eq : Joined<["--"], "compression-level=">,
45 Flags<[WrapperOnlyOption]>, HelpText<"Specify the compression level (integer)">;
46
47 def wrapper_time_trace_eq : Joined<["--"], "wrapper-time-trace=">,
48 Flags<[WrapperOnlyOption]>, MetaVarName<"<file>">,
49 HelpText<"Enable time-trace and write the output to <file>">;
50 def wrapper_time_trace_granularity : Joined<["--"], "wrapper-time-trace-granularity=">,
51 Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
52 HelpText<"Set the granularity of time-trace updates">;
53
54 def wrapper_jobs : Joined<["--"], "wrapper-jobs=">,
55 Flags<[WrapperOnlyOption]>, MetaVarName<"<number>">,
56 HelpText<"Sets the number of parallel jobs for device linking. Can be a "
57 "positive integer or 'jobserver'.">;
58
59 def override_image : Joined<["--"], "override-image=">,
60 Flags<[WrapperOnlyOption]>, MetaVarName<"<kind=file>">,
61 HelpText<"Uses the provided file as if it were the output of the device link step">;
62
63 def should_extract : CommaJoined<["--"], "should-extract=">,
64 Flags<[WrapperOnlyOption]>, MetaVarName<"<kind=file>">,
65 HelpText<"Set of device architectures we should always extract if found.">;
66
67 def emit_fatbin_only
68 : Flag<["--"], "emit-fatbin-only">,
69 Flags<[WrapperOnlyOption]>,
70 HelpText<"Emit fat binary directly without wrapping or host linking">;
71
72 // Flags passed to the device linker.
73 def arch_EQ : Joined<["--"], "arch=">,
74 Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<arch>">,
75 HelpText<"The device subarchitecture">;
76 def triple_EQ : Joined<["--"], "triple=">,
77 Flags<[DeviceOnlyOption, HelpHidden]>, MetaVarName<"<triple>">,
78 HelpText<"The device target triple">;
79 def whole_program : Flag<["--"], "whole-program">,
80 Flags<[DeviceOnlyOption, HelpHidden]>,
81 HelpText<"LTO has visibility of all input files">;
82 def linker_arg_EQ : Joined<["--"], "linker-arg=">,
83 Flags<[DeviceOnlyOption, HelpHidden]>,
84 HelpText<"An extra argument to be passed to the linker">;
85 def compiler_arg_EQ : Joined<["--"], "compiler-arg=">,
86 Flags<[DeviceOnlyOption, HelpHidden]>,
87 HelpText<"An extra argument to be passed to the compiler">;
88
89 // Arguments for the LLVM backend.
90 def mllvm : Separate<["-"], "mllvm">, Flags<[WrapperOnlyOption]>,
91 MetaVarName<"<arg>">,
92 HelpText<"Arguments passed to LLVM, including Clang invocations, for which "
93 "the '-mllvm' prefix is preserved. Use '-mllvm --help' for a list "
94 "of options.">;
95 def offload_opt_eq_minus : Joined<["--", "-"], "offload-opt=">, Flags<[HelpHidden, WrapperOnlyOption]>,
96 HelpText<"Options passed to LLVM, not including the Clang invocation. Use "
97 "'--offload-opt=--help' for a list of options.">;
98
99 // Standard linker flags also used by the linker wrapper.
100 def sysroot_EQ : Joined<["--"], "sysroot=">, HelpText<"Set the system root">;
101
102 def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
103 HelpText<"Path to file to write output">;
104 def output_EQ : Joined<["--"], "output=">, Alias<o>, Flags<[HelpHidden]>,
105 HelpText<"Alias for -o">;
106 def output : Separate<["--"], "output">, Alias<o>, Flags<[HelpHidden]>,
107 HelpText<"Alias for -o">;
108
109 def library_path : JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
110 HelpText<"Add <dir> to the library search path">;
111 def library_path_S : Separate<["--", "-"], "library-path">, Flags<[HelpHidden]>,
112 Alias<library_path>;
113 def library_path_EQ : Joined<["--", "-"], "library-path=">, Flags<[HelpHidden]>,
114 Alias<library_path>;
115
116 def library : JoinedOrSeparate<["-"], "l">, MetaVarName<"<libname>">,
117 HelpText<"Search for library <libname>">;
118 def library_S : Separate<["--", "-"], "library">, Flags<[HelpHidden]>,
119 Alias<library_path>;
120 def library_EQ : Joined<["--", "-"], "library=">, Flags<[HelpHidden]>,
121 Alias<library_path>;
122
123 def rpath : Separate<["--", "-"], "rpath">;
124 def rpath_EQ : Joined<["--", "-"], "rpath=">, Flags<[HelpHidden]>, Alias<rpath>;
125
126 def version : Flag<["--", "-"], "version">, Flags<[HelpHidden]>;
127
128 def whole_archive : Flag<["--", "-"], "whole-archive">, Flags<[HelpHidden]>;
129 def no_whole_archive : Flag<["--", "-"], "no-whole-archive">, Flags<[HelpHidden]>;
130
131 def relocatable : Flag<["--", "-"], "relocatable">,
132 HelpText<"Link device code to create a relocatable offloading application">;
133 def r : Flag<["-"], "r">, Alias<relocatable>;
134
135 // link.exe-style linker options.
136 def out : Joined<["/", "-", "/?", "-?"], "out:">, Flags<[HelpHidden]>;
137 def libpath : Joined<["/", "-", "/?", "-?"], "libpath:">, Flags<[HelpHidden]>;
138 def wholearchive_flag : Joined<["/", "-", "/?", "-?"], "wholearchive">, Flags<[HelpHidden]>;