Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 1 | include "llvm/Option/OptParser.td" |
| 2 | |
| 3 | // link.exe accepts options starting with either a dash or a slash. |
| 4 | |
| 5 | // Flag that takes no arguments. |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 6 | class F<string name> : Flag<["/", "-", "/?", "-?"], name>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 7 | |
| 8 | // Flag that takes one argument after ":". |
| 9 | class P<string name, string help> : |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 10 | Joined<["/", "-", "/?", "-?"], name#":">, HelpText<help>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 11 | |
Martin Storsjö | 45c4c54 | 2020-10-03 22:29:45 | [diff] [blame] | 12 | // Same as P<> above, but without help texts, for private undocumented |
| 13 | // options. |
| 14 | class P_priv<string name> : |
| 15 | Joined<["/", "-", "/?", "-?"], name#":">; |
| 16 | |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 17 | // Boolean flag which can be suffixed by ":no". Using it unsuffixed turns the |
| 18 | // flag on and using it suffixed by ":no" turns it off. |
| 19 | multiclass B<string name, string help_on, string help_off> { |
| 20 | def "" : F<name>, HelpText<help_on>; |
| 21 | def _no : F<name#":no">, HelpText<help_off>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 22 | } |
| 23 | |
Martin Storsjö | 7f0e6c3 | 2020-04-25 21:49:44 | [diff] [blame] | 24 | // Same as B<> above, but without help texts, for private undocumented |
| 25 | // options. |
| 26 | multiclass B_priv<string name> { |
| 27 | def "" : F<name>; |
| 28 | def _no : F<name#":no">; |
| 29 | } |
| 30 | |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 31 | def align : P<"align", "Section alignment">; |
Martin Storsjo | d2752aa | 2017-08-14 19:07:27 | [diff] [blame] | 32 | def aligncomm : P<"aligncomm", "Set common symbol alignment">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 33 | def alternatename : P<"alternatename", "Define weak alias">; |
| 34 | def base : P<"base", "Base address of the program">; |
Nico Weber | cac2b33 | 2018-05-10 18:19:02 | [diff] [blame] | 35 | def color_diagnostics: Flag<["--"], "color-diagnostics">, |
Nico Weber | baa2aa2 | 2020-11-17 17:15:42 | [diff] [blame] | 36 | HelpText<"Alias for --color-diagnostics=always">; |
| 37 | def no_color_diagnostics: Flag<["--"], "no-color-diagnostics">, |
| 38 | HelpText<"Alias for --color-diagnostics=never">; |
Nico Weber | cac2b33 | 2018-05-10 18:19:02 | [diff] [blame] | 39 | def color_diagnostics_eq: Joined<["--"], "color-diagnostics=">, |
Nico Weber | baa2aa2 | 2020-11-17 17:15:42 | [diff] [blame] | 40 | HelpText<"Use colors in diagnostics (default: auto)">, |
| 41 | MetaVarName<"[auto,always,never]">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 42 | def defaultlib : P<"defaultlib", "Add the library to the list of input files">; |
| 43 | def delayload : P<"delayload", "Delay loaded DLL name">; |
Peter Kasting | c5fb05f | 2022-02-16 14:20:03 | [diff] [blame] | 44 | def diasdkdir : P<"diasdkdir", "Set the location of the DIA SDK">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 45 | def entry : P<"entry", "Name of entry point symbol">; |
Bob Haarman | ac8f7fc | 2017-04-05 00:43:54 | [diff] [blame] | 46 | def errorlimit : P<"errorlimit", |
| 47 | "Maximum number of errors to emit before stopping (0 = no limit)">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 48 | def export : P<"export", "Export a function">; |
| 49 | // No help text because /failifmismatch is not intended to be used by the user. |
| 50 | def failifmismatch : P<"failifmismatch", "">; |
Rui Ueyama | 74de620 | 2019-05-24 12:42:36 | [diff] [blame] | 51 | def filealign : P<"filealign", "Section alignment in the output file">; |
Alexandre Ganea | d307c4c | 2019-02-23 01:46:18 | [diff] [blame] | 52 | def functionpadmin : F<"functionpadmin">; |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 53 | def functionpadmin_opt : P<"functionpadmin", |
| 54 | "Prepares an image for hotpatching">; |
Reid Kleckner | af2f7da | 2018-02-06 01:58:26 | [diff] [blame] | 55 | def guard : P<"guard", "Control flow guard">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 56 | def heap : P<"heap", "Size of the heap">; |
Bob Haarman | e90ac01 | 2017-12-28 07:02:13 | [diff] [blame] | 57 | def ignore : P<"ignore", "Specify warning codes to ignore">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 58 | def implib : P<"implib", "Import library name">; |
Tobias Hieta | eb4eef9 | 2022-04-12 14:06:46 | [diff] [blame] | 59 | def noimplib : F<"noimplib">, |
| 60 | HelpText<"Don't output an import lib">; |
Nico Weber | c421fe5 | 2018-07-14 04:07:51 | [diff] [blame] | 61 | def lib : F<"lib">, |
| 62 | HelpText<"Act like lib.exe; must be first argument if present">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 63 | def libpath : P<"libpath", "Additional library search path">; |
Nico Weber | a0994cb | 2020-11-27 18:33:55 | [diff] [blame] | 64 | def linkrepro : Joined<["/", "-", "/?", "-?"], "linkrepro:">, |
| 65 | MetaVarName<"directory">, |
| 66 | HelpText<"Write repro.tar containing inputs and command to reproduce link">; |
Nico Weber | d48ea5d | 2019-09-13 13:13:52 | [diff] [blame] | 67 | def lldignoreenv : F<"lldignoreenv">, |
| 68 | HelpText<"Ignore environment variables like %LIB%">; |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 69 | def lldltocache : P<"lldltocache", |
| 70 | "Path to ThinLTO cached object file directory">; |
| 71 | def lldltocachepolicy : P<"lldltocachepolicy", |
| 72 | "Pruning policy for the ThinLTO cache">; |
Bob Haarman | 69b196d | 2017-02-08 18:36:41 | [diff] [blame] | 73 | def lldsavetemps : F<"lldsavetemps">, |
Sam Clegg | 299b0e5 | 2021-01-18 19:39:28 | [diff] [blame] | 74 | HelpText<"Save intermediate LTO compilation results">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 75 | def machine : P<"machine", "Specify target platform">; |
| 76 | def merge : P<"merge", "Combine sections">; |
| 77 | def mllvm : P<"mllvm", "Options to pass to LLVM">; |
| 78 | def nodefaultlib : P<"nodefaultlib", "Remove a default library">; |
| 79 | def opt : P<"opt", "Control optimizations">; |
Rui Ueyama | 57175aa | 2018-01-27 00:34:46 | [diff] [blame] | 80 | def order : P<"order", "Put functions in order">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 81 | def out : P<"out", "Path to file to write output">; |
Zachary Turner | f228276 | 2018-03-23 19:57:25 | [diff] [blame] | 82 | def natvis : P<"natvis", "Path to natvis file to embed in the PDB">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 83 | def pdb : P<"pdb", "PDB file path">; |
Peter Collingbourne | c8f5c05 | 2018-04-20 22:11:28 | [diff] [blame] | 84 | def pdbaltpath : P<"pdbaltpath", "PDB file path to embed in the image">; |
Nico Weber | f964ca8 | 2021-10-30 15:22:55 | [diff] [blame] | 85 | def pdbpagesize : P<"pdbpagesize", "PDB page size">; |
| 86 | def pdbstripped : P<"pdbstripped", "Stripped PDB file path">; |
Eric Astor | a39b14f | 2020-04-07 20:16:22 | [diff] [blame] | 87 | def pdbstream : Joined<["/", "-", "/?", "-?"], "pdbstream:">, |
| 88 | MetaVarName<"<name>=<file>">, |
| 89 | HelpText<"Embed the contents of <file> in the PDB as named stream <name>">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 90 | def section : P<"section", "Specify section attributes">; |
| 91 | def stack : P<"stack", "Size of the stack">; |
| 92 | def stub : P<"stub", "Specify DOS stub file">; |
| 93 | def subsystem : P<"subsystem", "Specify subsystem">; |
Zachary Turner | c8dd6cc | 2018-05-17 15:11:01 | [diff] [blame] | 94 | def timestamp : P<"timestamp", "Specify the PE header timestamp">; |
Peter Kasting | c5fb05f | 2022-02-16 14:20:03 | [diff] [blame] | 95 | def vctoolsdir : P<"vctoolsdir", "Set the location of the VC tools">; |
| 96 | def vctoolsversion : P<"vctoolsversion", |
| 97 | "Specify which VC tools version to use">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 98 | def version : P<"version", "Specify a version number in the PE header">; |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 99 | def wholearchive_file : P<"wholearchive", |
| 100 | "Include all object files from this library">; |
Peter Kasting | c5fb05f | 2022-02-16 14:20:03 | [diff] [blame] | 101 | def winsdkdir : P<"winsdkdir", "Set the location of the Windows SDK">; |
| 102 | def winsdkversion : P<"winsdkversion", "Specify which SDK version to use">; |
| 103 | def winsysroot : P<"winsysroot", |
| 104 | "Adds several subdirectories to the library search paths">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 105 | |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 106 | def disallowlib : Joined<["/", "-", "/?", "-?"], "disallowlib:">, |
| 107 | Alias<nodefaultlib>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 108 | |
Nico Weber | 64fb85c | 2019-01-09 19:18:03 | [diff] [blame] | 109 | def manifest : F<"manifest">, HelpText<"Create .manifest file">; |
| 110 | def manifest_colon : P< |
| 111 | "manifest", |
| 112 | "NO disables manifest output; EMBED[,ID=#] embeds manifest as resource in the image">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 113 | def manifestuac : P<"manifestuac", "User access control">; |
Nico Weber | 64fb85c | 2019-01-09 19:18:03 | [diff] [blame] | 114 | def manifestfile : P<"manifestfile", "Manifest output path, with /manifest">; |
| 115 | def manifestdependency : P< |
| 116 | "manifestdependency", |
| 117 | "Attributes for <dependency> element in manifest file; implies /manifest">; |
| 118 | def manifestinput : P< |
| 119 | "manifestinput", |
| 120 | "Additional manifest inputs; only valid with /manifest:embed">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 121 | |
| 122 | // We cannot use multiclass P because class name "incl" is different |
| 123 | // from its command line option name. We do this because "include" is |
| 124 | // a reserved keyword in tablegen. |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 125 | def incl : Joined<["/", "-", "/?", "-?"], "include:">, |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 126 | HelpText<"Force symbol to be added to symbol table as undefined one">; |
| 127 | |
| 128 | // "def" is also a keyword. |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 129 | def deffile : Joined<["/", "-", "/?", "-?"], "def:">, |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 130 | HelpText<"Use module-definition file">; |
| 131 | |
Reid Kleckner | 981576d | 2015-07-31 16:40:38 | [diff] [blame] | 132 | def debug : F<"debug">, HelpText<"Embed a symbol table in the image">; |
Will Wilson | 3cb1834 | 2018-09-24 15:28:03 | [diff] [blame] | 133 | def debug_opt : P<"debug", "Embed a symbol table in the image with option">; |
Saleem Abdulrasool | a2cca7e | 2016-08-08 22:02:44 | [diff] [blame] | 134 | def debugtype : P<"debugtype", "Debug Info Options">; |
Reid Kleckner | 981576d | 2015-07-31 16:40:38 | [diff] [blame] | 135 | def dll : F<"dll">, HelpText<"Create a DLL">; |
Rui Ueyama | f95ed69 | 2019-11-13 04:53:15 | [diff] [blame] | 136 | def driver : F<"driver">, HelpText<"Generate a Windows NT Kernel Mode Driver">; |
| 137 | def driver_wdm : F<"driver:wdm">, |
| 138 | HelpText<"Set IMAGE_FILE_UP_SYSTEM_ONLY bit in PE header">; |
| 139 | def driver_uponly : F<"driver:uponly">, |
| 140 | HelpText<"Set IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER bit in PE header">; |
| 141 | def driver_wdm_uponly : F<"driver:wdm,uponly">; |
| 142 | def driver_uponly_wdm : F<"driver:uponly,wdm">; |
Nico Weber | 64fb85c | 2019-01-09 19:18:03 | [diff] [blame] | 143 | def nodefaultlib_all : F<"nodefaultlib">, |
| 144 | HelpText<"Remove all default libraries">; |
| 145 | def noentry : F<"noentry">, |
| 146 | HelpText<"Don't add reference to DllMainCRTStartup; only valid with /dll">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 147 | def profile : F<"profile">; |
Nico Weber | 64fb85c | 2019-01-09 19:18:03 | [diff] [blame] | 148 | def repro : F<"Brepro">, |
| 149 | HelpText<"Use a hash of the executable as the PE header timestamp">; |
Nico Weber | a0994cb | 2020-11-27 18:33:55 | [diff] [blame] | 150 | def reproduce : Joined<["/", "-", "/?", "-?"], "reproduce:">, |
| 151 | MetaVarName<"filename">, |
| 152 | HelpText<"Write tar file containing inputs and command to reproduce link">; |
Nico Weber | c0838af | 2019-04-25 14:02:26 | [diff] [blame] | 153 | def swaprun : P<"swaprun", |
| 154 | "Comma-separated list of 'cd' or 'net'">; |
| 155 | def swaprun_cd : F<"swaprun:cd">, Alias<swaprun>, AliasArgs<["cd"]>, |
| 156 | HelpText<"Make loader run output binary from swap instead of from CD">; |
| 157 | def swaprun_net : F<"swaprun:net">, Alias<swaprun>, AliasArgs<["net"]>, |
| 158 | HelpText<"Make loader run output binary from swap instead of from network">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 159 | def verbose : F<"verbose">; |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 160 | def wholearchive_flag : F<"wholearchive">, |
| 161 | HelpText<"Include all object files from all libraries">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 162 | |
| 163 | def force : F<"force">, |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 164 | HelpText<"Allow undefined and multiply defined symbols">; |
Rui Ueyama | 11ca38f | 2018-09-13 22:05:10 | [diff] [blame] | 165 | def force_unresolved : F<"force:unresolved">, |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 166 | HelpText<"Allow undefined symbols when creating executables">; |
Rui Ueyama | 11ca38f | 2018-09-13 22:05:10 | [diff] [blame] | 167 | def force_multiple : F<"force:multiple">, |
| 168 | HelpText<"Allow multiply defined symbols when creating executables">; |
Nico Weber | 81862f8 | 2019-05-02 21:21:55 | [diff] [blame] | 169 | def force_multipleres : F<"force:multipleres">, |
| 170 | HelpText<"Allow multiply defined resources when creating executables">; |
Nico Weber | 75196b9 | 2022-04-11 15:01:34 | [diff] [blame] | 171 | defm WX : B<"WX", "Treat warnings as errors", |
| 172 | "Don't treat warnings as errors (default)">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 173 | |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 174 | defm allowbind : B<"allowbind", "Enable DLL binding (default)", |
| 175 | "Disable DLL binding">; |
| 176 | defm allowisolation : B<"allowisolation", "Enable DLL isolation (default)", |
| 177 | "Disable DLL isolation">; |
Saleem Abdulrasool | 671029d | 2017-04-06 23:07:53 | [diff] [blame] | 178 | defm appcontainer : B<"appcontainer", |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 179 | "Image can only be run in an app container", |
| 180 | "Image can run outside an app container (default)">; |
Rui Ueyama | a2923b2 | 2020-03-13 10:41:18 | [diff] [blame] | 181 | defm cetcompat : B<"cetcompat", "Mark executable image as compatible with Control-flow Enforcement Technology (CET) Shadow Stack", |
| 182 | "Don't mark executable image as compatible with Control-flow Enforcement Technology (CET) Shadow Stack (default)">; |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 183 | defm dynamicbase : B<"dynamicbase", "Enable ASLR (default unless /fixed)", |
| 184 | "Disable ASLR (default when /fixed)">; |
| 185 | defm fixed : B<"fixed", "Disable base relocations", |
| 186 | "Enable base relocations (default)">; |
| 187 | defm highentropyva : B<"highentropyva", |
| 188 | "Enable 64-bit ASLR (default on 64-bit)", |
| 189 | "Disable 64-bit ASLR">; |
Bob Haarman | 5ec4485 | 2018-01-31 23:44:00 | [diff] [blame] | 190 | defm incremental : B<"incremental", |
| 191 | "Keep original import library if contents are unchanged", |
Nico Weber | d657c25 | 2018-05-31 13:43:02 | [diff] [blame] | 192 | "Overwrite import library even if contents are unchanged">; |
| 193 | defm integritycheck : B<"integritycheck", |
| 194 | "Set FORCE_INTEGRITY bit in PE header", |
| 195 | "No effect (default)">; |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 196 | defm largeaddressaware : B<"largeaddressaware", |
| 197 | "Enable large addresses (default on 64-bit)", |
| 198 | "Disable large addresses (default on 32-bit)">; |
| 199 | defm nxcompat : B<"nxcompat", "Enable data execution prevention (default)", |
| 200 | "Disable data execution provention">; |
| 201 | defm safeseh : B<"safeseh", |
| 202 | "Produce an image with Safe Exception Handler (only for x86)", |
| 203 | "Don't produce an image with Safe Exception Handler">; |
| 204 | defm tsaware : B<"tsaware", |
| 205 | "Create Terminal Server aware executable (default)", |
| 206 | "Create non-Terminal Server aware executable">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 207 | |
| 208 | def help : F<"help">; |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 209 | |
| 210 | // /?? and -?? must be before /? and -? to not confuse lib/Options. |
| 211 | def help_q : Flag<["/??", "-??", "/?", "-?"], "">, Alias<help>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 212 | |
Rui Ueyama | 9640173 | 2015-09-21 23:43:31 | [diff] [blame] | 213 | // LLD extensions |
Martin Storsjö | 7f0e6c3 | 2020-04-25 21:49:44 | [diff] [blame] | 214 | defm auto_import : B_priv<"auto-import">; |
| 215 | defm runtime_pseudo_reloc : B_priv<"runtime-pseudo-reloc">; |
Bob Haarman | 7dc5e7a0 | 2019-09-03 20:32:16 | [diff] [blame] | 216 | def end_lib : F<"end-lib">, |
Nico Weber | a0994cb | 2020-11-27 18:33:55 | [diff] [blame] | 217 | HelpText<"End group of objects treated as if they were in a library">; |
Martin Storsjo | 272d8c1 | 2019-02-19 21:57:44 | [diff] [blame] | 218 | def exclude_all_symbols : F<"exclude-all-symbols">; |
Martin Storsjo | 7f71acd | 2017-10-12 05:37:13 | [diff] [blame] | 219 | def export_all_symbols : F<"export-all-symbols">; |
Nico Weber | 020d92c | 2019-03-11 23:02:18 | [diff] [blame] | 220 | defm demangle : B<"demangle", |
| 221 | "Demangle symbols in output (default)", |
| 222 | "Do not demangle symbols in output">; |
Martin Storsjo | c02f6bf | 2019-06-08 18:26:18 | [diff] [blame] | 223 | def include_optional : Joined<["/", "-", "/?", "-?"], "includeoptional:">, |
| 224 | HelpText<"Add symbol as undefined, but allow it to remain undefined">; |
Martin Storsjo | 5351891 | 2018-03-14 20:17:16 | [diff] [blame] | 225 | def kill_at : F<"kill-at">; |
Martin Storsjo | 31fe4cd | 2017-09-13 19:29:39 | [diff] [blame] | 226 | def lldmingw : F<"lldmingw">; |
Martin Storsjö | 745eb02 | 2020-07-27 20:44:41 | [diff] [blame] | 227 | def noseh : F<"noseh">; |
Martin Storsjö | 45c4c54 | 2020-10-03 22:29:45 | [diff] [blame] | 228 | def osversion : P_priv<"osversion">; |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 229 | def output_def : Joined<["/", "-", "/?", "-?"], "output-def:">; |
Takuto Ikuta | d855928 | 2018-07-19 04:56:22 | [diff] [blame] | 230 | def pdb_source_path : P<"pdbsourcepath", |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 231 | "Base path used to make relative source file path absolute in PDB">; |
Nico Weber | a05cbb8 | 2017-09-05 23:46:45 | [diff] [blame] | 232 | def rsp_quoting : Joined<["--"], "rsp-quoting=">, |
| 233 | HelpText<"Quoting style for response files, 'windows' (default) or 'posix'">; |
Bob Haarman | 7dc5e7a0 | 2019-09-03 20:32:16 | [diff] [blame] | 234 | def start_lib : F<"start-lib">, |
Nico Weber | a0994cb | 2020-11-27 18:33:55 | [diff] [blame] | 235 | HelpText<"Start group of objects treated as if they were in a library">; |
Martin Storsjö | ce211c5 | 2021-06-17 18:51:37 | [diff] [blame] | 236 | defm stdcall_fixup : B_priv<"stdcall-fixup">; |
Bob Haarman | 63efb28 | 2019-07-11 18:03:14 | [diff] [blame] | 237 | def thinlto_emit_imports_files : |
| 238 | F<"thinlto-emit-imports-files">, |
| 239 | HelpText<"Emit .imports files with -thinlto-index-only">; |
| 240 | def thinlto_index_only : |
| 241 | F<"thinlto-index-only">, |
| 242 | HelpText<"Instead of linking, emit ThinLTO index files">; |
| 243 | def thinlto_index_only_arg : P< |
| 244 | "thinlto-index-only", |
| 245 | "-thinlto-index-only and also write native module names to file">; |
Bob Haarman | 5011b83 | 2019-07-11 18:48:58 | [diff] [blame] | 246 | def thinlto_object_suffix_replace : P< |
| 247 | "thinlto-object-suffix-replace", |
| 248 | "'old;new' replace old suffix with new suffix in ThinLTO index">; |
| 249 | def thinlto_prefix_replace: P< |
| 250 | "thinlto-prefix-replace", |
| 251 | "'old;new' replace old prefix with new prefix in ThinLTO outputs">; |
Bob Haarman | 5375b94 | 2019-08-21 18:24:59 | [diff] [blame] | 252 | def lto_obj_path : P< |
| 253 | "lto-obj-path", |
| 254 | "output native object for merged LTO unit to this path">; |
Yolanda Chen | 4f9c61e | 2021-03-25 02:55:18 | [diff] [blame] | 255 | def lto_cs_profile_generate: F<"lto-cs-profile-generate">, |
| 256 | HelpText<"Perform context sensitive PGO instrumentation">; |
| 257 | def lto_cs_profile_file : P<"lto-cs-profile-file", |
| 258 | "Context sensitive profile file path">; |
Yolanda Chen | 8fa16cc | 2021-08-11 16:45:55 | [diff] [blame] | 259 | defm lto_pgo_warn_mismatch: B< |
| 260 | "lto-pgo-warn-mismatch", |
| 261 | "turn on warnings about profile cfg mismatch (default)>", |
| 262 | "turn off warnings about profile cfg mismatch">; |
Rui Ueyama | a4cf97b | 2017-10-23 14:57:53 | [diff] [blame] | 263 | def dash_dash_version : Flag<["--"], "version">, |
Nico Weber | 77fb45e | 2020-12-22 20:51:20 | [diff] [blame] | 264 | HelpText<"Display the version number and exit">; |
Fangrui Song | eb4663d | 2020-03-17 19:40:19 | [diff] [blame] | 265 | def threads |
| 266 | : P<"threads", "Number of threads. '1' disables multi-threading. By " |
| 267 | "default all available hardware threads are used">; |
Zequan Wu | 763671f | 2020-07-21 20:46:11 | [diff] [blame] | 268 | def call_graph_ordering_file: P< |
Tobias Hieta | 2af4385 | 2022-04-12 11:59:45 | [diff] [blame] | 269 | "call-graph-ordering-file", |
Zequan Wu | 763671f | 2020-07-21 20:46:11 | [diff] [blame] | 270 | "Layout sections to optimize the given callgraph">; |
| 271 | defm call_graph_profile_sort: B< |
| 272 | "call-graph-profile-sort", |
| 273 | "Reorder sections with call graph profile (default)", |
| 274 | "Do not reorder sections with call graph profile">; |
| 275 | def print_symbol_order: P< |
| 276 | "print-symbol-order", |
| 277 | "Print a symbol order specified by /call-graph-ordering-file and " |
| 278 | "/call-graph-profile-sort into the specified file">; |
Martin Storsjö | 3785a41 | 2020-10-06 10:54:49 | [diff] [blame] | 279 | def wrap : P_priv<"wrap">; |
Rui Ueyama | 9640173 | 2015-09-21 23:43:31 | [diff] [blame] | 280 | |
Peter Collingbourne | be54955 | 2015-06-26 18:58:24 | [diff] [blame] | 281 | // Flags for debugging |
Hans Wennborg | 1818e65 | 2016-12-09 20:54:44 | [diff] [blame] | 282 | def lldmap : F<"lldmap">; |
Nico Weber | 66dc44f | 2021-08-27 02:01:00 | [diff] [blame] | 283 | def lldmap_file : P_priv<"lldmap">; |
Sylvain Audi | b91905a | 2020-03-23 21:06:48 | [diff] [blame] | 284 | def map : F<"map">; |
Nico Weber | 66dc44f | 2021-08-27 02:01:00 | [diff] [blame] | 285 | def map_file : P_priv<"map">; |
Zachary Turner | 727f153 | 2018-01-17 19:16:26 | [diff] [blame] | 286 | def show_timing : F<"time">; |
Alexandre Ganea | 3e60ee9 | 2019-03-14 18:45:08 | [diff] [blame] | 287 | def summary : F<"summary">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 288 | |
| 289 | //============================================================================== |
| 290 | // The flags below do nothing. They are defined only for link.exe compatibility. |
| 291 | //============================================================================== |
| 292 | |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 293 | def ignoreidl : F<"ignoreidl">; |
Nico Weber | 34ac7a7 | 2021-08-27 02:03:26 | [diff] [blame] | 294 | def ltcg : F<"ltcg">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 295 | def nologo : F<"nologo">; |
Rui Ueyama | 43238317 | 2015-07-29 21:01:15 | [diff] [blame] | 296 | def throwingnew : F<"throwingnew">; |
Rui Ueyama | 3c4737d | 2015-08-11 16:46:08 | [diff] [blame] | 297 | def editandcontinue : F<"editandcontinue">; |
Reid Kleckner | 9cd77ce | 2016-03-25 18:09:29 | [diff] [blame] | 298 | def fastfail : F<"fastfail">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 299 | |
Nico Weber | 66dc44f | 2021-08-27 02:01:00 | [diff] [blame] | 300 | def delay : P_priv<"delay">; |
| 301 | def errorreport : P_priv<"errorreport">; |
| 302 | def idlout : P_priv<"idlout">; |
Nico Weber | 34ac7a7 | 2021-08-27 02:03:26 | [diff] [blame] | 303 | def ilk : P_priv<"ilk">; |
| 304 | def ltcg_opt : P_priv<"ltcg">; |
| 305 | def ltcgout : P_priv<"ltcgout">; |
Nico Weber | 66dc44f | 2021-08-27 02:01:00 | [diff] [blame] | 306 | def maxilksize : P_priv<"maxilksize">; |
| 307 | def tlbid : P_priv<"tlbid">; |
| 308 | def tlbout : P_priv<"tlbout">; |
| 309 | def verbose_all : P_priv<"verbose">; |
| 310 | def guardsym : P_priv<"guardsym">; |