[clang] Fix Twine usage (PR #90728)

via cfe-commits cfe-commits at lists.llvm.org
Wed May 1 06:42:59 PDT 2024


https://github.com/MagentaTreehouse updated https://github.com/llvm/llvm-project/pull/90728

>From 8932159c7b8a44a984295ad3069af02ead1dd083 Mon Sep 17 00:00:00 2001
From: Mingyi Chen <cmingyi01 at gmail.com>
Date: Wed, 1 May 2024 09:39:56 -0400
Subject: [PATCH] [NFC] Construct Twines before concatenation

---
 clang/lib/Driver/ToolChains/HIPUtility.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/HIPUtility.cpp b/clang/lib/Driver/ToolChains/HIPUtility.cpp
index 08c647dfcb6f72..0a1783835bb1b0 100644
--- a/clang/lib/Driver/ToolChains/HIPUtility.cpp
+++ b/clang/lib/Driver/ToolChains/HIPUtility.cpp
@@ -106,9 +106,9 @@ class HIPUndefinedFatBinSymbols {
         std::string ID = IA->getId().str();
         if (!ID.empty()) {
           ID = llvm::utohexstr(llvm::MD5Hash(ID), /*LowerCase=*/true);
-          FatBinSymbols.insert(Twine(FatBinPrefix + "_" + ID).str());
+          FatBinSymbols.insert((FatBinPrefix + Twine('_') + ID).str());
           GPUBinHandleSymbols.insert(
-              Twine(GPUBinHandlePrefix + "_" + ID).str());
+              (GPUBinHandlePrefix + Twine('_') + ID).str());
           continue;
         }
         if (IA->getInputArg().getNumValues() == 0)



More information about the cfe-commits mailing list