Author: Maxim Kuvyrkov
Date: 2021-03-18T08:07:02Z
New Revision: 62948c4532d59b59f63409eae5d7f9e4990e5626

URL: 
https://github.com/llvm/llvm-project/commit/62948c4532d59b59f63409eae5d7f9e4990e5626
DIFF: 
https://github.com/llvm/llvm-project/commit/62948c4532d59b59f63409eae5d7f9e4990e5626.diff

LOG: Revert "[NFC] Minor cleanup to use default setting of getLastArg()"

The patch was wrong.  We use "const Arg *A" at the end of
GetLinkerPath, so can't remove it.

This reverts commit 6802fdf8871f69d52b06d0a2b7f62f3af8292690.

Added: 
    

Modified: 
    clang/lib/Driver/ToolChain.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index 94ae40e1e65f..217ba56c3351 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".
-  StringRef UseLinker = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
-                                            CLANG_DEFAULT_LINKER);
+  const Arg* A = Args.getLastArg(options::OPT_fuse_ld_EQ);
+  StringRef UseLinker = A ? A->getValue() : 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

Reply via email to