fix warnings

This commit is contained in:
Janis 2024-08-30 23:55:01 +02:00
parent 9194e35851
commit ad6a9b00ec
2 changed files with 13 additions and 12 deletions

View file

@ -721,6 +721,7 @@ impl NodeRef {
fn exclusive_start(self) -> (Self, Self) { fn exclusive_start(self) -> (Self, Self) {
(self, Self::MAX) (self, Self::MAX)
} }
#[allow(dead_code)]
fn inclusive_end(self) -> (Self, Self) { fn inclusive_end(self) -> (Self, Self) {
(self, Self::MAX) (self, Self::MAX)
} }
@ -1256,27 +1257,27 @@ impl Mir {
let (lhs, rhs) = data.as_binary(); let (lhs, rhs) = data.as_binary();
writeln!(w, "%{node} = cmp {ty} %{lhs} {ty} %{rhs}") writeln!(w, "%{node} = cmp {ty} %{lhs} {ty} %{rhs}")
} }
Inst::IsEq(ty) => { Inst::IsEq(_) => {
let lhs = data.as_node(); let lhs = data.as_node();
writeln!(w, "%{node} = is eq %{lhs}") writeln!(w, "%{node} = is eq %{lhs}")
} }
Inst::IsNeq(ty) => { Inst::IsNeq(_) => {
let lhs = data.as_node(); let lhs = data.as_node();
writeln!(w, "%{node} = is neq %{lhs}") writeln!(w, "%{node} = is neq %{lhs}")
} }
Inst::IsGt(ty) => { Inst::IsGt(_) => {
let lhs = data.as_node(); let lhs = data.as_node();
writeln!(w, "%{node} = is gt %{lhs}") writeln!(w, "%{node} = is gt %{lhs}")
} }
Inst::IsLt(ty) => { Inst::IsLt(_) => {
let lhs = data.as_node(); let lhs = data.as_node();
writeln!(w, "%{node} = is lt %{lhs}") writeln!(w, "%{node} = is lt %{lhs}")
} }
Inst::IsGe(ty) => { Inst::IsGe(_) => {
let lhs = data.as_node(); let lhs = data.as_node();
writeln!(w, "%{node} = is ge %{lhs}") writeln!(w, "%{node} = is ge %{lhs}")
} }
Inst::IsLe(ty) => { Inst::IsLe(_) => {
let lhs = data.as_node(); let lhs = data.as_node();
writeln!(w, "%{node} = is le %{lhs}") writeln!(w, "%{node} = is le %{lhs}")
} }

View file

@ -1250,12 +1250,12 @@ impl<'a> Assembler<'a> {
allocas.insert(node, stack_offset); allocas.insert(node, stack_offset);
registers.insert(param_reg, node); registers.insert(param_reg, node);
} }
Inst::Eq(ty) Inst::Eq(_)
| Inst::Neq(ty) | Inst::Neq(_)
| Inst::Gt(ty) | Inst::Gt(_)
| Inst::Lt(ty) | Inst::Lt(_)
| Inst::Ge(ty) | Inst::Ge(_)
| Inst::Le(ty) => {} | Inst::Le(_) => {}
Inst::Add(ty) => { Inst::Add(ty) => {
let (src, dst) = data.unwrap().as_lhs_rhs(); let (src, dst) = data.unwrap().as_lhs_rhs();
let (&src_reg, _) = registers.iter().find(|(_, node)| node == &&src).unwrap(); let (&src_reg, _) = registers.iter().find(|(_, node)| node == &&src).unwrap();