diff --git a/llvm/include/llvm/TargetParser/Host.h b/llvm/include/llvm/TargetParser/Host.h index be3d41e022ad9..40a9b6cc13902 100644 --- a/llvm/include/llvm/TargetParser/Host.h +++ b/llvm/include/llvm/TargetParser/Host.h @@ -53,7 +53,7 @@ LLVM_ABI StringRef getHostCPUName(); /// which features may appear in this map, except that they are all valid LLVM /// feature names. The map can be empty, for example if feature detection /// fails. -LLVM_ABI const StringMap getHostCPUFeatures(); +LLVM_ABI StringMap getHostCPUFeatures(); /// This is a function compatible with cl::AddExtraVersionPrinter, which adds /// info about the current target triple and detected CPU. diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp index 8fd91fcd33f63..78bd5b4b5bd25 100644 --- a/llvm/lib/TargetParser/Host.cpp +++ b/llvm/lib/TargetParser/Host.cpp @@ -1855,7 +1855,7 @@ VendorSignatures getVendorSignature(unsigned *MaxLeaf) { #if defined(__i386__) || defined(_M_IX86) || \ defined(__x86_64__) || defined(_M_X64) -const StringMap sys::getHostCPUFeatures() { +StringMap sys::getHostCPUFeatures() { unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0; unsigned MaxLevel; StringMap Features; @@ -2068,7 +2068,7 @@ const StringMap sys::getHostCPUFeatures() { return Features; } #elif defined(__linux__) && (defined(__arm__) || defined(__aarch64__)) -const StringMap sys::getHostCPUFeatures() { +StringMap sys::getHostCPUFeatures() { StringMap Features; std::unique_ptr P = getProcCpuinfoContent(); if (!P) @@ -2148,7 +2148,7 @@ const StringMap sys::getHostCPUFeatures() { return Features; } #elif defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64)) -const StringMap sys::getHostCPUFeatures() { +StringMap sys::getHostCPUFeatures() { StringMap Features; // If we're asking the OS at runtime, believe what the OS says @@ -2167,7 +2167,7 @@ const StringMap sys::getHostCPUFeatures() { } #elif defined(__linux__) && defined(__loongarch__) #include -const StringMap sys::getHostCPUFeatures() { +StringMap sys::getHostCPUFeatures() { unsigned long hwcap = getauxval(AT_HWCAP); bool HasFPU = hwcap & (1UL << 3); // HWCAP_LOONGARCH_FPU uint32_t cpucfg2 = 0x2, cpucfg3 = 0x3; @@ -2196,7 +2196,7 @@ const StringMap sys::getHostCPUFeatures() { return Features; } #elif defined(__linux__) && defined(__riscv) -const StringMap sys::getHostCPUFeatures() { +StringMap sys::getHostCPUFeatures() { RISCVHwProbe Query[]{{/*RISCV_HWPROBE_KEY_BASE_BEHAVIOR=*/3, 0}, {/*RISCV_HWPROBE_KEY_IMA_EXT_0=*/4, 0}, {/*RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF=*/9, 0}}; @@ -2279,7 +2279,7 @@ const StringMap sys::getHostCPUFeatures() { return Features; } #else -const StringMap sys::getHostCPUFeatures() { return {}; } +StringMap sys::getHostCPUFeatures() { return {}; } #endif #if __APPLE__