Handle --version before handling --mllvm.

Because it's a waste of time to handle --mllvm before --version.

Differential Revision: https://reviews.llvm.org/D43527

llvm-svn: 325952
This commit is contained in:
Rui Ueyama 2018-02-23 20:24:28 +00:00
parent 69b8fa8391
commit eecdaaac27
1 changed files with 6 additions and 5 deletions

View File

@ -233,6 +233,12 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
return;
}
// Handle --version
if (Args.hasArg(OPT_version) || Args.hasArg(OPT_v)) {
outs() << getLLDVersion() << "\n";
return;
}
// Parse and evaluate -mllvm options.
std::vector<const char *> V;
V.push_back("wasm-ld (LLVM option parsing)");
@ -242,11 +248,6 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
errorHandler().ErrorLimit = args::getInteger(Args, OPT_error_limit, 20);
if (Args.hasArg(OPT_version) || Args.hasArg(OPT_v)) {
outs() << getLLDVersion() << "\n";
return;
}
Config->AllowUndefined = Args.hasArg(OPT_allow_undefined);
Config->CheckSignatures =
Args.hasFlag(OPT_check_signatures, OPT_no_check_signatures, false);