Re-structure and decouple AST from generator

This commit is contained in:
Rerumu
2022-02-08 17:39:14 -05:00
parent 9d2d8aa69b
commit 22ea8910ad
32 changed files with 753 additions and 481 deletions
+3 -2
View File
@@ -2,7 +2,8 @@
use wasm_smith::Module;
use wasm::writer::{base::Transpiler, luajit::LuaJIT};
use codegen_luajit::gen::Generator;
use wasm_ast::writer::Transpiler;
// We are not interested in parity_wasm errors.
// Only 1 edition should need to be tested too.
@@ -13,7 +14,7 @@ libfuzzer_sys::fuzz_target!(|module: Module| {
Err(_) => return,
};
LuaJIT::new(&wasm)
Generator::new(&wasm)
.transpile(&mut std::io::sink())
.expect("LuaJIT should succeed");
});
+3 -2
View File
@@ -3,10 +3,11 @@
use parity_wasm::elements::Module as WasmModule;
use wasm_smith::Module as SmModule;
use wasm::writer::{base::Transpiler, luajit::LuaJIT};
use codegen_luajit::gen::Generator;
use wasm_ast::writer::Transpiler;
fn fuzz_transformer(wasm: &WasmModule) {
let trans = LuaJIT::new(wasm);
let trans = Generator::new(wasm);
let _func = trans.build_func_list();
}
+3 -2
View File
@@ -5,10 +5,11 @@ use std::io::Result;
use parity_wasm::elements::Module as WasmModule;
use wasm_smith::Module as SmModule;
use wasm::writer::{base::Transpiler, luajit::LuaJIT};
use codegen_luajit::gen::Generator;
use wasm_ast::writer::Transpiler;
fn fuzz_writer(wasm: &WasmModule) -> Result<()> {
let trans = LuaJIT::new(wasm);
let trans = Generator::new(wasm);
let list = trans.build_func_list();
trans.gen_func_list(&list, &mut std::io::sink())