Mercurial > hg > CbC > CbC_llvm
comparison lld/ELF/Options.td @ 173:0572611fdcc8 llvm10 llvm12
reorgnization done
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 11:55:54 +0900 |
parents | 1d019706d866 |
children | 2e18cbf3894f |
comparison
equal
deleted
inserted
replaced
172:9fbae9c8bf63 | 173:0572611fdcc8 |
---|---|
1 include "llvm/Option/OptParser.td" | 1 include "llvm/Option/OptParser.td" |
2 | |
3 // Convenience classes for long options which only accept two dashes. For lld | |
4 // specific or newer long options, we prefer two dashes to avoid collision with | |
5 // short options. For many others, we have to accept both forms to be compatible | |
6 // with GNU ld. | |
7 class FF<string name> : Flag<["--"], name>; | |
8 class JJ<string name>: Joined<["--"], name>; | |
9 | |
10 multiclass EEq<string name, string help> { | |
11 def NAME: Separate<["--"], name>; | |
12 def NAME # _eq: Joined<["--"], name # "=">, Alias<!cast<Separate>(NAME)>, | |
13 HelpText<help>; | |
14 } | |
15 | |
16 multiclass BB<string name, string help1, string help2> { | |
17 def NAME: Flag<["--"], name>, HelpText<help1>; | |
18 def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>; | |
19 } | |
2 | 20 |
3 // For options whose names are multiple letters, either one dash or | 21 // For options whose names are multiple letters, either one dash or |
4 // two can precede the option name except those that start with 'o'. | 22 // two can precede the option name except those that start with 'o'. |
5 class F<string name>: Flag<["--", "-"], name>; | 23 class F<string name>: Flag<["--", "-"], name>; |
6 class J<string name>: Joined<["--", "-"], name>; | 24 class J<string name>: Joined<["--", "-"], name>; |
40 Eq<"compress-debug-sections", "Compress DWARF debug sections">, | 58 Eq<"compress-debug-sections", "Compress DWARF debug sections">, |
41 MetaVarName<"[none,zlib]">; | 59 MetaVarName<"[none,zlib]">; |
42 | 60 |
43 defm defsym: Eq<"defsym", "Define a symbol alias">, MetaVarName<"<symbol>=<value>">; | 61 defm defsym: Eq<"defsym", "Define a symbol alias">, MetaVarName<"<symbol>=<value>">; |
44 | 62 |
63 defm optimize_bb_jumps: BB<"optimize-bb-jumps", | |
64 "Remove direct jumps at the end to the next basic block", | |
65 "Do not remove any direct jumps at the end to the next basic block (default)">; | |
66 | |
45 defm split_stack_adjust_size | 67 defm split_stack_adjust_size |
46 : Eq<"split-stack-adjust-size", | 68 : Eq<"split-stack-adjust-size", |
47 "Specify adjustment to stack size when a split-stack function calls a " | 69 "Specify adjustment to stack size when a split-stack function calls a " |
48 "non-split-stack function">, | 70 "non-split-stack function">, |
49 MetaVarName<"<value>">; | 71 MetaVarName<"<value>">; |
67 | 89 |
68 defm allow_shlib_undefined: B<"allow-shlib-undefined", | 90 defm allow_shlib_undefined: B<"allow-shlib-undefined", |
69 "Allow unresolved references in shared libraries (default when linking a shared library)", | 91 "Allow unresolved references in shared libraries (default when linking a shared library)", |
70 "Do not allow unresolved references in shared libraries (default when linking an executable)">; | 92 "Do not allow unresolved references in shared libraries (default when linking an executable)">; |
71 | 93 |
72 defm apply_dynamic_relocs: B<"apply-dynamic-relocs", | 94 defm apply_dynamic_relocs: BB<"apply-dynamic-relocs", |
73 "Apply link-time values for dynamic relocations", | 95 "Apply link-time values for dynamic relocations", |
74 "Do not apply link-time values for dynamic relocations (default)">; | 96 "Do not apply link-time values for dynamic relocations (default)">; |
75 | 97 |
76 defm dependent_libraries: B<"dependent-libraries", | 98 defm dependent_libraries: BB<"dependent-libraries", |
77 "Process dependent library specifiers from input files (default)", | 99 "Process dependent library specifiers from input files (default)", |
78 "Ignore dependent library specifiers from input files">; | 100 "Ignore dependent library specifiers from input files">; |
79 | 101 |
80 defm as_needed: B<"as-needed", | 102 defm as_needed: B<"as-needed", |
81 "Only set DT_NEEDED for shared libraries if used", | 103 "Only set DT_NEEDED for shared libraries if used", |
82 "Always set DT_NEEDED for shared libraries (default)">; | 104 "Always set DT_NEEDED for shared libraries (default)">; |
83 | 105 |
84 defm call_graph_ordering_file: | 106 defm call_graph_ordering_file: |
85 Eq<"call-graph-ordering-file", "Layout sections to optimize the given callgraph">; | 107 Eq<"call-graph-ordering-file", "Layout sections to optimize the given callgraph">; |
86 | 108 |
87 defm call_graph_profile_sort: B<"call-graph-profile-sort", | 109 defm call_graph_profile_sort: BB<"call-graph-profile-sort", |
88 "Reorder sections with call graph profile (default)", | 110 "Reorder sections with call graph profile (default)", |
89 "Do not reorder sections with call graph profile">; | 111 "Do not reorder sections with call graph profile">; |
90 | 112 |
91 // -chroot doesn't have a help text because it is an internal option. | 113 // -chroot doesn't have a help text because it is an internal option. |
92 def chroot: Separate<["--", "-"], "chroot">; | 114 def chroot: Separate<["--", "-"], "chroot">; |
149 def error_unresolved_symbols: F<"error-unresolved-symbols">, | 171 def error_unresolved_symbols: F<"error-unresolved-symbols">, |
150 HelpText<"Report unresolved symbols as errors">; | 172 HelpText<"Report unresolved symbols as errors">; |
151 | 173 |
152 defm exclude_libs: Eq<"exclude-libs", "Exclude static libraries from automatic export">; | 174 defm exclude_libs: Eq<"exclude-libs", "Exclude static libraries from automatic export">; |
153 | 175 |
154 defm execute_only: B<"execute-only", | 176 defm execute_only: BB<"execute-only", |
155 "Mark executable sections unreadable", | 177 "Mark executable sections unreadable", |
156 "Mark executable sections readable (default)">; | 178 "Mark executable sections readable (default)">; |
157 | 179 |
158 defm export_dynamic: B<"export-dynamic", | 180 defm export_dynamic: B<"export-dynamic", |
159 "Put symbols in the dynamic symbol table", | 181 "Put symbols in the dynamic symbol table", |
181 | 203 |
182 defm gc_sections: B<"gc-sections", | 204 defm gc_sections: B<"gc-sections", |
183 "Enable garbage collection of unused sections", | 205 "Enable garbage collection of unused sections", |
184 "Disable garbage collection of unused sections (default)">; | 206 "Disable garbage collection of unused sections (default)">; |
185 | 207 |
186 defm gdb_index: B<"gdb-index", | 208 defm gdb_index: BB<"gdb-index", |
187 "Generate .gdb_index section", | 209 "Generate .gdb_index section", |
188 "Do not generate .gdb_index section (default)">; | 210 "Do not generate .gdb_index section (default)">; |
189 | 211 |
190 defm gnu_unique: B<"gnu-unique", | 212 defm gnu_unique: BB<"gnu-unique", |
191 "Enable STB_GNU_UNIQUE symbol binding (default)", | 213 "Enable STB_GNU_UNIQUE symbol binding (default)", |
192 "Disable STB_GNU_UNIQUE symbol binding">; | 214 "Disable STB_GNU_UNIQUE symbol binding">; |
193 | 215 |
194 defm hash_style: Eq<"hash-style", "Specify hash style (sysv, gnu or both)">; | 216 defm hash_style: Eq<"hash-style", "Specify hash style (sysv, gnu or both)">; |
195 | 217 |
225 | 247 |
226 defm merge_exidx_entries: B<"merge-exidx-entries", | 248 defm merge_exidx_entries: B<"merge-exidx-entries", |
227 "Enable merging .ARM.exidx entries (default)", | 249 "Enable merging .ARM.exidx entries (default)", |
228 "Disable merging .ARM.exidx entries">; | 250 "Disable merging .ARM.exidx entries">; |
229 | 251 |
230 defm mmap_output_file: B<"mmap-output-file", | 252 defm mmap_output_file: BB<"mmap-output-file", |
231 "Mmap the output file for writing (default)", | 253 "Mmap the output file for writing (default)", |
232 "Do not mmap the output file for writing">; | 254 "Do not mmap the output file for writing">; |
233 | 255 |
234 def nmagic: F<"nmagic">, MetaVarName<"<magic>">, | 256 def nmagic: F<"nmagic">, MetaVarName<"<magic>">, |
235 HelpText<"Do not page align sections, link against static libraries.">; | 257 HelpText<"Do not page align sections, link against static libraries.">; |
250 HelpText<"Page align sections (default)">; | 272 HelpText<"Page align sections (default)">; |
251 | 273 |
252 def no_omagic: F<"no-omagic">, MetaVarName<"<magic>">, | 274 def no_omagic: F<"no-omagic">, MetaVarName<"<magic>">, |
253 HelpText<"Do not set the text data sections to be writable, page align sections (default)">; | 275 HelpText<"Do not set the text data sections to be writable, page align sections (default)">; |
254 | 276 |
255 def no_rosegment: F<"no-rosegment">, | |
256 HelpText<"Do not put read-only non-executable sections in their own segment">; | |
257 | |
258 def no_undefined: F<"no-undefined">, | 277 def no_undefined: F<"no-undefined">, |
259 HelpText<"Report unresolved symbols even if the linker is creating a shared library">; | 278 HelpText<"Report unresolved symbols even if the linker is creating a shared library">; |
260 | 279 |
261 def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">, | 280 def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">, |
262 HelpText<"Path to file to write output">; | 281 HelpText<"Path to file to write output">; |
263 | 282 |
264 def oformat: Separate<["--"], "oformat">, MetaVarName<"<format>">, | 283 def oformat: Separate<["--"], "oformat">, MetaVarName<"<format>">, |
265 HelpText<"Specify the binary format for the output object file">; | 284 HelpText<"Specify the binary format for the output object file">; |
266 | 285 |
267 def omagic: Flag<["--"], "omagic">, MetaVarName<"<magic>">, | 286 def omagic: FF<"omagic">, MetaVarName<"<magic>">, |
268 HelpText<"Set the text and data sections to be readable and writable, do not page align sections, link against static libraries">; | 287 HelpText<"Set the text and data sections to be readable and writable, do not page align sections, link against static libraries">; |
269 | 288 |
270 defm orphan_handling: | 289 defm orphan_handling: |
271 Eq<"orphan-handling", "Control how orphan sections are handled when linker script used">; | 290 Eq<"orphan-handling", "Control how orphan sections are handled when linker script used">; |
272 | 291 |
273 defm pack_dyn_relocs: | 292 defm pack_dyn_relocs: |
274 Eq<"pack-dyn-relocs", "Pack dynamic relocations in the given format">, | 293 Eq<"pack-dyn-relocs", "Pack dynamic relocations in the given format">, |
275 MetaVarName<"[none,android,relr,android+relr]">; | 294 MetaVarName<"[none,android,relr,android+relr]">; |
276 | 295 |
277 defm use_android_relr_tags: B<"use-android-relr-tags", | 296 defm use_android_relr_tags: BB<"use-android-relr-tags", |
278 "Use SHT_ANDROID_RELR / DT_ANDROID_RELR* tags instead of SHT_RELR / DT_RELR*", | 297 "Use SHT_ANDROID_RELR / DT_ANDROID_RELR* tags instead of SHT_RELR / DT_RELR*", |
279 "Use SHT_RELR / DT_RELR* tags (default)">; | 298 "Use SHT_RELR / DT_RELR* tags (default)">; |
280 | 299 |
281 def pic_veneer: F<"pic-veneer">, | 300 def pic_veneer: F<"pic-veneer">, |
282 HelpText<"Always generate position independent thunks (veneers)">; | 301 HelpText<"Always generate position independent thunks (veneers)">; |
291 | 310 |
292 defm print_icf_sections: B<"print-icf-sections", | 311 defm print_icf_sections: B<"print-icf-sections", |
293 "List identical folded sections", | 312 "List identical folded sections", |
294 "Do not list identical folded sections (default)">; | 313 "Do not list identical folded sections (default)">; |
295 | 314 |
315 def print_archive_stats: J<"print-archive-stats=">, | |
316 HelpText<"Write archive usage statistics to the specified file. " | |
317 "Print the numbers of members and fetched members for each archive">; | |
318 | |
296 defm print_symbol_order: Eq<"print-symbol-order", | 319 defm print_symbol_order: Eq<"print-symbol-order", |
297 "Print a symbol order specified by --call-graph-ordering-file into the specified file">; | 320 "Print a symbol order specified by --call-graph-ordering-file into the specified file">; |
298 | 321 |
299 def pop_state: F<"pop-state">, | 322 def pop_state: F<"pop-state">, |
300 HelpText<"Undo the effect of -push-state">; | 323 HelpText<"Undo the effect of -push-state">; |
304 | 327 |
305 def print_map: F<"print-map">, | 328 def print_map: F<"print-map">, |
306 HelpText<"Print a link map to the standard output">; | 329 HelpText<"Print a link map to the standard output">; |
307 | 330 |
308 defm reproduce: Eq<"reproduce", "Write a tar file containing input files and command line options to reproduce link">; | 331 defm reproduce: Eq<"reproduce", "Write a tar file containing input files and command line options to reproduce link">; |
332 | |
333 defm rosegment: BB<"rosegment", | |
334 "Put read-only non-executable sections in their own segment (default)", | |
335 "Do not put read-only non-executable sections in their own segment">; | |
309 | 336 |
310 defm rpath: Eq<"rpath", "Add a DT_RUNPATH to the output">; | 337 defm rpath: Eq<"rpath", "Add a DT_RUNPATH to the output">; |
311 | 338 |
312 def relocatable: F<"relocatable">, HelpText<"Create relocatable object file">; | 339 def relocatable: F<"relocatable">, HelpText<"Create relocatable object file">; |
313 | 340 |
348 | 375 |
349 defm target2: | 376 defm target2: |
350 Eq<"target2", "Interpret R_ARM_TARGET2 as <type>, where <type> is one of rel, abs, or got-rel">, | 377 Eq<"target2", "Interpret R_ARM_TARGET2 as <type>, where <type> is one of rel, abs, or got-rel">, |
351 MetaVarName<"<type>">; | 378 MetaVarName<"<type>">; |
352 | 379 |
353 defm threads: B<"threads", | 380 defm threads |
354 "Run the linker multi-threaded (default)", | 381 : Eq<"threads", |
355 "Do not run the linker multi-threaded">; | 382 "Number of threads. '1' disables multi-threading. By default all " |
383 "available hardware threads are used">; | |
356 | 384 |
357 def time_trace: F<"time-trace">, HelpText<"Record time trace">; | 385 def time_trace: F<"time-trace">, HelpText<"Record time trace">; |
358 def time_trace_file_eq: J<"time-trace-file=">, HelpText<"Specify time trace output file">; | 386 def time_trace_file_eq: J<"time-trace-file=">, HelpText<"Specify time trace output file">; |
359 | 387 |
360 defm time_trace_granularity: Eq<"time-trace-granularity", | 388 defm time_trace_granularity: Eq<"time-trace-granularity", |
372 MetaVarName<"<symbol>">; | 400 MetaVarName<"<symbol>">; |
373 | 401 |
374 defm undefined_glob: Eq<"undefined-glob", "Force undefined symbol during linking">, | 402 defm undefined_glob: Eq<"undefined-glob", "Force undefined symbol during linking">, |
375 MetaVarName<"<pattern>">; | 403 MetaVarName<"<pattern>">; |
376 | 404 |
405 def unique: F<"unique">, HelpText<"Creates a separate output section for every orphan input section">; | |
406 | |
377 defm unresolved_symbols: | 407 defm unresolved_symbols: |
378 Eq<"unresolved-symbols", "Determine how to handle unresolved symbols">; | 408 Eq<"unresolved-symbols", "Determine how to handle unresolved symbols">; |
379 | 409 |
380 defm undefined_version: B<"undefined-version", | 410 defm undefined_version: B<"undefined-version", |
381 "Allow unused version in version script (default)", | 411 "Allow unused version in version script (default)", |
390 | 420 |
391 def version: F<"version">, HelpText<"Display the version number and exit">; | 421 def version: F<"version">, HelpText<"Display the version number and exit">; |
392 | 422 |
393 defm version_script: Eq<"version-script", "Read a version script">; | 423 defm version_script: Eq<"version-script", "Read a version script">; |
394 | 424 |
395 defm warn_backrefs: B<"warn-backrefs", | 425 defm warn_backrefs: BB<"warn-backrefs", |
396 "Warn about backward symbol references to fetch archive members", | 426 "Warn about backward symbol references to fetch archive members", |
397 "Do not warn about backward symbol references to fetch archive members (default)">; | 427 "Do not warn about backward symbol references to fetch archive members (default)">; |
428 | |
429 defm warn_backrefs_exclude | |
430 : Eq<"warn-backrefs-exclude", | |
431 "Glob describing an archive (or an object file within --start-lib) " | |
432 "which should be ignored for --warn-backrefs.">, | |
433 MetaVarName<"<glob>">; | |
398 | 434 |
399 defm warn_common: B<"warn-common", | 435 defm warn_common: B<"warn-common", |
400 "Warn about duplicate common symbols", | 436 "Warn about duplicate common symbols", |
401 "Do not warn about duplicate common symbols (default)">; | 437 "Do not warn about duplicate common symbols (default)">; |
402 | 438 |
403 defm warn_ifunc_textrel: B<"warn-ifunc-textrel", | 439 defm warn_ifunc_textrel: BB<"warn-ifunc-textrel", |
404 "Warn about using ifunc symbols with text relocations", | 440 "Warn about using ifunc symbols with text relocations", |
405 "Do not warn about using ifunc symbols with text relocations (default)">; | 441 "Do not warn about using ifunc symbols with text relocations (default)">; |
406 | 442 |
407 defm warn_symbol_ordering: B<"warn-symbol-ordering", | 443 defm warn_symbol_ordering: BB<"warn-symbol-ordering", |
408 "Warn about problems with the symbol ordering file (default)", | 444 "Warn about problems with the symbol ordering file (default)", |
409 "Do not warn about problems with the symbol ordering file">; | 445 "Do not warn about problems with the symbol ordering file">; |
410 | 446 |
411 def warn_unresolved_symbols: F<"warn-unresolved-symbols">, | 447 def warn_unresolved_symbols: F<"warn-unresolved-symbols">, |
412 HelpText<"Report unresolved symbols as warnings">; | 448 HelpText<"Report unresolved symbols as warnings">; |
464 def: JoinedOrSeparate<["-"], "y">, Alias<trace_symbol>, HelpText<"Alias for --trace-symbol">; | 500 def: JoinedOrSeparate<["-"], "y">, Alias<trace_symbol>, HelpText<"Alias for --trace-symbol">; |
465 def: JoinedOrSeparate<["-"], "u">, Alias<undefined>, HelpText<"Alias for --undefined">; | 501 def: JoinedOrSeparate<["-"], "u">, Alias<undefined>, HelpText<"Alias for --undefined">; |
466 def: Flag<["-"], "V">, Alias<version>, HelpText<"Alias for --version">; | 502 def: Flag<["-"], "V">, Alias<version>, HelpText<"Alias for --version">; |
467 | 503 |
468 // LTO-related options. | 504 // LTO-related options. |
469 def lto_aa_pipeline: J<"lto-aa-pipeline=">, | 505 def lto_aa_pipeline: JJ<"lto-aa-pipeline=">, |
470 HelpText<"AA pipeline to run during LTO. Used in conjunction with -lto-newpm-passes">; | 506 HelpText<"AA pipeline to run during LTO. Used in conjunction with -lto-newpm-passes">; |
471 def lto_debug_pass_manager: F<"lto-debug-pass-manager">, | 507 def lto_debug_pass_manager: FF<"lto-debug-pass-manager">, |
472 HelpText<"Debug new pass manager">; | 508 HelpText<"Debug new pass manager">; |
473 def lto_new_pass_manager: F<"lto-new-pass-manager">, | 509 def lto_emit_asm: FF<"lto-emit-asm">, |
510 HelpText<"Emit assembly code">; | |
511 def lto_new_pass_manager: FF<"lto-new-pass-manager">, | |
474 HelpText<"Use new pass manager">; | 512 HelpText<"Use new pass manager">; |
475 def lto_newpm_passes: J<"lto-newpm-passes=">, | 513 def lto_newpm_passes: JJ<"lto-newpm-passes=">, |
476 HelpText<"Passes to run during LTO">; | 514 HelpText<"Passes to run during LTO">; |
477 def lto_O: J<"lto-O">, MetaVarName<"<opt-level>">, | 515 def lto_O: JJ<"lto-O">, MetaVarName<"<opt-level>">, |
478 HelpText<"Optimization level for LTO">; | 516 HelpText<"Optimization level for LTO">; |
479 def lto_partitions: J<"lto-partitions=">, | 517 def lto_partitions: JJ<"lto-partitions=">, |
480 HelpText<"Number of LTO codegen partitions">; | 518 HelpText<"Number of LTO codegen partitions">; |
481 def lto_cs_profile_generate: F<"lto-cs-profile-generate">, | 519 def lto_cs_profile_generate: FF<"lto-cs-profile-generate">, |
482 HelpText<"Perform context sensitive PGO instrumentation">; | 520 HelpText<"Perform context sensitive PGO instrumentation">; |
483 def lto_cs_profile_file: J<"lto-cs-profile-file=">, | 521 def lto_cs_profile_file: JJ<"lto-cs-profile-file=">, |
484 HelpText<"Context sensitive profile file path">; | 522 HelpText<"Context sensitive profile file path">; |
485 def lto_obj_path_eq: J<"lto-obj-path=">; | 523 def lto_obj_path_eq: JJ<"lto-obj-path=">; |
486 def lto_sample_profile: J<"lto-sample-profile=">, | 524 def lto_sample_profile: JJ<"lto-sample-profile=">, |
487 HelpText<"Sample profile file path">; | 525 HelpText<"Sample profile file path">; |
488 def lto_whole_program_visibility: F<"lto-whole-program-visibility">, | 526 def lto_whole_program_visibility: FF<"lto-whole-program-visibility">, |
489 HelpText<"Asserts that the LTO link has whole program visibility">; | 527 HelpText<"Asserts that the LTO link has whole program visibility">; |
490 def disable_verify: F<"disable-verify">; | 528 def disable_verify: F<"disable-verify">; |
491 defm mllvm: Eq<"mllvm", "Additional arguments to forward to LLVM's option processing">; | 529 defm mllvm: Eq<"mllvm", "Additional arguments to forward to LLVM's option processing">; |
492 def opt_remarks_filename: Separate<["--"], "opt-remarks-filename">, | 530 def opt_remarks_filename: Separate<["--"], "opt-remarks-filename">, |
493 HelpText<"YAML output file for optimization remarks">; | 531 HelpText<"YAML output file for optimization remarks">; |
494 def opt_remarks_passes: Separate<["--"], "opt-remarks-passes">, | 532 def opt_remarks_passes: Separate<["--"], "opt-remarks-passes">, |
495 HelpText<"Regex for the passes that need to be serialized to the output file">; | 533 HelpText<"Regex for the passes that need to be serialized to the output file">; |
496 def opt_remarks_with_hotness: Flag<["--"], "opt-remarks-with-hotness">, | 534 def opt_remarks_with_hotness: FF<"opt-remarks-with-hotness">, |
497 HelpText<"Include hotness information in the optimization remarks file">; | 535 HelpText<"Include hotness information in the optimization remarks file">; |
498 def opt_remarks_format: Separate<["--"], "opt-remarks-format">, | 536 def opt_remarks_format: Separate<["--"], "opt-remarks-format">, |
499 HelpText<"The format used for serializing remarks (default: YAML)">; | 537 HelpText<"The format used for serializing remarks (default: YAML)">; |
500 defm plugin_opt: Eq<"plugin-opt", "specifies LTO options for compatibility with GNU linkers">; | |
501 def save_temps: F<"save-temps">; | 538 def save_temps: F<"save-temps">; |
502 def thinlto_cache_dir: J<"thinlto-cache-dir=">, | 539 def lto_basicblock_sections: JJ<"lto-basicblock-sections=">, |
540 HelpText<"Enable basic block sections for LTO">; | |
541 defm lto_unique_bb_section_names: BB<"lto-unique-bb-section-names", | |
542 "Give unique names to every basic block section for LTO", | |
543 "Do not give unique names to every basic block section for LTO (default)">; | |
544 def shuffle_sections: JJ<"shuffle-sections=">, MetaVarName<"<seed>">, | |
545 HelpText<"Shuffle input sections using the given seed. If 0, use a random seed">; | |
546 def thinlto_cache_dir: JJ<"thinlto-cache-dir=">, | |
503 HelpText<"Path to ThinLTO cached object file directory">; | 547 HelpText<"Path to ThinLTO cached object file directory">; |
504 defm thinlto_cache_policy: Eq<"thinlto-cache-policy", "Pruning policy for the ThinLTO cache">; | 548 defm thinlto_cache_policy: EEq<"thinlto-cache-policy", "Pruning policy for the ThinLTO cache">; |
505 def thinlto_emit_imports_files: F<"thinlto-emit-imports-files">; | 549 def thinlto_emit_imports_files: FF<"thinlto-emit-imports-files">; |
506 def thinlto_index_only: F<"thinlto-index-only">; | 550 def thinlto_index_only: FF<"thinlto-index-only">; |
507 def thinlto_index_only_eq: J<"thinlto-index-only=">; | 551 def thinlto_index_only_eq: JJ<"thinlto-index-only=">; |
508 def thinlto_jobs: J<"thinlto-jobs=">, HelpText<"Number of ThinLTO jobs">; | 552 def thinlto_jobs: JJ<"thinlto-jobs=">, |
509 def thinlto_object_suffix_replace_eq: J<"thinlto-object-suffix-replace=">; | 553 HelpText<"Number of ThinLTO jobs. Default to --threads=">; |
510 def thinlto_prefix_replace_eq: J<"thinlto-prefix-replace=">; | 554 def thinlto_object_suffix_replace_eq: JJ<"thinlto-object-suffix-replace=">; |
511 | 555 def thinlto_prefix_replace_eq: JJ<"thinlto-prefix-replace=">; |
512 def: J<"plugin-opt=O">, Alias<lto_O>, HelpText<"Alias for -lto-O">; | 556 |
557 def: J<"plugin-opt=O">, Alias<lto_O>, HelpText<"Alias for --lto-O">; | |
513 def: F<"plugin-opt=debug-pass-manager">, | 558 def: F<"plugin-opt=debug-pass-manager">, |
514 Alias<lto_debug_pass_manager>, HelpText<"Alias for -lto-debug-pass-manager">; | 559 Alias<lto_debug_pass_manager>, HelpText<"Alias for --lto-debug-pass-manager">; |
515 def: F<"plugin-opt=disable-verify">, Alias<disable_verify>, HelpText<"Alias for -disable-verify">; | 560 def: F<"plugin-opt=disable-verify">, Alias<disable_verify>, HelpText<"Alias for --disable-verify">; |
516 def plugin_opt_dwo_dir_eq: J<"plugin-opt=dwo_dir=">, | 561 def plugin_opt_dwo_dir_eq: J<"plugin-opt=dwo_dir=">, |
517 HelpText<"Directory to store .dwo files when LTO and debug fission are used">; | 562 HelpText<"Directory to store .dwo files when LTO and debug fission are used">; |
563 def plugin_opt_emit_asm: F<"plugin-opt=emit-asm">, | |
564 Alias<lto_emit_asm>, HelpText<"Alias for --lto-emit-asm">; | |
518 def plugin_opt_emit_llvm: F<"plugin-opt=emit-llvm">; | 565 def plugin_opt_emit_llvm: F<"plugin-opt=emit-llvm">; |
519 def: J<"plugin-opt=jobs=">, Alias<thinlto_jobs>, HelpText<"Alias for -thinlto-jobs">; | 566 def: J<"plugin-opt=jobs=">, Alias<thinlto_jobs>, HelpText<"Alias for --thinlto-jobs">; |
520 def: J<"plugin-opt=lto-partitions=">, Alias<lto_partitions>, HelpText<"Alias for -lto-partitions">; | 567 def: J<"plugin-opt=lto-partitions=">, Alias<lto_partitions>, HelpText<"Alias for --lto-partitions">; |
521 def plugin_opt_mcpu_eq: J<"plugin-opt=mcpu=">; | 568 def plugin_opt_mcpu_eq: J<"plugin-opt=mcpu=">; |
522 def: F<"plugin-opt=new-pass-manager">, | 569 def: F<"plugin-opt=new-pass-manager">, |
523 Alias<lto_new_pass_manager>, HelpText<"Alias for -lto-new-pass-manager">; | 570 Alias<lto_new_pass_manager>, HelpText<"Alias for --lto-new-pass-manager">; |
524 def: F<"plugin-opt=cs-profile-generate">, | 571 def: F<"plugin-opt=cs-profile-generate">, |
525 Alias<lto_cs_profile_generate>, HelpText<"Alias for -lto-cs-profile-generate">; | 572 Alias<lto_cs_profile_generate>, HelpText<"Alias for --lto-cs-profile-generate">; |
526 def: J<"plugin-opt=cs-profile-path=">, | 573 def: J<"plugin-opt=cs-profile-path=">, |
527 Alias<lto_cs_profile_file>, HelpText<"Alias for -lto-cs-profile-file">; | 574 Alias<lto_cs_profile_file>, HelpText<"Alias for --lto-cs-profile-file">; |
528 def: J<"plugin-opt=obj-path=">, | 575 def: J<"plugin-opt=obj-path=">, |
529 Alias<lto_obj_path_eq>, | 576 Alias<lto_obj_path_eq>, |
530 HelpText<"Alias for -lto-obj-path=">; | 577 HelpText<"Alias for --lto-obj-path=">; |
531 def: J<"plugin-opt=sample-profile=">, | 578 def: J<"plugin-opt=sample-profile=">, |
532 Alias<lto_sample_profile>, HelpText<"Alias for -lto-sample-profile">; | 579 Alias<lto_sample_profile>, HelpText<"Alias for --lto-sample-profile">; |
533 def: F<"plugin-opt=save-temps">, Alias<save_temps>, HelpText<"Alias for -save-temps">; | 580 def: F<"plugin-opt=save-temps">, Alias<save_temps>, HelpText<"Alias for --save-temps">; |
534 def: F<"plugin-opt=thinlto-emit-imports-files">, | 581 def: F<"plugin-opt=thinlto-emit-imports-files">, |
535 Alias<thinlto_emit_imports_files>, | 582 Alias<thinlto_emit_imports_files>, |
536 HelpText<"Alias for -thinlto-emit-imports-files">; | 583 HelpText<"Alias for --thinlto-emit-imports-files">; |
537 def: F<"plugin-opt=thinlto-index-only">, | 584 def: F<"plugin-opt=thinlto-index-only">, |
538 Alias<thinlto_index_only>, | 585 Alias<thinlto_index_only>, |
539 HelpText<"Alias for -thinlto-index-only">; | 586 HelpText<"Alias for --thinlto-index-only">; |
540 def: J<"plugin-opt=thinlto-index-only=">, | 587 def: J<"plugin-opt=thinlto-index-only=">, |
541 Alias<thinlto_index_only_eq>, | 588 Alias<thinlto_index_only_eq>, |
542 HelpText<"Alias for -thinlto-index-only=">; | 589 HelpText<"Alias for --thinlto-index-only=">; |
543 def: J<"plugin-opt=thinlto-object-suffix-replace=">, | 590 def: J<"plugin-opt=thinlto-object-suffix-replace=">, |
544 Alias<thinlto_object_suffix_replace_eq>, | 591 Alias<thinlto_object_suffix_replace_eq>, |
545 HelpText<"Alias for -thinlto-object-suffix-replace=">; | 592 HelpText<"Alias for --thinlto-object-suffix-replace=">; |
546 def: J<"plugin-opt=thinlto-prefix-replace=">, | 593 def: J<"plugin-opt=thinlto-prefix-replace=">, |
547 Alias<thinlto_prefix_replace_eq>, | 594 Alias<thinlto_prefix_replace_eq>, |
548 HelpText<"Alias for -thinlto-prefix-replace=">; | 595 HelpText<"Alias for --thinlto-prefix-replace=">; |
549 | 596 |
550 // Ignore LTO plugin-related options. | 597 // Ignore LTO plugin-related options. |
551 // clang -flto passes -plugin and -plugin-opt to the linker. This is required | 598 // clang -flto passes -plugin and -plugin-opt to the linker. This is required |
552 // for ld.gold and ld.bfd to get LTO working. But it's not for lld which doesn't | 599 // for ld.gold and ld.bfd to get LTO working. But it's not for lld which doesn't |
553 // rely on a plugin. Instead of detecting which linker is used on clang side we | 600 // rely on a plugin. Instead of detecting which linker is used on clang side we |
554 // just ignore the option on lld side as it's easier. In fact, the linker could | 601 // just ignore the option on lld side as it's easier. In fact, the linker could |
555 // be called 'ld' and understanding which linker is used would require parsing of | 602 // be called 'ld' and understanding which linker is used would require parsing of |
556 // --version output. | 603 // --version output. |
557 defm plugin: Eq<"plugin", "Ignored for compatibility with GNU linkers">; | 604 defm plugin: Eq<"plugin", "Ignored for compatibility with GNU linkers">; |
558 | 605 |
559 def plugin_opt_fresolution_eq: J<"plugin-opt=-fresolution=">; | 606 def plugin_opt_eq_minus: J<"plugin-opt=-">, |
560 def plugin_opt_pass_through_eq: J<"plugin-opt=-pass-through=">; | 607 HelpText<"Specify an LLVM option for compatibility with LLVMgold.so">; |
561 def plugin_opt_thinlto: J<"plugin-opt=thinlto">; | 608 def: J<"plugin-opt=thinlto">; |
562 def plugin_opt_slash: J<"plugin-opt=/">; | 609 |
610 // Ignore GCC collect2 LTO plugin related options. Note that we don't support | |
611 // GCC LTO, but GCC collect2 passes these options even in non-LTO mode. | |
612 def: J<"plugin-opt=-fresolution=">; | |
613 def: J<"plugin-opt=-pass-through=">; | |
614 // This may be either an unhandled LLVMgold.so feature or GCC passed | |
615 // -plugin-opt=path/to/{liblto_plugin.so,lto-wrapper} | |
616 def plugin_opt_eq : J<"plugin-opt=">; | |
563 | 617 |
564 // Options listed below are silently ignored for now for compatibility. | 618 // Options listed below are silently ignored for now for compatibility. |
565 def: F<"detect-odr-violations">; | 619 def: F<"detect-odr-violations">; |
566 def: Flag<["-"], "g">; | 620 def: Flag<["-"], "g">; |
567 def: F<"long-plt">; | 621 def: F<"long-plt">; |