]> git.proxmox.com Git - rustc.git/blame - src/binaryen/src/wasm-type.h
New upstream version 1.25.0+dfsg1
[rustc.git] / src / binaryen / src / wasm-type.h
CommitLineData
abe05a73
XL
1/*
2 * Copyright 2017 WebAssembly Community Group participants
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef wasm_wasm_type_h
18#define wasm_wasm_type_h
19
20namespace wasm {
21
22enum WasmType {
23 none,
24 i32,
25 i64,
26 f32,
27 f64,
28 unreachable // none means no type, e.g. a block can have no return type. but
29 // unreachable is different, as it can be "ignored" when doing
30 // type checking across branches
31};
32
33const char* printWasmType(WasmType type);
34unsigned getWasmTypeSize(WasmType type);
35bool isWasmTypeFloat(WasmType type);
36WasmType getWasmType(unsigned size, bool float_);
37WasmType getReachableWasmType(WasmType a, WasmType b);
38bool isConcreteWasmType(WasmType type);
39
40} // namespace wasm
41
42#endif // wasm_wasm_type_h