[llvm] Triple: Remove workaround for gcc 4.0.3 (PR #145660)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 02:59:22 PDT 2025


https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/145660

Use the Twine version instead of manually building a string

>From d18847cabf05ae3d316f036b96c48f8c3707f8f9 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Wed, 25 Jun 2025 18:48:40 +0900
Subject: [PATCH] Triple: Remove workaround for gcc 4.0.3

Use the Twine version instead of manually building a string
---
 llvm/lib/TargetParser/Triple.cpp | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/llvm/lib/TargetParser/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp
index 5718ae385bac1..9a5b84ce0afff 100644
--- a/llvm/lib/TargetParser/Triple.cpp
+++ b/llvm/lib/TargetParser/Triple.cpp
@@ -1636,14 +1636,7 @@ void Triple::setObjectFormat(ObjectFormatType Kind) {
 }
 
 void Triple::setArchName(StringRef Str) {
-  // Work around a miscompilation bug for Twines in gcc 4.0.3.
-  SmallString<64> Triple;
-  Triple += Str;
-  Triple += "-";
-  Triple += getVendorName();
-  Triple += "-";
-  Triple += getOSAndEnvironmentName();
-  setTriple(Triple);
+  setTriple(Str + "-" + getVendorName() + "-" + getOSAndEnvironmentName());
 }
 
 void Triple::setVendorName(StringRef Str) {



More information about the llvm-commits mailing list