Skip to content

Commit 0536c9a

Browse files
[Synchronization] Fix wasm atomic intrinsic declarations
Otherwise, isel will not be able to select the desired atomic instructions.
1 parent 4497c70 commit 0536c9a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/public/Synchronization/Mutex/WasmImpl.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
// Note: All atomic accesses on WASM are sequentially consistent regardless of
1414
// what ordering we tell LLVM to use.
1515

16-
@_extern(c, "llvm.wasm32.memory.atomic.wait32")
16+
@_extern(c, "llvm.wasm.memory.atomic.wait32")
1717
internal func _swift_stdlib_wait(
1818
on: UnsafePointer<UInt32>,
1919
expected: UInt32,
2020
timeout: Int64
2121
) -> UInt32
2222

23-
@_extern(c, "llvm.wasm32.memory.atomic.notify")
24-
internal func _swift_stdlib_wake(on: UnsafePointer<UInt32>, count: UInt32)
23+
@_extern(c, "llvm.wasm.memory.atomic.notify")
24+
internal func _swift_stdlib_wake(on: UnsafePointer<UInt32>, count: UInt32) -> UInt32
2525

2626
extension Atomic where Value == _MutexHandle.State {
2727
internal borrowing func _wait(expected: _MutexHandle.State) {
28-
_swift_stdlib_wait(
28+
_ = _swift_stdlib_wait(
2929
on: .init(_rawAddress),
3030
expected: expected.rawValue,
3131

@@ -36,7 +36,7 @@ extension Atomic where Value == _MutexHandle.State {
3636

3737
internal borrowing func _wake() {
3838
// Only wake up 1 thread
39-
_swift_stdlib_wake(on: .init(_rawAddress), count: 1)
39+
_ = _swift_stdlib_wake(on: .init(_rawAddress), count: 1)
4040
}
4141
}
4242

0 commit comments

Comments
 (0)