@@ -3,11 +3,11 @@ include "llvm/Option/OptParser.td"
3
3
// link.exe accepts options starting with either a dash or a slash.
4
4
5
5
// Flag that takes no arguments.
6
- class F<string name> : Flag<["/", "-", "-?"], name>;
6
+ class F<string name> : Flag<["/", "-", "/?", " -?"], name>;
7
7
8
8
// Flag that takes one argument after ":".
9
9
class P<string name, string help> :
10
- Joined<["/", "-", "-?"], name#":">, HelpText<help>;
10
+ Joined<["/", "-", "/?", " -?"], name#":">, HelpText<help>;
11
11
12
12
// Boolean flag which can be suffixed by ":no". Using it unsuffixed turns the
13
13
// flag on and using it suffixed by ":no" turns it off.
@@ -66,7 +66,8 @@ def timestamp : P<"timestamp", "Specify the PE header timestamp">;
66
66
def version : P<"version", "Specify a version number in the PE header">;
67
67
def wholearchive_file : P<"wholearchive", "Include all object files from this archive">;
68
68
69
- def disallowlib : Joined<["/", "-", "-?"], "disallowlib:">, Alias<nodefaultlib>;
69
+ def disallowlib : Joined<["/", "-", "/?", "-?"], "disallowlib:">,
70
+ Alias<nodefaultlib>;
70
71
71
72
def manifest : F<"manifest">, HelpText<"Create .manifest file">;
72
73
def manifest_colon : P<
@@ -84,11 +85,11 @@ def manifestinput : P<
84
85
// We cannot use multiclass P because class name "incl" is different
85
86
// from its command line option name. We do this because "include" is
86
87
// a reserved keyword in tablegen.
87
- def incl : Joined<["/", "-"], "include:">,
88
+ def incl : Joined<["/", "-", "/?", "-?" ], "include:">,
88
89
HelpText<"Force symbol to be added to symbol table as undefined one">;
89
90
90
91
// "def" is also a keyword.
91
- def deffile : Joined<["/", "-"], "def:">,
92
+ def deffile : Joined<["/", "-", "/?", "-?" ], "def:">,
92
93
HelpText<"Use module-definition file">;
93
94
94
95
def debug : F<"debug">, HelpText<"Embed a symbol table in the image">;
@@ -155,7 +156,9 @@ defm tsaware : B<"tsaware",
155
156
"Create non-Terminal Server aware executable">;
156
157
157
158
def help : F<"help">;
158
- def help_q : Flag<["/?", "-?"], "">, Alias<help>;
159
+
160
+ // /?? and -?? must be before /? and -? to not confuse lib/Options.
161
+ def help_q : Flag<["/??", "-??", "/?", "-?"], "">, Alias<help>;
159
162
160
163
// LLD extensions
161
164
def exclude_all_symbols : F<"exclude-all-symbols">;
@@ -165,7 +168,7 @@ defm demangle : B<"demangle",
165
168
"Do not demangle symbols in output">;
166
169
def kill_at : F<"kill-at">;
167
170
def lldmingw : F<"lldmingw">;
168
- def output_def : Joined<["/", "-"], "output-def:">;
171
+ def output_def : Joined<["/", "-", "/?", "-?" ], "output-def:">;
169
172
def pdb_source_path : P<"pdbsourcepath",
170
173
"Base path used to make relative source file path absolute in PDB">;
171
174
def rsp_quoting : Joined<["--"], "rsp-quoting=">,
@@ -178,15 +181,15 @@ defm threads: B<"threads",
178
181
179
182
// Flags for debugging
180
183
def lldmap : F<"lldmap">;
181
- def lldmap_file : Joined<["/", "-"], "lldmap:">;
184
+ def lldmap_file : Joined<["/", "-", "/?", "-?" ], "lldmap:">;
182
185
def show_timing : F<"time">;
183
186
def summary : F<"summary">;
184
187
185
188
//==============================================================================
186
189
// The flags below do nothing. They are defined only for link.exe compatibility.
187
190
//==============================================================================
188
191
189
- class QF<string name> : Joined<["/", "-", "-?"], name#":">;
192
+ class QF<string name> : Joined<["/", "-", "/?", " -?"], name#":">;
190
193
191
194
def ignoreidl : F<"ignoreidl">;
192
195
def nologo : F<"nologo">;
0 commit comments