Author: Maxim Kuvyrkov Date: 2021-03-18T07:47:31Z New Revision: 6802fdf8871f69d52b06d0a2b7f62f3af8292690
URL: https://github.com/llvm/llvm-project/commit/6802fdf8871f69d52b06d0a2b7f62f3af8292690 DIFF: https://github.com/llvm/llvm-project/commit/6802fdf8871f69d52b06d0a2b7f62f3af8292690.diff LOG: [NFC] Minor cleanup to use default setting of getLastArg() Noticed this while I was looking at linker defaults. Reviewed By: asl Differential Revision: https://reviews.llvm.org/D98494 Added: Modified: clang/lib/Driver/ToolChain.cpp Removed: ################################################################################ diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 217ba56c3351..94ae40e1e65f 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -571,8 +571,8 @@ std::string ToolChain::GetLinkerPath(bool *LinkerIsLLD, // Get -fuse-ld= first to prevent -Wunused-command-line-argument. -fuse-ld= is // considered as the linker flavor, e.g. "bfd", "gold", or "lld". - const Arg* A = Args.getLastArg(options::OPT_fuse_ld_EQ); - StringRef UseLinker = A ? A->getValue() : CLANG_DEFAULT_LINKER; + StringRef UseLinker = Args.getLastArgValue(options::OPT_fuse_ld_EQ, + CLANG_DEFAULT_LINKER); // --ld-path= takes precedence over -fuse-ld= and specifies the executable // name. -B, COMPILER_PATH and PATH and consulted if the value does not _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits