summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-05-07 14:15:35 +0000
committerNico Weber <nicolasweber@gmx.de>2019-05-07 14:15:35 +0000
commit4b81e9f8d10214fbb2c8e1a367a60801a5dd5fed (patch)
treeffcad778921675a9ed3727bff153d41d1221f11b
parent07298c9b1eed0afa7362801b091c134148dcfd1e (diff)
downloadbcm5719-llvm-4b81e9f8d10214fbb2c8e1a367a60801a5dd5fed.tar.gz
bcm5719-llvm-4b81e9f8d10214fbb2c8e1a367a60801a5dd5fed.zip
lld-link: Allow /? as option prefix, like -? is allowed
link.exe seems to allow `/?foo` and `-?foo` in addition to `/foo` and `-foo`. Since lld-link already supports the `-?foo` spelling, support `/?foo` as well. Differential Revision: https://reviews.llvm.org/D61375 llvm-svn: 360150
-rw-r--r--lld/COFF/Options.td21
1 files changed, 12 insertions, 9 deletions
diff --git a/lld/COFF/Options.td b/lld/COFF/Options.td
index e7dd1ac4823..d87183c7e80 100644
--- a/lld/COFF/Options.td
+++ b/lld/COFF/Options.td
@@ -3,11 +3,11 @@ include "llvm/Option/OptParser.td"
// link.exe accepts options starting with either a dash or a slash.
// Flag that takes no arguments.
-class F<string name> : Flag<["/", "-", "-?"], name>;
+class F<string name> : Flag<["/", "-", "/?", "-?"], name>;
// Flag that takes one argument after ":".
class P<string name, string help> :
- Joined<["/", "-", "-?"], name#":">, HelpText<help>;
+ Joined<["/", "-", "/?", "-?"], name#":">, HelpText<help>;
// Boolean flag which can be suffixed by ":no". Using it unsuffixed turns the
// flag on and using it suffixed by ":no" turns it off.
@@ -66,7 +66,8 @@ def timestamp : P<"timestamp", "Specify the PE header timestamp">;
def version : P<"version", "Specify a version number in the PE header">;
def wholearchive_file : P<"wholearchive", "Include all object files from this archive">;
-def disallowlib : Joined<["/", "-", "-?"], "disallowlib:">, Alias<nodefaultlib>;
+def disallowlib : Joined<["/", "-", "/?", "-?"], "disallowlib:">,
+ Alias<nodefaultlib>;
def manifest : F<"manifest">, HelpText<"Create .manifest file">;
def manifest_colon : P<
@@ -84,11 +85,11 @@ def manifestinput : P<
// We cannot use multiclass P because class name "incl" is different
// from its command line option name. We do this because "include" is
// a reserved keyword in tablegen.
-def incl : Joined<["/", "-"], "include:">,
+def incl : Joined<["/", "-", "/?", "-?"], "include:">,
HelpText<"Force symbol to be added to symbol table as undefined one">;
// "def" is also a keyword.
-def deffile : Joined<["/", "-"], "def:">,
+def deffile : Joined<["/", "-", "/?", "-?"], "def:">,
HelpText<"Use module-definition file">;
def debug : F<"debug">, HelpText<"Embed a symbol table in the image">;
@@ -155,7 +156,9 @@ defm tsaware : B<"tsaware",
"Create non-Terminal Server aware executable">;
def help : F<"help">;
-def help_q : Flag<["/?", "-?"], "">, Alias<help>;
+
+// /?? and -?? must be before /? and -? to not confuse lib/Options.
+def help_q : Flag<["/??", "-??", "/?", "-?"], "">, Alias<help>;
// LLD extensions
def exclude_all_symbols : F<"exclude-all-symbols">;
@@ -165,7 +168,7 @@ defm demangle : B<"demangle",
"Do not demangle symbols in output">;
def kill_at : F<"kill-at">;
def lldmingw : F<"lldmingw">;
-def output_def : Joined<["/", "-"], "output-def:">;
+def output_def : Joined<["/", "-", "/?", "-?"], "output-def:">;
def pdb_source_path : P<"pdbsourcepath",
"Base path used to make relative source file path absolute in PDB">;
def rsp_quoting : Joined<["--"], "rsp-quoting=">,
@@ -178,7 +181,7 @@ defm threads: B<"threads",
// Flags for debugging
def lldmap : F<"lldmap">;
-def lldmap_file : Joined<["/", "-"], "lldmap:">;
+def lldmap_file : Joined<["/", "-", "/?", "-?"], "lldmap:">;
def show_timing : F<"time">;
def summary : F<"summary">;
@@ -186,7 +189,7 @@ def summary : F<"summary">;
// The flags below do nothing. They are defined only for link.exe compatibility.
//==============================================================================
-class QF<string name> : Joined<["/", "-", "-?"], name#":">;
+class QF<string name> : Joined<["/", "-", "/?", "-?"], name#":">;
def ignoreidl : F<"ignoreidl">;
def nologo : F<"nologo">;
OpenPOWER on IntegriCloud