diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -1142,10 +1142,8 @@ config->mapFile = args.getLastArgValue(OPT_map); config->outputFile = args.getLastArgValue(OPT_o, "a.out"); - if (const Arg *arg = args.getLastArg(OPT_final_output)) - config->finalOutput = arg->getValue(); - else - config->finalOutput = config->outputFile; + config->finalOutput = + args.getLastArgValue(OPT_final_output, config->outputFile); config->astPaths = args.getAllArgValues(OPT_add_ast_path); config->headerPad = args::getHex(args, OPT_headerpad, /*Default=*/32); config->headerPadMaxInstallNames =