[clang] 7c94603 - [NFC][Clang] Make read-only arguments of GetSDLFromOffloadArchive and SDLSearch read-only references instead of copying them

Juan Manuel MARTINEZ CAAMAÑO via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 06:58:27 PDT 2023


Author: Juan Manuel MARTINEZ CAAMAÑO
Date: 2023-10-25T15:57:22+02:00
New Revision: 7c946031b2f4e8b2e0cf23af503a25a2c92be1a0

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

LOG: [NFC][Clang] Make read-only arguments of GetSDLFromOffloadArchive and SDLSearch read-only references instead of copying them

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 5a66a244bb1139e..3b3d77fd930a938 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2053,8 +2053,9 @@ void tools::addX86AlignBranchArgs(const Driver &D, const ArgList &Args,
 ///
 static bool SDLSearch(const Driver &D, const llvm::opt::ArgList &DriverArgs,
                       llvm::opt::ArgStringList &CC1Args,
-                      SmallVector<std::string, 8> LibraryPaths, std::string Lib,
-                      StringRef Arch, StringRef Target, bool isBitCodeSDL) {
+                      const SmallVectorImpl<std::string> &LibraryPaths,
+                      StringRef Lib, StringRef Arch, StringRef Target,
+                      bool isBitCodeSDL) {
   SmallVector<std::string, 12> SDLs;
 
   std::string LibDeviceLoc = "/libdevice";
@@ -2131,8 +2132,9 @@ static bool SDLSearch(const Driver &D, const llvm::opt::ArgList &DriverArgs,
 static bool GetSDLFromOffloadArchive(
     Compilation &C, const Driver &D, const Tool &T, const JobAction &JA,
     const InputInfoList &Inputs, const llvm::opt::ArgList &DriverArgs,
-    llvm::opt::ArgStringList &CC1Args, SmallVector<std::string, 8> LibraryPaths,
-    StringRef Lib, StringRef Arch, StringRef Target, bool isBitCodeSDL) {
+    llvm::opt::ArgStringList &CC1Args,
+    const SmallVectorImpl<std::string> &LibraryPaths, StringRef Lib,
+    StringRef Arch, StringRef Target, bool isBitCodeSDL) {
 
   // We don't support bitcode archive bundles for nvptx
   if (isBitCodeSDL && Arch.contains("nvptx"))


        


More information about the cfe-commits mailing list