Fix warnings

This commit is contained in:
Sofia 2025-07-12 14:42:05 +03:00
parent 0f424c70d7
commit 04e0c136df
4 changed files with 18 additions and 18 deletions

View File

@ -3,8 +3,6 @@
use std::{cell::RefCell, rc::Rc};
use llvm_sys::core::{LLVMBuildAlloca, LLVMBuildLoad2, LLVMBuildStore};
use crate::{
BlockData, ConstValue, FunctionData, Instr, InstructionData, ModuleData, TerminatorKind, Type,
util::match_types,

View File

@ -1,6 +1,5 @@
use std::{collections::HashMap, mem};
use llvm_sys::core::LLVMBuildStore;
use reid_lib::{
builder::InstructionValue, Block, CmpPredicate, ConstValue, Context, Function, Instr, Module,
TerminatorKind as Term, Type,

View File

@ -268,10 +268,12 @@ impl Block {
impl Statement {
fn pass<T: Pass>(&mut self, pass: &mut T, state: &mut State<T::TError>, scope: &mut Scope) {
match &mut self.0 {
StmtKind::Let(_, mutable, expression) => {
StmtKind::Let(_, _, expression) => {
expression.pass(pass, state, scope);
}
StmtKind::Set(_, expression) => {
expression.pass(pass, state, scope);
}
StmtKind::Set(variable_reference, expression) => {} // TODO
StmtKind::Import(_) => todo!(),
StmtKind::Expression(expression) => {
expression.pass(pass, state, scope);
@ -281,19 +283,21 @@ impl Statement {
pass.stmt(self, PassState::from(state, scope));
match &mut self.0 {
StmtKind::Let(variable_reference, mutable, _) => scope
.variables
.set(
variable_reference.1.clone(),
ScopeVariable {
ty: variable_reference.0,
mutable: *mutable,
},
)
.ok(),
StmtKind::Set(variable_reference, expression) => None, // TODO
StmtKind::Let(variable_reference, mutable, _) => {
scope
.variables
.set(
variable_reference.1.clone(),
ScopeVariable {
ty: variable_reference.0,
mutable: *mutable,
},
)
.ok();
}
StmtKind::Set(_, _) => {}
StmtKind::Import(_) => todo!(),
StmtKind::Expression(_) => None,
StmtKind::Expression(_) => {}
};
}
}

View File

@ -101,7 +101,6 @@ impl Block {
for statement in &mut self.statements {
let ret = match &mut statement.0 {
// TODO
StmtKind::Let(variable_reference, mutable, expression) => {
let res = expression.typecheck(&mut state, Some(variable_reference.0));