diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td --- a/lld/MinGW/Options.td +++ b/lld/MinGW/Options.td @@ -16,6 +16,11 @@ HelpText; } +multiclass EqNoHelp { + def NAME: Separate<["--", "-"], name>; + def NAME # _eq: Joined<["--", "-"], name # "=">, Alias(NAME)>; +} + multiclass B { def NAME: Flag<["--", "-"], name>, HelpText; def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText; @@ -57,8 +62,8 @@ "Remove unused sections", "Don't remove unused sections">; def help: F<"help">, HelpText<"Print option help">; -def icf: J<"icf=">, HelpText<"Identical code folding">; -def image_base: S<"image-base">, HelpText<"Base address of the program">; +defm icf: Eq<"icf", "Identical code folding">; +defm image_base: Eq<"image-base", "Base address of the program">; defm insert_timestamp: B<"insert-timestamp", "Include PE header timestamp", "Don't include PE header timestamp">; @@ -109,12 +114,11 @@ 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">; defm delayload: Eq<"delayload", "DLL to load only on demand">; -def mllvm: S<"mllvm">; +defm mllvm: EqNoHelp<"mllvm">; defm pdb: Eq<"pdb", "Output PDB debug info file, chosen implicitly if the argument is empty">; defm thinlto_cache_dir: EqLong<"thinlto-cache-dir", "Path to ThinLTO cached object file directory">; -def Xlink : J<"Xlink=">, MetaVarName<"">, - HelpText<"Pass to the COFF linker">; +defm Xlink : Eq<"Xlink", "Pass to the COFF linker">, MetaVarName<"">; // Alias def alias_Bdynamic_call_shared: Flag<["-"], "call_shared">, Alias; @@ -135,15 +139,13 @@ def: F<"end-group">; def: Flag<["--"], "full-shutdown">; def: F<"high-entropy-va">; -def: S<"major-image-version">; -def: S<"minor-image-version">; +defm: EqNoHelp<"major-image-version">; +defm: EqNoHelp<"minor-image-version">; def: F<"no-undefined">; def: F<"nxcompat">; def: F<"pic-executable">; -def: S<"plugin">; -def: J<"plugin=">; -def: S<"plugin-opt">; -def: J<"plugin-opt=">; -def: J<"sysroot">; +defm: EqNoHelp<"plugin">; +defm: EqNoHelp<"plugin-opt">; +defm: EqNoHelp<"sysroot">; def: F<"start-group">; def: F<"tsaware">; diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test --- a/lld/test/MinGW/driver.test +++ b/lld/test/MinGW/driver.test @@ -161,6 +161,7 @@ RUN: ld.lld -### -m i386pep foo.o --image-base 0x1230000 2>&1 | FileCheck -check-prefix IMAGE-BASE %s RUN: ld.lld -### -m i386pep foo.o -image-base 0x1230000 2>&1 | FileCheck -check-prefix IMAGE-BASE %s +RUN: ld.lld -### -m i386pep foo.o --image-base=0x1230000 2>&1 | FileCheck -check-prefix IMAGE-BASE %s IMAGE-BASE: -base:0x1230000 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix NO-GC-SECTIONS %s @@ -180,6 +181,7 @@ RUN: ld.lld -### -m i386pep foo.o --icf=all 2>&1 | FileCheck -check-prefix ICF %s RUN: ld.lld -### -m i386pep foo.o -icf=all 2>&1 | FileCheck -check-prefix ICF %s +RUN: ld.lld -### -m i386pep foo.o --icf all 2>&1 | FileCheck -check-prefix ICF %s ICF: -opt:icf RUN: ld.lld -### -m i386pep --start-group foo.o --end-group 2> /dev/null