Fix warnings
This commit is contained in:
parent
0f424c70d7
commit
04e0c136df
@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
use std::{cell::RefCell, rc::Rc};
|
use std::{cell::RefCell, rc::Rc};
|
||||||
|
|
||||||
use llvm_sys::core::{LLVMBuildAlloca, LLVMBuildLoad2, LLVMBuildStore};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
BlockData, ConstValue, FunctionData, Instr, InstructionData, ModuleData, TerminatorKind, Type,
|
BlockData, ConstValue, FunctionData, Instr, InstructionData, ModuleData, TerminatorKind, Type,
|
||||||
util::match_types,
|
util::match_types,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
use std::{collections::HashMap, mem};
|
use std::{collections::HashMap, mem};
|
||||||
|
|
||||||
use llvm_sys::core::LLVMBuildStore;
|
|
||||||
use reid_lib::{
|
use reid_lib::{
|
||||||
builder::InstructionValue, Block, CmpPredicate, ConstValue, Context, Function, Instr, Module,
|
builder::InstructionValue, Block, CmpPredicate, ConstValue, Context, Function, Instr, Module,
|
||||||
TerminatorKind as Term, Type,
|
TerminatorKind as Term, Type,
|
||||||
|
@ -268,10 +268,12 @@ impl Block {
|
|||||||
impl Statement {
|
impl Statement {
|
||||||
fn pass<T: Pass>(&mut self, pass: &mut T, state: &mut State<T::TError>, scope: &mut Scope) {
|
fn pass<T: Pass>(&mut self, pass: &mut T, state: &mut State<T::TError>, scope: &mut Scope) {
|
||||||
match &mut self.0 {
|
match &mut self.0 {
|
||||||
StmtKind::Let(_, mutable, expression) => {
|
StmtKind::Let(_, _, expression) => {
|
||||||
|
expression.pass(pass, state, scope);
|
||||||
|
}
|
||||||
|
StmtKind::Set(_, expression) => {
|
||||||
expression.pass(pass, state, scope);
|
expression.pass(pass, state, scope);
|
||||||
}
|
}
|
||||||
StmtKind::Set(variable_reference, expression) => {} // TODO
|
|
||||||
StmtKind::Import(_) => todo!(),
|
StmtKind::Import(_) => todo!(),
|
||||||
StmtKind::Expression(expression) => {
|
StmtKind::Expression(expression) => {
|
||||||
expression.pass(pass, state, scope);
|
expression.pass(pass, state, scope);
|
||||||
@ -281,19 +283,21 @@ impl Statement {
|
|||||||
pass.stmt(self, PassState::from(state, scope));
|
pass.stmt(self, PassState::from(state, scope));
|
||||||
|
|
||||||
match &mut self.0 {
|
match &mut self.0 {
|
||||||
StmtKind::Let(variable_reference, mutable, _) => scope
|
StmtKind::Let(variable_reference, mutable, _) => {
|
||||||
.variables
|
scope
|
||||||
.set(
|
.variables
|
||||||
variable_reference.1.clone(),
|
.set(
|
||||||
ScopeVariable {
|
variable_reference.1.clone(),
|
||||||
ty: variable_reference.0,
|
ScopeVariable {
|
||||||
mutable: *mutable,
|
ty: variable_reference.0,
|
||||||
},
|
mutable: *mutable,
|
||||||
)
|
},
|
||||||
.ok(),
|
)
|
||||||
StmtKind::Set(variable_reference, expression) => None, // TODO
|
.ok();
|
||||||
|
}
|
||||||
|
StmtKind::Set(_, _) => {}
|
||||||
StmtKind::Import(_) => todo!(),
|
StmtKind::Import(_) => todo!(),
|
||||||
StmtKind::Expression(_) => None,
|
StmtKind::Expression(_) => {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,6 @@ impl Block {
|
|||||||
|
|
||||||
for statement in &mut self.statements {
|
for statement in &mut self.statements {
|
||||||
let ret = match &mut statement.0 {
|
let ret = match &mut statement.0 {
|
||||||
// TODO
|
|
||||||
StmtKind::Let(variable_reference, mutable, expression) => {
|
StmtKind::Let(variable_reference, mutable, expression) => {
|
||||||
let res = expression.typecheck(&mut state, Some(variable_reference.0));
|
let res = expression.typecheck(&mut state, Some(variable_reference.0));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user