mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-22 16:08:24 +00:00
clippy
This commit is contained in:
parent
3b840937b6
commit
2616132766
|
@ -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<PathBuf, Box<
|
|||
di_unit,
|
||||
builder: &builder,
|
||||
target_data: machine.get_target_data(),
|
||||
module_id: *module_id,
|
||||
_module_id: *module_id,
|
||||
di_namespace,
|
||||
};
|
||||
|
||||
|
@ -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(),
|
||||
|
@ -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> {
|
||||
|
|
|
@ -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)?))
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -125,6 +125,6 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn test_ident() {
|
||||
parse_ast("hello");
|
||||
parse_ast("hello").unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue