[PECOFF] Simplify WinLinkOptions.td.

llvm-svn: 191223
This commit is contained in:
Rui Ueyama 2013-09-23 20:36:39 +00:00
parent 02bdb16524
commit 2721aa4065
2 changed files with 17 additions and 20 deletions

View File

@ -409,7 +409,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
ctx.setDeadStripping(false);
break;
case OPT_no_nxcompat:
case OPT_nxcompat_no:
// handle /nxcompat:no
ctx.setNxCompat(false);
break;
@ -432,7 +432,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
ctx.setDynamicBaseEnabled(false);
break;
case OPT_no_dynamicbase:
case OPT_dynamicbase_no:
// handle /dynamicbase:no
ctx.setDynamicBaseEnabled(false);
break;
@ -442,7 +442,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
ctx.setTerminalServerAware(true);
break;
case OPT_no_tsaware:
case OPT_tsaware_no:
// handle /tsaware:no
ctx.setTerminalServerAware(false);
break;

View File

@ -2,13 +2,21 @@ 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>;
// Flag that takes one argument after ":".
multiclass P<string name, string help> {
def "" : Joined<["/", "-", "-?"], name#":">, HelpText<help>;
def _c : Separate<["/", "-", "-?"], name>, Alias<!cast<Option>(name)>;
}
// Boolean flag suffixed by ":no".
multiclass B<string name, string help> {
def "" : F<name>;
def _no : F<name#":no">, HelpText<help>;
}
defm base : P<"base", "Base address of the program">;
defm defaultlib : P<"defaultlib", "Add the library to the list of input files">;
defm entry : P<"entry", "Name of entry point symbol">;
@ -39,23 +47,12 @@ def ref : F<"opt:ref">;
def no_ref : F<"opt:noref">,
HelpText<"Keep unreferenced symbols to be included to the output">;
def nxcompat : F<"nxcompat">;
def no_nxcompat : F<"nxcompat:no">,
HelpText<"Disable data execution provention">;
def largeaddressaware : F<"largeaddressaware">;
def no_largeaddressaware : F<"largeaddressaware:no">,
HelpText<"Disable large addresses">;
def fixed : F<"fixed">;
def no_fixed : F<"fixed:no">, HelpText<"Enable base relocations">;
def dynamicbase : F<"dynamicbase">;
def no_dynamicbase : F<"dynamicbase:no">, HelpText<"Disable address space layout randomization">;
def tsaware : F<"tsaware">;
def no_tsaware : F<"tsaware:no">,
HelpText<"Create non-Terminal Server aware executable">;
defm nxcompat : B<"nxcompat", "Disable data execution provention">;
defm largeaddressaware : B<"largeaddressaware", "Disable large addresses">;
defm fixed : B<"fixed", "Enable base relocations">;
defm tsaware : B<"tsaware", "Create non-Terminal Server aware executable">;
defm dynamicbase : B<"dynamicbase",
"Disable address space layout randomization">;
def help : F<"help">;
def help_q : F<"?">, Alias<help>;