Rename Intermediate to FuncData

This commit is contained in:
Rerumu
2022-06-10 23:35:25 -04:00
parent 78aa47cdd6
commit b8e40fe740
11 changed files with 47 additions and 47 deletions
+5 -5
View File
@@ -5,7 +5,7 @@ use parity_wasm::elements::{
use crate::node::{
Backward, BinOp, BinOpType, Br, BrIf, BrTable, Call, CallIndirect, CmpOp, CmpOpType,
Expression, Forward, GetGlobal, GetLocal, GetTemporary, If, Intermediate, LoadAt, LoadType,
Expression, Forward, FuncData, GetGlobal, GetLocal, GetTemporary, If, LoadAt, LoadType,
MemoryGrow, MemorySize, Return, Select, SetGlobal, SetLocal, SetTemporary, Statement, StoreAt,
StoreType, Terminator, UnOp, UnOpType, Value,
};
@@ -328,10 +328,10 @@ impl<'a> Builder<'a> {
}
#[must_use]
pub fn build_anonymous(mut self, list: &[Instruction]) -> Intermediate {
pub fn build_anonymous(mut self, list: &[Instruction]) -> FuncData {
let data = self.build_stat_list(list, 1);
Intermediate {
FuncData {
local_data: Vec::new(),
num_param: 0,
num_stack: data.num_stack,
@@ -340,11 +340,11 @@ impl<'a> Builder<'a> {
}
#[must_use]
pub fn build_indexed(mut self, index: usize, func: &FuncBody) -> Intermediate {
pub fn build_indexed(mut self, index: usize, func: &FuncBody) -> FuncData {
let arity = &self.type_info.rel_arity_of(self.type_info.len_ex() + index);
let data = self.build_stat_list(func.code().elements(), arity.num_result);
Intermediate {
FuncData {
local_data: func.locals().to_vec(),
num_param: arity.num_param,
num_stack: data.num_stack,
+1 -1
View File
@@ -751,7 +751,7 @@ pub enum Statement {
StoreAt(StoreAt),
}
pub struct Intermediate {
pub struct FuncData {
pub local_data: Vec<Local>,
pub num_param: usize,
pub num_stack: usize,
+3 -3
View File
@@ -1,6 +1,6 @@
use crate::node::{
Backward, BinOp, Br, BrIf, BrTable, Call, CallIndirect, CmpOp, Expression, Forward, GetGlobal,
GetLocal, GetTemporary, If, Intermediate, LoadAt, MemoryGrow, MemorySize, Return, Select,
Backward, BinOp, Br, BrIf, BrTable, Call, CallIndirect, CmpOp, Expression, Forward, FuncData,
GetGlobal, GetLocal, GetTemporary, If, LoadAt, MemoryGrow, MemorySize, Return, Select,
SetGlobal, SetLocal, SetTemporary, Statement, StoreAt, Terminator, UnOp, Value,
};
@@ -328,7 +328,7 @@ impl<T: Visitor> Driver<T> for Statement {
}
}
impl<T: Visitor> Driver<T> for Intermediate {
impl<T: Visitor> Driver<T> for FuncData {
fn accept(&self, visitor: &mut T) {
self.code.accept(visitor);
}