summaryrefslogtreecommitdiffstats
path: root/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr-24.0.1/0001-Update-lp_bld_misc.cpp-to-support-llvm-19.patch
blob: 9e5bb3427f99cae01ffd1679b8e9bcd8d636e206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From fa9cd89a85b904615ebc11da609445b5b751e68d Mon Sep 17 00:00:00 2001
From: Satadru Pramanik <satadru@umich.edu>
Date: Sat, 5 Oct 2024 13:35:52 +0000
Subject: [PATCH] Update lp_bld_misc.cpp to support llvm-19+.

Fixes #11896.
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31533>
Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/commit/fa9cd89a85b904615ebc11da609445b5b751e68d]
Signed-off-by: Randolph Sapp <rs@ti.com>
---
 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 7975fcf1ac9..5b615d627ff 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -329,8 +329,14 @@ lp_build_fill_mattrs(std::vector<std::string> &MAttrs)
     * which allows us to enable/disable code generation based
     * on the results of cpuid on these architectures.
     */
-   llvm::StringMap<bool> features;
-   llvm::sys::getHostCPUFeatures(features);
+   #if LLVM_VERSION_MAJOR >= 19
+      /* llvm-19+ returns StringMap from getHostCPUFeatures.
+      */
+      auto features = llvm::sys::getHostCPUFeatures();
+   #else
+      llvm::StringMap<bool> features;
+      llvm::sys::getHostCPUFeatures(features);
+   #endif

    for (llvm::StringMapIterator<bool> f = features.begin();
         f != features.end();
--
2.47.1