Index: lld/trunk/MinGW/Options.td =================================================================== --- lld/trunk/MinGW/Options.td +++ lld/trunk/MinGW/Options.td @@ -4,6 +4,18 @@ class J: Joined<["--", "-"], name>; class S: Separate<["--", "-"], name>; +multiclass Eq { + def NAME: Separate<["--", "-"], name>; + def NAME # _eq: Joined<["--", "-"], name # "=">, Alias(NAME)>, + HelpText; +} + +multiclass EqLong { + def NAME: Separate<["--"], name>; + def NAME # _eq: Joined<["--"], name # "=">, Alias(NAME)>, + HelpText; +} + def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"">, HelpText<"Add a directory to the library search path">; def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">; @@ -25,24 +37,15 @@ def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"">, HelpText<"Root name of library to use">; def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">; -def major_os_version: Separate<["--"], "major-os-version">, - HelpText<"Set the OS and subsystem major version">; -def major_os_version_eq: Joined<["--"], "major-os-version=">, - Alias; -def major_subsystem_version: Separate<["--"], "major-subsystem-version">, - HelpText<"Set the OS and subsystem major version">; -def major_subsystem_version_eq: Joined<["--"], "major-subsystem-version=">, - Alias; -def map: S<"Map">, HelpText<"Output a linker map">; -def map_eq: J<"Map=">, Alias; -def minor_os_version: Separate<["--"], "minor-os-version">, - HelpText<"Set the OS and subsystem minor version">; -def minor_os_version_eq: Joined<["--"], "minor-os-version=">, - Alias; -def minor_subsystem_version: Separate<["--"], "minor-subsystem-version">, - HelpText<"Set the OS and subsystem minor version">; -def minor_subsystem_version_eq: Joined<["--"], "minor-subsystem-version=">, - Alias; +defm major_os_version: EqLong<"major-os-version", + "Set the OS and subsystem major version">; +defm major_subsystem_version: EqLong<"major-subsystem-version", + "Set the OS and subsystem major version">; +defm map: Eq<"Map", "Output a linker map">; +defm minor_os_version: EqLong<"minor-os-version", + "Set the OS and subsystem minor version">; +defm minor_subsystem_version: EqLong<"minor-subsystem-version", + "Set the OS and subsystem minor version">; def no_insert_timestamp: F<"no-insert-timestamp">, HelpText<"Don't include PE header timestamp">; def no_whole_archive: F<"no-whole-archive">, @@ -52,39 +55,31 @@ def no_gc_sections: F<"no-gc-sections">, HelpText<"Don't remove unused sections">; def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"">, HelpText<"Path to file to write output">; -def out_implib: Separate<["--"], "out-implib">, HelpText<"Import library name">; -def out_implib_eq: Joined<["--"], "out-implib=">, Alias; +defm out_implib: EqLong<"out-implib", "Import library name">; def output_def: S<"output-def">, HelpText<"Output def file">; def shared: F<"shared">, HelpText<"Build a shared object">; -def subs: S<"subsystem">, HelpText<"Specify subsystem">; -def subs_eq: J<"subsystem=">, Alias; +defm subs: Eq<"subsystem", "Specify subsystem">; def stack: S<"stack">; def strip_all: F<"strip-all">, HelpText<"Omit all symbol information from the output binary">; def strip_debug: F<"strip-debug">, HelpText<"Omit all debug information, but keep symbol information">; -def undefined: S<"u">, - HelpText<"Include symbol in the link, if available">; -def undefined_long: S<"undefined">, Alias; -def undefined_eq: J<"undefined=">, Alias; +defm undefined: Eq<"undefined", "Include symbol in the link, if available">; def whole_archive: F<"whole-archive">, HelpText<"Include all object files for following archives">; def v: Flag<["-"], "v">, HelpText<"Display the version number">; def verbose: F<"verbose">, HelpText<"Verbose mode">; def version: F<"version">, HelpText<"Display the version number and exit">; -def require_defined: S<"require-defined">, - HelpText<"Force symbol to be added to symbol table as an undefined one">; -def require_defined_eq: J<"require-defined=">, Alias; +defm require_defined: Eq<"require-defined", + "Force symbol to be added to symbol table as an undefined one">; // LLD specific options def _HASH_HASH_HASH : Flag<["-"], "###">, HelpText<"Print (but do not run) the commands to run for this compilation">; def appcontainer: F<"appcontainer">, HelpText<"Set the appcontainer flag in the executable">; -def delayload: S<"delayload">, HelpText<"DLL to load only on demand">; -def delayload_eq: J<"delayload=">, Alias; +defm delayload: Eq<"delayload", "DLL to load only on demand">; def mllvm: S<"mllvm">; -def pdb: S<"pdb">, HelpText<"Output PDB debug info file, chosen implicitly if the argument is empty">; -def pdb_eq: J<"pdb=">, Alias; +defm pdb: Eq<"pdb", "Output PDB debug info file, chosen implicitly if the argument is empty">; def Xlink : J<"Xlink=">, MetaVarName<"">, HelpText<"Pass to the COFF linker">; @@ -92,6 +87,7 @@ def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias; def alias_strip_s: Flag<["-"], "s">, Alias; def alias_strip_S: Flag<["-"], "S">, Alias; +def alias_undefined_u: S<"u">, Alias; // Ignored options def: Joined<["-"], "O">;