summaryrefslogtreecommitdiff
path: root/src/asm2wasm-main.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-22 21:39:41 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-22 21:46:40 -0800
commit9db247422037009967c3ef4657b231477a76cb44 (patch)
tree2478b7bd398eac07851256f7ddcf158e5161152a /src/asm2wasm-main.cpp
parent3365cb2f426345370ce7caf03d77be64a38edc0a (diff)
downloadbinaryen-9db247422037009967c3ef4657b231477a76cb44.tar.gz
binaryen-9db247422037009967c3ef4657b231477a76cb44.tar.bz2
binaryen-9db247422037009967c3ef4657b231477a76cb44.zip
refactor asm2wasm proprocessing into a shared location
Diffstat (limited to 'src/asm2wasm-main.cpp')
-rw-r--r--src/asm2wasm-main.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/asm2wasm-main.cpp b/src/asm2wasm-main.cpp
index 7c4d93052..1e9dc6680 100644
--- a/src/asm2wasm-main.cpp
+++ b/src/asm2wasm-main.cpp
@@ -27,24 +27,8 @@ int main(int argc, char **argv) {
fclose(f);
input[num] = 0;
- // emcc --separate-asm modules look like
- //
- // Module["asm"] = (function(global, env, buffer) {
- // ..
- // });
- //
- // we need to clean that up.
- if (*input == 'M') {
- while (*input != 'f') {
- input++;
- num--;
- }
- char *end = input + num - 1;
- while (*end != '}') {
- *end = 0;
- end--;
- }
- }
+ Asm2WasmPreProcessor pre;
+ input = pre.process(input);
if (debug) std::cerr << "parsing...\n";
cashew::Parser<Ref, DotZeroValueBuilder> builder;