From: Alexander Shaposhnikov Date: Wed, 14 Jul 2021 11:33:09 +0000 (-0700) Subject: [lld][MachO] Code cleanup X-Git-Tag: llvmorg-14-init~1501 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d21772fa21de6a1c5d0f4792fbd175ff3d18c842;p=platform%2Fupstream%2Fllvm.git [lld][MachO] Code cleanup Make use of ArgList::getLastArgValue. NFC. Test plan: make check-lld-macho Differential revision: https://reviews.llvm.org/D105452 --- diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp index e146991..fa84c3f 100644 --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -1142,10 +1142,8 @@ bool macho::link(ArrayRef argsArr, bool canExitEarly, 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 =