[clang] c15d5d1 - [Driver] NFC: Use Twine temp to replace std::string local

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Sun May 31 13:38:46 PDT 2020


Author: Hubert Tong
Date: 2020-05-31T16:38:10-04:00
New Revision: c15d5d12c625df52bf82828a6af5ef2dfb6b4533

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

LOG: [Driver] NFC: Use Twine temp to replace std::string local

This patch replaces a `std::string` local used for a concatentation with
a `Twine` where the string was being passed into call.

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Gnu.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 9a340142a242..ac9eb46dacb5 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -449,10 +449,9 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
       CmdArgs.push_back("-export-dynamic");
 
     if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE) {
-      const std::string Loader =
-          D.DyldPrefix + ToolChain.getDynamicLinker(Args);
       CmdArgs.push_back("-dynamic-linker");
-      CmdArgs.push_back(Args.MakeArgString(Loader));
+      CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) +
+                                           ToolChain.getDynamicLinker(Args)));
     }
   }
 


        


More information about the cfe-commits mailing list