-
Notifications
You must be signed in to change notification settings - Fork 10
/
wasm.py
40 lines (35 loc) · 883 Bytes
/
wasm.py
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
#
# WebAssembly outputer
#
# Copyright (c) 2020, Arm Limited. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
from .. import outputs
from ..box import Fn
from ..glue import override
import io
import textwrap
import itertools as it
# These basically only exist to allow specialization in glue/runtimes
@outputs.output
class WasmHOutput(outputs.HOutput):
"""
Name of header file for WebAssembly boxes.
"""
__argname__ = "wasm_h"
__arghelp__ = __doc__
@outputs.output
class WasmCOutput(outputs.COutput):
"""
Name of C file for WebAssembly boxes.
"""
__argname__ = "wasm_c"
__arghelp__ = __doc__
@outputs.output
class WasmRustLibOutput(outputs.RustLibOutput):
"""
Path of Rust file to place the generated bento-box library
for WebAssembly boxes.
"""
__argname__ = "wasm_rust_lib"
__arghelp__ = __doc__