From 3970b7b7548348e237cc38d8bafc2baee0224357 Mon Sep 17 00:00:00 2001 From: Darkhost1999 <60384196+Darkhost1999@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:40:52 -0500 Subject: [PATCH] Class "llvm:StringRef" has no member 'Startswith' (#15898) --- Utilities/JITLLVM.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Utilities/JITLLVM.cpp b/Utilities/JITLLVM.cpp index ecb56e2769..a28ee2580f 100644 --- a/Utilities/JITLLVM.cpp +++ b/Utilities/JITLLVM.cpp @@ -727,11 +727,11 @@ llvm::StringRef fallback_cpu_detection() { #if defined (ARCH_X64) // If we got here we either have a very old and outdated CPU or a new CPU that has not been seen by LLVM yet. - llvm::StringRef brand = utils::get_cpu_brand(); + const std::string brand = utils::get_cpu_brand(); const auto family = utils::get_cpu_family(); const auto model = utils::get_cpu_model(); - if (brand.startswith("AMD")) + if (brand.starts_with("AMD")) { switch (family) { @@ -759,7 +759,7 @@ llvm::StringRef fallback_cpu_detection() : "znver3"; } } - else if (brand.contains("Intel")) + else if (brand.find("Intel") != std::string::npos) { if (!utils::has_avx()) { @@ -779,7 +779,7 @@ llvm::StringRef fallback_cpu_detection() } return "icelake-client"; } - else if (brand.startswith("VirtualApple")) + else if (brand.starts_with("VirtualApple")) { // No AVX. This will change in MacOS 15+, at which point we may revise this. return utils::has_avx() ? "haswell" : "nehalem";