Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 1 | include "llvm/Option/OptParser.td" |
| 2 | |
| 3 | class F<string name>: Flag<["--", "-"], name>; |
| 4 | class J<string name>: Joined<["--", "-"], name>; |
| 5 | class S<string name>: Separate<["--", "-"], name>; |
| 6 | |
| 7 | def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">, |
| 8 | HelpText<"Add a directory to the library search path">; |
Martin Storsjo | d79a4b7 | 2019-01-29 19:24:32 | [diff] [blame] | 9 | def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">; |
| 10 | def Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">; |
Martin Storsjo | 094d8c0 | 2017-11-15 08:18:11 | [diff] [blame] | 11 | def dynamicbase: F<"dynamicbase">, HelpText<"Enable ASLR">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 12 | def entry: S<"entry">, MetaVarName<"<entry>">, |
| 13 | HelpText<"Name of entry point symbol">; |
Martin Storsjo | 9705898 | 2019-02-19 21:57:49 | [diff] [blame] | 14 | def exclude_all_symbols: F<"exclude-all-symbols">, |
| 15 | HelpText<"Don't automatically export any symbols">; |
Martin Storsjo | a84a477 | 2017-10-12 05:37:18 | [diff] [blame] | 16 | def export_all_symbols: F<"export-all-symbols">, |
| 17 | HelpText<"Export all symbols even if a def file or dllexport attributes are used">; |
Martin Storsjo | b190fd2 | 2017-11-15 08:18:20 | [diff] [blame] | 18 | def gc_sections: F<"gc-sections">, HelpText<"Remove unused sections">; |
Martin Storsjo | 9ae0d22 | 2019-05-17 11:07:38 | [diff] [blame] | 19 | def help: F<"help">, HelpText<"Print option help">; |
Martin Storsjo | b190fd2 | 2017-11-15 08:18:20 | [diff] [blame] | 20 | def icf: J<"icf=">, HelpText<"Identical code folding">; |
Martin Storsjo | e916868 | 2017-11-15 08:18:15 | [diff] [blame] | 21 | def image_base: S<"image-base">, HelpText<"Base address of the program">; |
Martin Storsjo | dfb2fcd | 2019-02-06 21:05:29 | [diff] [blame] | 22 | def insert_timestamp: F<"insert-timestamp">, |
| 23 | HelpText<"Include PE header timestamp">; |
Martin Storsjo | fb36e6e | 2018-03-14 20:17:24 | [diff] [blame] | 24 | def kill_at: F<"kill-at">, HelpText<"Remove @n from exported symbols">; |
Rui Ueyama | c3e4602 | 2017-09-11 20:54:51 | [diff] [blame] | 25 | def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">, |
| 26 | HelpText<"Root name of library to use">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 27 | def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">; |
Martin Storsjo | 0366155 | 2018-05-15 21:12:29 | [diff] [blame] | 28 | def map: S<"Map">, HelpText<"Output a linker map">; |
| 29 | def map_eq: J<"Map=">, Alias<map>; |
Martin Storsjo | 537a718 | 2019-02-05 08:16:06 | [diff] [blame] | 30 | def no_insert_timestamp: F<"no-insert-timestamp">, |
| 31 | HelpText<"Don't include PE header timestamp">; |
Martin Storsjo | 32e1626 | 2017-09-13 07:28:09 | [diff] [blame] | 32 | def no_whole_archive: F<"no-whole-archive">, |
| 33 | HelpText<"No longer include all object files for following archives">; |
Martin Storsjo | 3c8d4b5 | 2017-11-15 08:18:06 | [diff] [blame] | 34 | def large_address_aware: Flag<["--"], "large-address-aware">, |
| 35 | HelpText<"Enable large addresses">; |
Martin Storsjo | b190fd2 | 2017-11-15 08:18:20 | [diff] [blame] | 36 | def no_gc_sections: F<"no-gc-sections">, HelpText<"Don't remove unused sections">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 37 | def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">, |
| 38 | HelpText<"Path to file to write output">; |
Rui Ueyama | c3e4602 | 2017-09-11 20:54:51 | [diff] [blame] | 39 | def out_implib: Separate<["--"], "out-implib">, HelpText<"Import library name">; |
Martin Storsjo | 27af6b0 | 2017-10-26 20:11:58 | [diff] [blame] | 40 | def out_implib_eq: Joined<["--"], "out-implib=">, Alias<out_implib>; |
Martin Storsjo | a84a477 | 2017-10-12 05:37:18 | [diff] [blame] | 41 | def output_def: S<"output-def">, HelpText<"Output def file">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 42 | def shared: F<"shared">, HelpText<"Build a shared object">; |
Rui Ueyama | 1f4cdcf | 2017-09-14 18:33:21 | [diff] [blame] | 43 | def subs: S<"subsystem">, HelpText<"Specify subsystem">; |
| 44 | def stack: S<"stack">; |
Martin Storsjo | 068512d | 2017-11-03 22:10:37 | [diff] [blame] | 45 | def strip_all: F<"strip-all">, |
| 46 | HelpText<"Omit all symbol information from the output binary">; |
Martin Storsjo | c082674 | 2018-06-29 06:08:31 | [diff] [blame] | 47 | def strip_debug: F<"strip-debug">, |
| 48 | HelpText<"Omit all debug information, but keep symbol information">; |
Martin Storsjo | 32e1626 | 2017-09-13 07:28:09 | [diff] [blame] | 49 | def whole_archive: F<"whole-archive">, |
| 50 | HelpText<"Include all object files for following archives">; |
Martin Storsjo | 6863dfa | 2019-05-17 11:07:42 | [diff] [blame^] | 51 | def v: Flag<["-"], "v">, HelpText<"Display the version number">; |
Martin Storsjo | a79762a | 2017-09-11 20:43:39 | [diff] [blame] | 52 | def verbose: F<"verbose">, HelpText<"Verbose mode">; |
Martin Storsjo | 6863dfa | 2019-05-17 11:07:42 | [diff] [blame^] | 53 | def version: F<"version">, HelpText<"Display the version number and exit">; |
Martin Storsjo | db62913 | 2018-09-10 17:41:40 | [diff] [blame] | 54 | def require_defined: S<"require-defined">, |
| 55 | HelpText<"Force symbol to be added to symbol table as an undefined one">; |
| 56 | def require_defined_eq: J<"require-defined=">, Alias<require_defined>; |
Martin Storsjo | a79762a | 2017-09-11 20:43:39 | [diff] [blame] | 57 | |
| 58 | // LLD specific options |
| 59 | def _HASH_HASH_HASH : Flag<["-"], "###">, |
| 60 | HelpText<"Print (but do not run) the commands to run for this compilation">; |
Martin Storsjo | 2c1f3ea | 2019-04-19 13:50:43 | [diff] [blame] | 61 | def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the executable">; |
Martin Storsjo | 107b548 | 2017-11-03 07:18:37 | [diff] [blame] | 62 | def mllvm: S<"mllvm">; |
Martin Storsjo | 2c52ddf | 2019-05-17 11:07:33 | [diff] [blame] | 63 | def pdb: S<"pdb">, HelpText<"Specify output PDB debug information file. " |
| 64 | "Defaults to the output filename, with a pdb suffix, if given an empty argument">; |
| 65 | def pdb_eq: J<"pdb=">, Alias<pdb>; |
Martin Storsjo | 107b548 | 2017-11-03 07:18:37 | [diff] [blame] | 66 | def Xlink : J<"Xlink=">, MetaVarName<"<arg>">, |
| 67 | HelpText<"Pass <arg> to the COFF linker">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 68 | |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 69 | // Alias |
| 70 | def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>; |
Martin Storsjo | 068512d | 2017-11-03 22:10:37 | [diff] [blame] | 71 | def alias_strip_s: Flag<["-"], "s">, Alias<strip_all>; |
Martin Storsjo | c082674 | 2018-06-29 06:08:31 | [diff] [blame] | 72 | def alias_strip_S: Flag<["-"], "S">, Alias<strip_debug>; |
Martin Storsjo | 5d1862b | 2019-01-29 08:38:48 | [diff] [blame] | 73 | |
| 74 | // Ignored options |
Martin Storsjo | d79a4b7 | 2019-01-29 19:24:32 | [diff] [blame] | 75 | def: Joined<["-"], "O">; |
| 76 | def: F<"build-id">; |
| 77 | def: F<"disable-auto-image-base">; |
| 78 | def: F<"enable-auto-image-base">; |
| 79 | def: F<"enable-auto-import">; |
| 80 | def: F<"end-group">; |
| 81 | def: Flag<["--"], "full-shutdown">; |
| 82 | def: F<"high-entropy-va">; |
| 83 | def: S<"major-image-version">; |
| 84 | def: S<"minor-image-version">; |
| 85 | def: F<"no-seh">; |
| 86 | def: F<"nxcompat">; |
| 87 | def: F<"pic-executable">; |
Martin Storsjo | 5d1862b | 2019-01-29 08:38:48 | [diff] [blame] | 88 | def: S<"plugin">; |
| 89 | def: J<"plugin=">; |
| 90 | def: S<"plugin-opt">; |
| 91 | def: J<"plugin-opt=">; |
Martin Storsjo | d79a4b7 | 2019-01-29 19:24:32 | [diff] [blame] | 92 | def: J<"sysroot">; |
| 93 | def: F<"start-group">; |
| 94 | def: F<"tsaware">; |