Skip to content

Commit 7c94603

Browse files
committed
[NFC][Clang] Make read-only arguments of GetSDLFromOffloadArchive and SDLSearch read-only references instead of copying them
1 parent ac534d2 commit 7c94603

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,8 +2053,9 @@ void tools::addX86AlignBranchArgs(const Driver &D, const ArgList &Args,
20532053
///
20542054
static bool SDLSearch(const Driver &D, const llvm::opt::ArgList &DriverArgs,
20552055
llvm::opt::ArgStringList &CC1Args,
2056-
SmallVector<std::string, 8> LibraryPaths, std::string Lib,
2057-
StringRef Arch, StringRef Target, bool isBitCodeSDL) {
2056+
const SmallVectorImpl<std::string> &LibraryPaths,
2057+
StringRef Lib, StringRef Arch, StringRef Target,
2058+
bool isBitCodeSDL) {
20582059
SmallVector<std::string, 12> SDLs;
20592060

20602061
std::string LibDeviceLoc = "/libdevice";
@@ -2131,8 +2132,9 @@ static bool SDLSearch(const Driver &D, const llvm::opt::ArgList &DriverArgs,
21312132
static bool GetSDLFromOffloadArchive(
21322133
Compilation &C, const Driver &D, const Tool &T, const JobAction &JA,
21332134
const InputInfoList &Inputs, const llvm::opt::ArgList &DriverArgs,
2134-
llvm::opt::ArgStringList &CC1Args, SmallVector<std::string, 8> LibraryPaths,
2135-
StringRef Lib, StringRef Arch, StringRef Target, bool isBitCodeSDL) {
2135+
llvm::opt::ArgStringList &CC1Args,
2136+
const SmallVectorImpl<std::string> &LibraryPaths, StringRef Lib,
2137+
StringRef Arch, StringRef Target, bool isBitCodeSDL) {
21362138

21372139
// We don't support bitcode archive bundles for nvptx
21382140
if (isBitCodeSDL && Arch.contains("nvptx"))

0 commit comments

Comments
 (0)