[clang] clang: Remove copy of string into temporary set (PR #196373)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 10:28:25 PDT 2026


================
@@ -739,7 +739,8 @@ AMDGPUToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch,
           << getArchName() << llvm::toString(GPUsOrErr.takeError()) << "-mcpu";
     } else {
       auto &GPUs = *GPUsOrErr;
-      if (llvm::SmallSet<std::string, 1>(GPUs.begin(), GPUs.end()).size() > 1)
+      if (llvm::SmallSet<llvm::StringRef, 1>(GPUs.begin(), GPUs.end()).size() >
----------------
shiltian wrote:

This code is not really elegant…

https://github.com/llvm/llvm-project/pull/196373


More information about the cfe-commits mailing list