diff --git a/lib/edlang_codegen_llvm/src/codegen.rs b/lib/edlang_codegen_llvm/src/codegen.rs index 1d799d173..bf259925d 100644 --- a/lib/edlang_codegen_llvm/src/codegen.rs +++ b/lib/edlang_codegen_llvm/src/codegen.rs @@ -33,13 +33,13 @@ struct ModuleCompileCtx<'ctx, 'm> { di_builder: DebugInfoBuilder<'ctx>, di_unit: DICompileUnit<'ctx>, target_data: TargetData, - module_id: DefId, + _module_id: DefId, di_namespace: DIScope<'ctx>, } impl<'ctx, 'm> ModuleCompileCtx<'ctx, 'm> { - pub fn get_module_body(&self) -> &ModuleBody { - self.ctx.program.modules.get(&self.module_id).unwrap() + pub fn _get_module_body(&self) -> &ModuleBody { + self.ctx.program.modules.get(&self._module_id).unwrap() } pub fn set_debug_loc(&self, scope: DIScope<'ctx>, span: Span) -> DILocation<'ctx> { @@ -122,7 +122,7 @@ pub fn compile(session: &Session, program: &ProgramBody) -> Result Result<(), BuilderError> let di_program = fn_value.get_subprogram().unwrap(); let mut debug_loc = ctx.set_debug_loc(di_program.as_debug_info_scope(), body.fn_span); - let mut lexical_block = ctx.di_builder.create_lexical_block( + let lexical_block = ctx.di_builder.create_lexical_block( debug_loc.get_scope(), ctx.di_unit.get_file(), debug_loc.get_line(), @@ -911,7 +911,7 @@ fn compile_value<'ctx>( }) } -fn compile_type<'a>( +fn _compile_type<'a>( ctx: &'a ModuleCompileCtx, ty: &ir::TypeInfo, ) -> inkwell::types::AnyTypeEnum<'a> { diff --git a/lib/edlang_lowering/src/common.rs b/lib/edlang_lowering/src/common.rs index 11d1df801..51f536fc5 100644 --- a/lib/edlang_lowering/src/common.rs +++ b/lib/edlang_lowering/src/common.rs @@ -70,7 +70,7 @@ impl BodyBuilder { id } - pub fn add_temp_local(&mut self, ty_kind: TypeKind) -> usize { + pub fn _add_temp_local(&mut self, ty_kind: TypeKind) -> usize { let id = self.body.locals.len(); self.body.locals.push(Local::temp(TypeInfo { span: None, @@ -79,7 +79,7 @@ impl BodyBuilder { id } - pub fn get_local(&self, name: &str) -> Option<&Local> { + pub fn _get_local(&self, name: &str) -> Option<&Local> { self.body.locals.get(*(self.name_to_local.get(name)?)) } diff --git a/lib/edlang_lowering/src/lib.rs b/lib/edlang_lowering/src/lib.rs index 0f9c27aa9..c3daff8cc 100644 --- a/lib/edlang_lowering/src/lib.rs +++ b/lib/edlang_lowering/src/lib.rs @@ -1,12 +1,12 @@ use std::collections::HashMap; use ast::ModuleStatement; -use common::{BodyBuilder, BuildCtx, IdGenerator}; +use common::{BodyBuilder, BuildCtx}; use edlang_ast as ast; use edlang_ir as ir; use ir::{ - BasicBlock, Body, ConstData, ConstKind, DefId, Local, LocalKind, Operand, Place, ProgramBody, - RValue, Statement, StatementKind, Terminator, TypeInfo, TypeKind, + BasicBlock, Body, DefId, Local, LocalKind, Operand, Place, ProgramBody, Statement, + StatementKind, Terminator, TypeInfo, TypeKind, }; mod common; diff --git a/lib/edlang_parser/src/lib.rs b/lib/edlang_parser/src/lib.rs index c357865f2..39e78eb14 100644 --- a/lib/edlang_parser/src/lib.rs +++ b/lib/edlang_parser/src/lib.rs @@ -125,6 +125,6 @@ mod test { #[test] fn test_ident() { - parse_ast("hello"); + parse_ast("hello").unwrap(); } }