Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Feb 9, 2024
1 parent 3b84093 commit 2616132
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/edlang_codegen_llvm/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down Expand Up @@ -122,7 +122,7 @@ pub fn compile(session: &Session, program: &ProgramBody) -> Result<PathBuf, Box<
di_unit,
builder: &builder,
target_data: machine.get_target_data(),
module_id: *module_id,
_module_id: *module_id,
di_namespace,
};

Expand Down Expand Up @@ -248,7 +248,7 @@ fn compile_fn(ctx: &ModuleCompileCtx, fn_id: DefId) -> 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(),
Expand Down Expand Up @@ -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> {
Expand Down
4 changes: 2 additions & 2 deletions lib/edlang_lowering/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)?))
}

Expand Down
6 changes: 3 additions & 3 deletions lib/edlang_lowering/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/edlang_parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ mod test {

#[test]
fn test_ident() {
parse_ast("hello");
parse_ast("hello").unwrap();
}
}

0 comments on commit 2616132

Please sign in to comment.