https://github.com/hoodmane converted_to_draft
https://github.com/llvm/llvm-project/pull/153767
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/153767
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hoodmane wrote:
@aheejin I will give a more detailed response about why this is necessary on
Monday but the problem is that the `SuspendError` is generated inside the
import wrapper:
https://github.com/v8/v8/blob/3c61391b55f06f880c7431c231f15014db34dfcc/src/wasm/wrappers.cc#L540-L568
So no JS c
hoodmane wrote:
@efriedma-quic that sounds good to me, I'll have to look into how `__try`/
`__catch` work on windows. I was just trying to copy the semantics of a C API
that I knew about, so setjmp/longjmp. But a more direct API would probably also
have a simpler implementation.
https://githu
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/153767
>From f0193d7b0b5c6242e48699c84655eb7c75b90f82 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Wed, 13 Aug 2025 13:44:57 +0200
Subject: [PATCH] Add __builtin_wasm_js_catch
This is a setjmp-like API that catc
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/153767
>From bfafd3b4a9a8845a4018d2472bb85c61c79e9f85 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Wed, 13 Aug 2025 13:44:57 +0200
Subject: [PATCH] Add __builtin_wasm_js_catch
This is a setjmp-like API that catc
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/153767
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/153767
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane created
https://github.com/llvm/llvm-project/pull/153767
This is a setjmp-like API that catches JavaScript errors. Its signature is
`externref_t __builtin_wasm_js_catch(int *status);` The first time it returns,
the return value is `null` and *status is set to 0. If
hoodmane wrote:
Updated.
https://github.com/llvm/llvm-project/pull/150921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hoodmane wrote:
Thanks @dschuff!
https://github.com/llvm/llvm-project/pull/150921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/150921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -246,35 +246,26 @@ Value
*CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID,
llvm::FunctionType *LLVMFuncTy =
cast(ConvertType(QualType(FuncTy, 0)));
+bool VarArg = LLVMFuncTy->isVarArg();
unsigned NParams = LLVMFuncTy->getNumParams();
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150921
>From 6caa2f7b749a9c655864afbbff07e9e78dd9b1b0 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 28 Jul 2025 12:37:24 +0200
Subject: [PATCH 1/5] [clang,WebAssembly] Support reference types in
test_functio
@@ -246,35 +246,26 @@ Value
*CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID,
llvm::FunctionType *LLVMFuncTy =
cast(ConvertType(QualType(FuncTy, 0)));
+bool VarArg = LLVMFuncTy->isVarArg();
unsigned NParams = LLVMFuncTy->getNumParams();
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/150921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane created
https://github.com/llvm/llvm-project/pull/151294
Also alphebetize feature list, add `-mgc` and `-mno-gc` flags, and add some
missing feature tests.
Reland of #151107.
https://github.com/llvm/llvm-project/pull/150201#discussion_r2237982637
>From 034fa59dd05
hoodmane wrote:
Thanks @aheejin. How's it look now?
https://github.com/llvm/llvm-project/pull/151107
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/151107
>From bb71b4795d85938772e78de3022d5d58b25d6d20 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Tue, 29 Jul 2025 10:41:49 +0200
Subject: [PATCH 1/5] [WebAssembly] Add gc target feature to
addBleedingEdgeFeatu
hoodmane wrote:
Okay I think I'm up to date with the comments so far.
https://github.com/llvm/llvm-project/pull/151107
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/151107
>From bb71b4795d85938772e78de3022d5d58b25d6d20 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Tue, 29 Jul 2025 10:41:49 +0200
Subject: [PATCH 1/4] [WebAssembly] Add gc target feature to
addBleedingEdgeFeatu
@@ -197,6 +197,7 @@ bool WebAssemblyTargetInfo::initFeatureMap(
Features["multimemory"] = true;
Features["tail-call"] = true;
Features["wide-arithmetic"] = true;
+Features["gc"] = true;
hoodmane wrote:
Well... the CI didn't fail... so maybe not
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/151107
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150921
>From 6caa2f7b749a9c655864afbbff07e9e78dd9b1b0 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 28 Jul 2025 12:37:24 +0200
Subject: [PATCH 1/4] [clang,WebAssembly] Support reference types in
test_functio
hoodmane wrote:
Okay added a test for struct and union abis being handled correctly.
https://github.com/llvm/llvm-project/pull/150921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150921
>From 6caa2f7b749a9c655864afbbff07e9e78dd9b1b0 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 28 Jul 2025 12:37:24 +0200
Subject: [PATCH 1/3] [clang,WebAssembly] Support reference types in
test_functio
@@ -307,6 +310,14 @@ bool WebAssemblyTargetInfo::handleTargetFeatures(
HasReferenceTypes = false;
continue;
}
+if (Feature == "+gc") {
+ HasGC = true;
+ continue;
+}
+if (Feature == "-gc") {
+ HasGC = false;
+ continue;
+}
---
https://github.com/hoodmane created
https://github.com/llvm/llvm-project/pull/151107
See suggestion here:
https://github.com/llvm/llvm-project/pull/150201#discussion_r2237982637
>From bb71b4795d85938772e78de3022d5d58b25d6d20 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Tue, 29 Jul 2025 10
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/150921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150921
>From 6caa2f7b749a9c655864afbbff07e9e78dd9b1b0 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 28 Jul 2025 12:37:24 +0200
Subject: [PATCH 1/2] [clang,WebAssembly] Support reference types in
test_functio
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/150921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane created
https://github.com/llvm/llvm-project/pull/150921
This was simpler than I thought.
>From 6caa2f7b749a9c655864afbbff07e9e78dd9b1b0 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 28 Jul 2025 12:37:24 +0200
Subject: [PATCH] [clang,WebAssembly] Support re
hoodmane wrote:
@dschuff would appreciate it if you could merge assuming you have no further
comments and the addition of the GC feature looks okay.
https://github.com/llvm/llvm-project/pull/150201
___
cfe-commits mailing list
cfe-commits@lists.llvm.o
hoodmane wrote:
And now I think CI is passing again.
https://github.com/llvm/llvm-project/pull/150201
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150201
>From 6c3c8a1d43b3b06c6b38e8e3d2e00ef2dc5fbc4e Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 7 Jul 2025 22:50:08 +0200
Subject: [PATCH 1/9] [WebAssembly,clang] Add
__builtin_wasm_test_function_pointer
hoodmane wrote:
Thanks for the reviews @dschuff and @tlively!
https://github.com/llvm/llvm-project/pull/150201
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150201
>From 6c3c8a1d43b3b06c6b38e8e3d2e00ef2dc5fbc4e Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 7 Jul 2025 22:50:08 +0200
Subject: [PATCH 1/8] [WebAssembly,clang] Add
__builtin_wasm_test_function_pointer
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150201
>From 6c3c8a1d43b3b06c6b38e8e3d2e00ef2dc5fbc4e Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 7 Jul 2025 22:50:08 +0200
Subject: [PATCH 1/8] [WebAssembly,clang] Add
__builtin_wasm_test_function_pointer
@@ -218,6 +221,64 @@ Value
*CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID,
Function *Callee = CGM.getIntrinsic(Intrinsic::wasm_ref_null_func);
return Builder.CreateCall(Callee);
}
+ case WebAssembly::BI__builtin_wasm_test_function_pointer_signature:
@@ -218,6 +221,64 @@ Value
*CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID,
Function *Callee = CGM.getIntrinsic(Intrinsic::wasm_ref_null_func);
return Builder.CreateCall(Callee);
}
+ case WebAssembly::BI__builtin_wasm_test_function_pointer_signature:
@@ -227,6 +227,53 @@ bool SemaWasm::BuiltinWasmTableCopy(CallExpr *TheCall) {
return false;
}
+bool SemaWasm::BuiltinWasmTestFunctionPointerSignature(CallExpr *TheCall) {
+ if (SemaRef.checkArgCount(TheCall, 1))
+return true;
+
+ Expr *FuncPtrArg = TheCall->getArg(0);
@@ -218,6 +221,64 @@ Value
*CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID,
Function *Callee = CGM.getIntrinsic(Intrinsic::wasm_ref_null_func);
return Builder.CreateCall(Callee);
}
+ case WebAssembly::BI__builtin_wasm_test_function_pointer_signature:
hoodmane wrote:
If this change looks good can we merge it?
https://github.com/llvm/llvm-project/pull/150201
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hoodmane wrote:
Other builtins with dynamic return type:
`__builtin_call_with_static_chain`
> This builtin is only available for C. This builtin can be used to call Go
> closures from C.
`__builtin_choose_expr`
> This built-in function is analogous to the ? : operator in C, except t
hoodmane wrote:
Well it would also be possible to make success the return value, and make the
first argument a `void* result`. This would be a more normal API, but it has
the disadvantage that it would never be able to work with functions that return
reference types. Maybe that isn't that big
hoodmane wrote:
It seems that builtins can do that. In `SemaWasm.cpp` we call
`TheCall->setType(FuncTy->getReturnType());` and that implies that the return
type of the call to `__builtin_wasm_nontrapping_call()` is the same as the
return type of `func`.
https://github.com/llvm/llvm-project/pu
hoodmane wrote:
My thought is that it returns the return value. If one of the signatures
matches it sets `*success = 1` otherwise it sets `*success = 0`. It probably
can be written in terms of `__builtin_wasm_test_function_pointer_signature`
with C++ templates but lot of projects I contribute
hoodmane wrote:
I'd also like to add `__builtin_wasm_nontrapping_call(&success, func, a, b, c)`
which tries to call func with 3, 2, 1, and 0 arguments.
https://github.com/llvm/llvm-project/pull/150201
___
cfe-commits mailing list
cfe-commits@lists.llv
hoodmane wrote:
`type` has the advantage that it is a bit less typing.
https://github.com/llvm/llvm-project/pull/150201
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hoodmane wrote:
I'm neutral on the name, happy to change it if you prefer.
https://github.com/llvm/llvm-project/pull/150201
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150201
>From 6c3c8a1d43b3b06c6b38e8e3d2e00ef2dc5fbc4e Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 7 Jul 2025 22:50:08 +0200
Subject: [PATCH 1/6] [WebAssembly,clang] Add
__builtin_wasm_test_function_pointer
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150201
>From 6c3c8a1d43b3b06c6b38e8e3d2e00ef2dc5fbc4e Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 7 Jul 2025 22:50:08 +0200
Subject: [PATCH 1/5] [WebAssembly,clang] Add
__builtin_wasm_test_function_pointer
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150201
>From 6c3c8a1d43b3b06c6b38e8e3d2e00ef2dc5fbc4e Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 7 Jul 2025 22:50:08 +0200
Subject: [PATCH 1/4] [WebAssembly,clang] Add
__builtin_wasm_test_function_pointer
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150201
>From 6c3c8a1d43b3b06c6b38e8e3d2e00ef2dc5fbc4e Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 7 Jul 2025 22:50:08 +0200
Subject: [PATCH 1/3] [WebAssembly,clang] Add
__builtin_wasm_test_function_pointer
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/150201
>From 6c3c8a1d43b3b06c6b38e8e3d2e00ef2dc5fbc4e Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Mon, 7 Jul 2025 22:50:08 +0200
Subject: [PATCH 1/2] [WebAssembly,clang] Add
__builtin_wasm_test_function_pointer
https://github.com/hoodmane created
https://github.com/llvm/llvm-project/pull/150201
Tests if the runtime type of the function pointer matches the static type. If
this returns false, calling the function pointer will trap. Uses
`@llvm.wasm.ref.test.func` added in #147486.
cc @sbc100 @dschuff
https://github.com/hoodmane closed
https://github.com/llvm/llvm-project/pull/147076
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hoodmane wrote:
Closing in favor of #147486.
https://github.com/llvm/llvm-project/pull/147076
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hoodmane wrote:
Okay I opened https://github.com/llvm/llvm-project/pull/147486/ with a second
option. I think that's a bit cleaner, I modified SelectionDAG to be able to
emit CImm arguments rather than going to all this trouble to avoid it.
https://github.com/llvm/llvm-project/pull/147076
hoodmane wrote:
The goal is as an alternative to `EMULATE_FUNCTION_POINTER_CASTS` for projects
like Python and GLib that do dispatch with sometimes-incorrect function
pointers. In particular, rather than having to `call_indirect` a function
pointer and find out whether or not we trap, I want a
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/147076
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/147076
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/147076
>From 2009bb945f57c67daa522448eddb2cc01aac4369 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Wed, 2 Jul 2025 20:53:56 +0200
Subject: [PATCH 1/8] Add __builtin_wasm_test_function_pointer_signature
This uses
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/147076
>From ba4e21486455fcee36e5521050562cd9be35e9b4 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Sat, 10 May 2025 22:01:09 -0400
Subject: [PATCH 1/9] [WebAssembly] Add ref.test_func handling to AsmParser
---
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/147076
>From ba4e21486455fcee36e5521050562cd9be35e9b4 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Sat, 10 May 2025 22:01:09 -0400
Subject: [PATCH 1/8] [WebAssembly] Add ref.test_func handling to AsmParser
---
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/147076
>From ba4e21486455fcee36e5521050562cd9be35e9b4 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Sat, 10 May 2025 22:01:09 -0400
Subject: [PATCH 1/7] [WebAssembly] Add ref.test_func handling to AsmParser
---
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/147076
>From ba4e21486455fcee36e5521050562cd9be35e9b4 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Sat, 10 May 2025 22:01:09 -0400
Subject: [PATCH 1/6] [WebAssembly] Add ref.test_func handling to AsmParser
---
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/147076
>From ba4e21486455fcee36e5521050562cd9be35e9b4 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Sat, 10 May 2025 22:01:09 -0400
Subject: [PATCH 1/5] [WebAssembly] Add ref.test_func handling to AsmParser
---
https://github.com/hoodmane created
https://github.com/llvm/llvm-project/pull/147076
This uses ref.test to check whether the function pointer's runtime type
matches its static type. If so, then calling it won't trap with "indirect
call signature mismatch". This would be very useful here:
https:/
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/139580
>From 2ca282f0a20088bef15289a8ce5167d1e23595c3 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Fri, 9 May 2025 00:16:26 -0400
Subject: [PATCH 1/3] [Wasm][Clang] Add __builtin_wasm_ref_is_null_extern
I also
hoodmane wrote:
CI looks green now.
https://github.com/llvm/llvm-project/pull/139638
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hoodmane wrote:
Can somebody merge when it's appropriate? I don't have merge rights.
https://github.com/llvm/llvm-project/pull/139638
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hoodmane wrote:
> are we sure they weren't intentionally skipping diagnostic there?
The behavior before was
```
error: cannot compile this scalar expression yet
2 | __externref_t ref = __builtin_wasm_ref_null_extern(0);
| ^
PLEAS
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/139580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -168,7 +168,7 @@ bool Sema::checkArgCount(CallExpr *Call, unsigned
DesiredArgCount) {
return Diag(Range.getBegin(), diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << DesiredArgCount << ArgCount
- << /*is non object*/ 0 << Call->getArg(1)-
@@ -168,7 +168,7 @@ bool Sema::checkArgCount(CallExpr *Call, unsigned
DesiredArgCount) {
return Diag(Range.getBegin(), diag::err_typecheck_call_too_many_args)
<< 0 /*function call*/ << DesiredArgCount << ArgCount
- << /*is non object*/ 0 << Call->getArg(1)-
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/139580
Rate limit ยท GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-
@@ -52,14 +52,33 @@ static bool CheckWasmBuiltinArgIsInteger(Sema &S, CallExpr
*E,
}
bool SemaWasm::BuiltinWasmRefNullExtern(CallExpr *TheCall) {
- if (TheCall->getNumArgs() != 0)
+ if (TheCall->getNumArgs() != 0) {
hoodmane wrote:
Oh right, `getArg(1)` wi
https://github.com/hoodmane edited
https://github.com/llvm/llvm-project/pull/139580
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -52,14 +52,33 @@ static bool CheckWasmBuiltinArgIsInteger(Sema &S, CallExpr
*E,
}
bool SemaWasm::BuiltinWasmRefNullExtern(CallExpr *TheCall) {
- if (TheCall->getNumArgs() != 0)
+ if (TheCall->getNumArgs() != 0) {
hoodmane wrote:
If a positive number of
@@ -741,6 +741,12 @@ __externref_t externref_null() {
// WEBASSEMBLY-NEXT: ret
}
+int externref_is_null(__externref_t arg) {
+ return __builtin_wasm_ref_is_null_extern(arg);
+ // WEBASSEMBLY: tail call i32 @llvm.wasm.ref.is_null.extern(ptr
addrspace(10) %arg)
https://github.com/hoodmane updated
https://github.com/llvm/llvm-project/pull/139580
>From 2ca282f0a20088bef15289a8ce5167d1e23595c3 Mon Sep 17 00:00:00 2001
From: Hood Chatham
Date: Fri, 9 May 2025 00:16:26 -0400
Subject: [PATCH 1/2] [Wasm][Clang] Add __builtin_wasm_ref_is_null_extern
I also
https://github.com/hoodmane created
https://github.com/llvm/llvm-project/pull/139580
I also fixed __builtin_wasm_ref_null_extern() to generate a diagnostic when it
gets an argument. It seems like `SemaRef.checkArgCount()` has a bug that makes
it unable to check for 0 args.
cc @sbc100 @pmatos
84 matches
Mail list logo