summaryrefslogtreecommitdiff
path: root/clang/include/clang/Basic/BuiltinsWebAssembly.def
blob: d987af6492c1f10b267dd42cf2ac25bb62b42a79 (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
39
40
41
42
// BuiltinsWebAssembly.def - WebAssembly builtin function database -*- C++ -*-//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file defines the WebAssembly-specific builtin function database.
/// Users of this file must define the BUILTIN macro to make use of this
/// information.
///
//===----------------------------------------------------------------------===//

// The format of this database matches clang/Basic/Builtins.def.

// Query the current memory size, and increase the current memory size.
// Note that memory.size is not "c" (readnone) because it must be sequenced
// with respect to memory.grow calls.
BUILTIN(__builtin_wasm_memory_size, "zIi", "n")
BUILTIN(__builtin_wasm_memory_grow, "zIiz", "n")

// These are the old names.
BUILTIN(__builtin_wasm_mem_size, "zIi", "n")
BUILTIN(__builtin_wasm_mem_grow, "zIiz", "n")

// These are the old old names. They also lack the immediate field.
BUILTIN(__builtin_wasm_current_memory, "z", "n")
BUILTIN(__builtin_wasm_grow_memory, "zz", "n")

// Exception handling builtins.
BUILTIN(__builtin_wasm_throw, "vUiv*", "r")
BUILTIN(__builtin_wasm_rethrow, "v", "r")

// Atomic wait and notify.
BUILTIN(__builtin_wasm_atomic_wait_i32, "ii*iLLi", "n")
BUILTIN(__builtin_wasm_atomic_wait_i64, "iLLi*LLiLLi", "n")
BUILTIN(__builtin_wasm_atomic_notify, "Uii*i", "n")

#undef BUILTIN