https://github.com/ken-matsui created 
https://github.com/llvm/llvm-project/pull/210253

The __funcref keyword is only supported by the WebAssembly target, so the 
wasm_funcref entries in other targets' address space maps are unused.

Use 0 for these entries, which is consistent with other unsupported address 
spaces.

>From 5717cc83ffa7fe5e4d4a52bd60eea3c283ab0222 Mon Sep 17 00:00:00 2001
From: Ken Matsui <[email protected]>
Date: Thu, 16 Jul 2026 22:44:38 -0400
Subject: [PATCH] [clang] Use 0 for wasm_funcref in non-Wasm address space maps
 (NFCI)

The __funcref keyword is only supported by the WebAssembly target, so
the wasm_funcref entries in other targets' address space maps are
unused.

Use 0 for these entries, which is consistent with other unsupported
address spaces.
---
 clang/lib/Basic/Targets/AArch64.h | 4 +---
 clang/lib/Basic/Targets/DirectX.h | 4 +---
 clang/lib/Basic/Targets/NVPTX.h   | 4 +---
 clang/lib/Basic/Targets/SPIR.h    | 8 ++------
 clang/lib/Basic/Targets/TCE.h     | 4 +---
 clang/lib/Basic/Targets/X86.h     | 4 +---
 6 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/clang/lib/Basic/Targets/AArch64.h 
b/clang/lib/Basic/Targets/AArch64.h
index b6e707d8b4245..becab6d59ad8a 100644
--- a/clang/lib/Basic/Targets/AArch64.h
+++ b/clang/lib/Basic/Targets/AArch64.h
@@ -51,9 +51,7 @@ static const unsigned ARM64AddrSpaceMap[] = {
     0, // hlsl_input
     0, // hlsl_output
     0, // hlsl_push_constant
-    // Wasm address space values for this target are dummy values,
-    // as it is only enabled for Wasm targets.
-    20, // wasm_funcref
+    0, // wasm_funcref
 };
 
 using AArch64FeatureSet = llvm::SmallDenseSet<StringRef, 32>;
diff --git a/clang/lib/Basic/Targets/DirectX.h 
b/clang/lib/Basic/Targets/DirectX.h
index 64e5533bbffeb..ee7b217aad9fe 100644
--- a/clang/lib/Basic/Targets/DirectX.h
+++ b/clang/lib/Basic/Targets/DirectX.h
@@ -48,9 +48,7 @@ static const unsigned DirectXAddrSpaceMap[] = {
     0, // hlsl_input
     0, // hlsl_output
     0, // hlsl_push_constant
-    // Wasm address space values for this target are dummy values,
-    // as it is only enabled for Wasm targets.
-    20, // wasm_funcref
+    0, // wasm_funcref
 };
 
 class LLVM_LIBRARY_VISIBILITY DirectXTargetInfo : public TargetInfo {
diff --git a/clang/lib/Basic/Targets/NVPTX.h b/clang/lib/Basic/Targets/NVPTX.h
index 00be0fe54c1bd..2e50c81084095 100644
--- a/clang/lib/Basic/Targets/NVPTX.h
+++ b/clang/lib/Basic/Targets/NVPTX.h
@@ -52,9 +52,7 @@ static const unsigned NVPTXAddrSpaceMap[] = {
     0, // hlsl_input
     0, // hlsl_output
     0, // hlsl_push_constant
-    // Wasm address space values for this target are dummy values,
-    // as it is only enabled for Wasm targets.
-    20, // wasm_funcref
+    0, // wasm_funcref
 };
 
 /// The DWARF address class. Taken from
diff --git a/clang/lib/Basic/Targets/SPIR.h b/clang/lib/Basic/Targets/SPIR.h
index 42256920f353e..0547c9702ffd4 100644
--- a/clang/lib/Basic/Targets/SPIR.h
+++ b/clang/lib/Basic/Targets/SPIR.h
@@ -56,9 +56,7 @@ static const unsigned SPIRDefIsPrivMap[] = {
     7,  // hlsl_input
     8,  // hlsl_output
     13, // hlsl_push_constant
-    // Wasm address space values for this target are dummy values,
-    // as it is only enabled for Wasm targets.
-    20, // wasm_funcref
+    0,  // wasm_funcref
 };
 
 // Used by both the SPIR and SPIR-V targets.
@@ -94,9 +92,7 @@ static const unsigned SPIRDefIsGenMap[] = {
     7,  // hlsl_input
     8,  // hlsl_output
     13, // hlsl_push_constant
-    // Wasm address space values for this target are dummy values,
-    // as it is only enabled for Wasm targets.
-    20, // wasm_funcref
+    0,  // wasm_funcref
 };
 
 // Base class for SPIR and SPIR-V target info.
diff --git a/clang/lib/Basic/Targets/TCE.h b/clang/lib/Basic/Targets/TCE.h
index 1360298de9794..e3874759cb35b 100644
--- a/clang/lib/Basic/Targets/TCE.h
+++ b/clang/lib/Basic/Targets/TCE.h
@@ -57,9 +57,7 @@ static const unsigned TCEOpenCLAddrSpaceMap[] = {
     0, // hlsl_input
     0, // hlsl_output
     0, // hlsl_push_constant
-    // Wasm address space values for this target are dummy values,
-    // as it is only enabled for Wasm targets.
-    20, // wasm_funcref
+    0, // wasm_funcref
 };
 
 class LLVM_LIBRARY_VISIBILITY TCETargetInfo : public TargetInfo {
diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index e305d9017d897..c34aeff183f14 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -52,9 +52,7 @@ static const unsigned X86AddrSpaceMap[] = {
     0,   // hlsl_input
     0,   // hlsl_output
     0,   // hlsl_push_constant
-    // Wasm address space values for this target are dummy values,
-    // as it is only enabled for Wasm targets.
-    20, // wasm_funcref
+    0,   // wasm_funcref
 };
 
 // X86 target abstract base class; x86-32 and x86-64 are very close, so

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to