Link integer emit and runtime
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
use wasm_ast::{
|
||||
node::{BinOp, CmpOp, Intermediate, LoadAt, StoreAt, UnOp},
|
||||
node::{BinOp, CmpOp, Intermediate, LoadAt, StoreAt, UnOp, Value},
|
||||
visit::{Driver, Visitor},
|
||||
};
|
||||
|
||||
@@ -24,6 +24,17 @@ impl Visitor for Visit {
|
||||
self.result.insert(("store", name));
|
||||
}
|
||||
|
||||
fn visit_value(&mut self, v: &Value) {
|
||||
let name = match v {
|
||||
Value::I64(0) => "K_ZERO",
|
||||
Value::I64(1) => "K_ONE",
|
||||
Value::I64(_) => "from_u32",
|
||||
_ => return,
|
||||
};
|
||||
|
||||
self.result.insert(("num", name));
|
||||
}
|
||||
|
||||
fn visit_un_op(&mut self, v: &UnOp) {
|
||||
let name = v.op.as_name();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user