[clang] [llvm] [WebAssembly,clang] Add __builtin_wasm_test_function_pointer_signature (PR #150201)
Hood Chatham via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 25 02:57:55 PDT 2025
================
@@ -199,6 +199,12 @@ TARGET_BUILTIN(__builtin_wasm_ref_is_null_extern, "ii", "nct", "reference-types"
// return type.
TARGET_BUILTIN(__builtin_wasm_ref_null_func, "i", "nct", "reference-types")
+// Check if the runtime type of a function pointer matches its static type. Used
+// to avoid "function signature mismatch" traps. Takes a function pointer, uses
+// table.get to look up the pointer in __indirect_function_table and then
+// ref.test to test the type.
+TARGET_BUILTIN(__builtin_wasm_test_function_pointer_signature, "i.", "nct", "reference-types")
----------------
hoodmane wrote:
Okay I added the gc target feature in [e19af50](https://github.com/llvm/llvm-project/pull/150201/commits/e19af50e229d921d60884423a124acd212ecb5a3).
https://github.com/llvm/llvm-project/pull/150201
More information about the llvm-commits
mailing list