Index: lld/wasm/Driver.cpp =================================================================== --- lld/wasm/Driver.cpp +++ lld/wasm/Driver.cpp @@ -226,6 +226,12 @@ return; } + // Handle --version + if (Args.hasArg(OPT_version) || Args.hasArg(OPT_v)) { + outs() << getLLDVersion() << "\n"; + return; + } + // Parse and evaluate -mllvm options. std::vector V; V.push_back("wasm-ld (LLVM option parsing)"); @@ -235,11 +241,6 @@ 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);