Yi Kong | 878f994 | 2023-12-13 12:55:04 +0900 | [diff] [blame^] | 1 | //===-- WebAssemblyReferenceTypes.def - Wasm reference types ----*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file defines externref_t. The macros are: |
| 10 | // |
| 11 | // WASM_TYPE(Name, Id, SingletonId) |
| 12 | // WASM_REF_TYPE(Name, MangledName, Id, SingletonId, AS) |
| 13 | // |
| 14 | // where: |
| 15 | // |
| 16 | // - Name is the name of the builtin type. |
| 17 | // |
| 18 | // - MangledNameBase is the base used for name mangling. |
| 19 | // |
| 20 | // - BuiltinType::Id is the enumerator defining the type. |
| 21 | // |
| 22 | // - Context.SingletonId is the global singleton of this type. |
| 23 | // |
| 24 | // - AS indicates the address space for values of this type. |
| 25 | // |
| 26 | // To include this file, define either WASM_REF_TYPE or WASM_TYPE, depending on |
| 27 | // how much information you want. The macros will be undefined after inclusion. |
| 28 | // |
| 29 | //===----------------------------------------------------------------------===// |
| 30 | |
| 31 | |
| 32 | #ifndef WASM_REF_TYPE |
| 33 | #define WASM_REF_TYPE(Name, MangledNameBase, Id, SingletonId, AS) \ |
| 34 | WASM_TYPE(Name, Id, SingletonId) |
| 35 | #endif |
| 36 | |
| 37 | WASM_REF_TYPE("__externref_t", "externref_t", WasmExternRef, WasmExternRefTy, 10) |
| 38 | |
| 39 | #undef WASM_TYPE |
| 40 | #undef WASM_REF_TYPE |