Skip to content
Snippets Groups Projects
Commit a7bcad46 authored by Rui Ueyama's avatar Rui Ueyama
Browse files

[PECOFF] Remove redundant comments.

llvm-svn: 191270
parent c583d17a
No related branches found
No related tags found
No related merge requests found
...@@ -309,9 +309,9 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -309,9 +309,9 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
case OPT_base: case OPT_base:
// Parse /base command line option. The argument for the parameter is in // Parse /base command line option. The argument for the parameter is in
// the // the form of "<address>[:<size>]".
// form of "<address>[:<size>]".
uint64_t addr, size; uint64_t addr, size;
// Size should be set to SizeOfImage field in the COFF header, and if // Size should be set to SizeOfImage field in the COFF header, and if
// it's smaller than the actual size, the linker should warn about that. // it's smaller than the actual size, the linker should warn about that.
// Currently we just ignore the value of size parameter. // Currently we just ignore the value of size parameter.
...@@ -319,6 +319,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -319,6 +319,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
return true; return true;
ctx.setBaseAddress(addr); ctx.setBaseAddress(addr);
break; break;
case OPT_stack: { case OPT_stack: {
// Parse /stack command line option // Parse /stack command line option
uint64_t reserve; uint64_t reserve;
...@@ -329,6 +330,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -329,6 +330,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
ctx.setStackCommit(commit); ctx.setStackCommit(commit);
break; break;
} }
case OPT_heap: { case OPT_heap: {
// Parse /heap command line option // Parse /heap command line option
uint64_t reserve; uint64_t reserve;
...@@ -339,6 +341,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -339,6 +341,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
ctx.setHeapCommit(commit); ctx.setHeapCommit(commit);
break; break;
} }
case OPT_align: { case OPT_align: {
uint32_t align; uint32_t align;
StringRef arg = inputArg->getValue(); StringRef arg = inputArg->getValue();
...@@ -349,6 +352,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -349,6 +352,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
ctx.setSectionAlignment(align); ctx.setSectionAlignment(align);
break; break;
} }
case OPT_machine: { case OPT_machine: {
StringRef arg = inputArg->getValue(); StringRef arg = inputArg->getValue();
llvm::COFF::MachineTypes type = stringToMachineType(arg); llvm::COFF::MachineTypes type = stringToMachineType(arg);
...@@ -359,6 +363,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -359,6 +363,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
ctx.setMachineType(type); ctx.setMachineType(type);
break; break;
} }
case OPT_version: { case OPT_version: {
uint32_t major, minor; uint32_t major, minor;
if (parseVersion(inputArg->getValue(), major, minor)) if (parseVersion(inputArg->getValue(), major, minor))
...@@ -366,6 +371,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -366,6 +371,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
ctx.setImageVersion(PECOFFLinkingContext::Version(major, minor)); ctx.setImageVersion(PECOFFLinkingContext::Version(major, minor));
break; break;
} }
case OPT_subsystem: { case OPT_subsystem: {
// Parse /subsystem command line option. The form of /subsystem is // Parse /subsystem command line option. The form of /subsystem is
// "subsystem_name[,majorOSVersion[.minorOSVersion]]". // "subsystem_name[,majorOSVersion[.minorOSVersion]]".
...@@ -397,12 +403,10 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -397,12 +403,10 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
break; break;
case OPT_entry: case OPT_entry:
// handle /entry
ctx.setEntrySymbolName(ctx.allocateString(inputArg->getValue())); ctx.setEntrySymbolName(ctx.allocateString(inputArg->getValue()));
break; break;
case OPT_libpath: case OPT_libpath:
// handle /libpath
ctx.appendInputSearchPath(ctx.allocateString(inputArg->getValue())); ctx.appendInputSearchPath(ctx.allocateString(inputArg->getValue()));
break; break;
...@@ -414,90 +418,75 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct ...@@ -414,90 +418,75 @@ bool WinLinkDriver::parse(int argc, const char *argv[], PECOFFLinkingContext &ct
case OPT_force: case OPT_force:
case OPT_force_unresolved: case OPT_force_unresolved:
// handle /force or /force:unresolved. We do not currently support // /force and /force:unresolved mean the same thing. We do not currently
// /force:multiple. // support /force:multiple.
ctx.setAllowRemainingUndefines(true); ctx.setAllowRemainingUndefines(true);
break; break;
case OPT_no_ref: case OPT_no_ref:
// Handle /opt:noref
ctx.setDeadStripping(false); ctx.setDeadStripping(false);
break; break;
case OPT_nxcompat_no: case OPT_nxcompat_no:
// handle /nxcompat:no
ctx.setNxCompat(false); ctx.setNxCompat(false);
break; break;
case OPT_largeaddressaware: case OPT_largeaddressaware:
// handle /largeaddressaware
ctx.setLargeAddressAware(true); ctx.setLargeAddressAware(true);
break; break;
case OPT_allowbind: case OPT_allowbind:
// handle /allowbind
ctx.setAllowBind(true); ctx.setAllowBind(true);
break; break;
case OPT_allowbind_no: case OPT_allowbind_no:
// handle /allowbind:no
ctx.setAllowBind(false); ctx.setAllowBind(false);
break; break;
case OPT_allowisolation: case OPT_allowisolation:
// handle /allowisolation
ctx.setAllowIsolation(true); ctx.setAllowIsolation(true);
break; break;
case OPT_allowisolation_no: case OPT_allowisolation_no:
// handle /allowisolation:no
ctx.setAllowIsolation(false); ctx.setAllowIsolation(false);
break; break;
case OPT_fixed: case OPT_fixed:
// handle /fixed // /fixed is not compatible with /dynamicbase. Check for it.
// make sure /dynamicbase wasn't specified
if (parsedArgs->getLastArg(OPT_dynamicbase)) { if (parsedArgs->getLastArg(OPT_dynamicbase)) {
diagnostics << "/dynamicbase must not be specified with /fixed\n"; diagnostics << "/dynamicbase must not be specified with /fixed\n";
return true; return true;
} }
ctx.setBaseRelocationEnabled(false); ctx.setBaseRelocationEnabled(false);
ctx.setDynamicBaseEnabled(false); ctx.setDynamicBaseEnabled(false);
break; break;
case OPT_dynamicbase_no: case OPT_dynamicbase_no:
// handle /dynamicbase:no
ctx.setDynamicBaseEnabled(false); ctx.setDynamicBaseEnabled(false);
break; break;
case OPT_tsaware: case OPT_tsaware:
// handle /tsaware
ctx.setTerminalServerAware(true); ctx.setTerminalServerAware(true);
break; break;
case OPT_tsaware_no: case OPT_tsaware_no:
// handle /tsaware:no
ctx.setTerminalServerAware(false); ctx.setTerminalServerAware(false);
break; break;
case OPT_incl: case OPT_incl:
// handle /incl
ctx.addInitialUndefinedSymbol(ctx.allocateString(inputArg->getValue())); ctx.addInitialUndefinedSymbol(ctx.allocateString(inputArg->getValue()));
break; break;
case OPT_nodefaultlib_all: case OPT_nodefaultlib_all:
// handle /nodefaultlib
ctx.setNoDefaultLibAll(true); ctx.setNoDefaultLibAll(true);
break; break;
case OPT_out: case OPT_out:
// handle /out
ctx.setOutputPath(ctx.allocateString(inputArg->getValue())); ctx.setOutputPath(ctx.allocateString(inputArg->getValue()));
break; break;
case OPT_INPUT: case OPT_INPUT:
// Add an input file.
inputGraph.addInputElement(std::unique_ptr<InputElement>( inputGraph.addInputElement(std::unique_ptr<InputElement>(
new PECOFFFileNode(ctx, inputArg->getValue()))); new PECOFFFileNode(ctx, inputArg->getValue())));
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment