blob: d6981516d926e89de5b0f0607b8453c131cf25d1 [file] [log] [blame]
// 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
/// \brief 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 mem.size is not "c" (readnone) because it must be sequenced
// with respect to grow_memory calls.
// These are the new proposed names, which aren't yet official. Use at your own
// risk.
BUILTIN(__builtin_wasm_mem_size, "zIi", "n")
BUILTIN(__builtin_wasm_mem_grow, "zIiz", "n")
// These are the existing names, which are currently official, but expected
// to be deprecated in the future. 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")
#undef BUILTIN