aboutsummaryrefslogtreecommitdiffstats
path: root/bin/llvm-wasm
blob: a1d0cfd7f7212936bc0015b67e449eeb5d08551a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/bin/bash

fullname=$1
namelength=${#fullname}
offset=$((${#fullname} - 2))
filename=${fullname:0:$offset}
"clang" -emit-llvm --target=wasm32 -Oz "$1" -c
"llc" -asm-verbose=false -o $filename.s $filename.bc
"s2wasm" $filename.s > $filename.wast
"wast2wasm" $filename.wast -o $filename.wasm