[lld] d21772f - [lld][MachO] Code cleanup
Alexander Shaposhnikov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 14 04:33:36 PDT 2021
Author: Alexander Shaposhnikov
Date: 2021-07-14T04:33:09-07:00
New Revision: d21772fa21de6a1c5d0f4792fbd175ff3d18c842
URL: https://github.com/llvm/llvm-project/commit/d21772fa21de6a1c5d0f4792fbd175ff3d18c842
DIFF: https://github.com/llvm/llvm-project/commit/d21772fa21de6a1c5d0f4792fbd175ff3d18c842.diff
LOG: [lld][MachO] Code cleanup
Make use of ArgList::getLastArgValue. NFC.
Test plan: make check-lld-macho
Differential revision: https://reviews.llvm.org/D105452
Added:
Modified:
lld/MachO/Driver.cpp
Removed:
################################################################################
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index e146991e5a01b..fa84c3fdc418c 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -1142,10 +1142,8 @@ bool macho::link(ArrayRef<const char *> 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 =
More information about the llvm-commits
mailing list