This commit is contained in:
Rerumu 2022-06-20 14:10:25 -04:00
parent 8b16df34f8
commit 14e5f0e17d

View File

@ -1,5 +1,6 @@
use std::collections::BTreeSet;
use parity_wasm::elements::ValueType;
use wasm_ast::{
node::{BinOp, CmpOp, FuncData, LoadAt, StoreAt, UnOp, Value},
visit::{Driver, Visitor},
@ -67,6 +68,14 @@ pub fn visit(ast: &FuncData) -> BTreeSet<(&'static str, &'static str)> {
result: BTreeSet::new(),
};
if ast
.local_data
.iter()
.any(|v| v.value_type() == ValueType::I64)
{
visit.result.insert(("i64", "K_ZERO"));
}
ast.accept(&mut visit);
visit.result