Skip to content

Commit

Permalink
misc: removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed May 26, 2020
1 parent f6d8cb3 commit 8a3600a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 60 deletions.
12 changes: 5 additions & 7 deletions crates/mun_codegen/src/code_gen/symbols.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::ir::ir_types as ir;
use crate::ir::{
abi_types::{gen_abi_types, AbiTypes},
dispatch_table::{DispatchTable, DispatchableFunction},
function,
type_table::TypeTable,
Expand Down Expand Up @@ -207,9 +206,6 @@ pub(super) fn gen_reflection_ir(
) {
let module = context.module;

// Get all the types
let abi_types = gen_abi_types(context.type_context);

let num_functions = api.len() as u32;
let functions = get_function_definition_array(db, context, api.iter());

Expand All @@ -234,15 +230,14 @@ pub(super) fn gen_reflection_ir(
let dispatch_table = gen_dispatch_table(context, dispatch_table);

// Construct the actual `get_info` function
gen_get_info_fn(db, context, &abi_types, module_info, dispatch_table);
gen_get_info_fn(db, context, module_info, dispatch_table);
gen_set_allocator_handle_fn(db, context);
}

/// Construct the actual `get_info` function.
fn gen_get_info_fn(
db: &impl IrDatabase,
context: &IrValueContext,
abi_types: &AbiTypes,
module_info: ir::ModuleInfo,
dispatch_table: ir::DispatchTable,
) {
Expand Down Expand Up @@ -292,7 +287,10 @@ fn gen_get_info_fn(
.unwrap()
.into_pointer_value()
} else {
builder.build_alloca(abi_types.assembly_info_type, "")
builder.build_alloca(
Value::<ir::AssemblyInfo>::get_ir_type(context.type_context),
"",
)
};

// Get access to the structs internals
Expand Down
1 change: 0 additions & 1 deletion crates/mun_codegen/src/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use inkwell::types::{
};
use inkwell::AddressSpace;

pub(crate) mod abi_types;
pub mod adt;
pub mod body;
#[macro_use]
Expand Down
47 changes: 0 additions & 47 deletions crates/mun_codegen/src/ir/abi_types.rs

This file was deleted.

5 changes: 0 additions & 5 deletions crates/mun_codegen/src/ir/file_group.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::{
abi_types::{gen_abi_types, AbiTypes},
adt,
dispatch_table::{DispatchTable, DispatchTableBuilder},
intrinsics,
Expand All @@ -17,8 +16,6 @@ use std::{collections::BTreeMap, sync::Arc};
pub struct FileGroupIR {
/// The LLVM module that contains the IR
pub(crate) llvm_module: Module,
/// Contains references to all of the ABI's IR types.
pub(crate) abi_types: AbiTypes,
/// The dispatch table
pub(crate) dispatch_table: DispatchTable,
/// The type table
Expand Down Expand Up @@ -86,7 +83,6 @@ pub(crate) fn ir_query(db: &impl IrDatabase, file_id: hir::FileId) -> Arc<FileGr
context: &db.context(),
module: &llvm_module,
};
let abi_types = gen_abi_types(&type_context);
let mut type_table_builder =
TypeTableBuilder::new(db, &value_context, intrinsics_map.keys(), &dispatch_table);

Expand Down Expand Up @@ -118,7 +114,6 @@ pub(crate) fn ir_query(db: &impl IrDatabase, file_id: hir::FileId) -> Arc<FileGr

Arc::new(FileGroupIR {
llvm_module,
abi_types,
dispatch_table,
type_table,
allocator_handle_type,
Expand Down
2 changes: 2 additions & 0 deletions crates/mun_codegen_macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(tarpaulin, skip)]

use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, Attribute, Data, DeriveInput, Lit, Meta};
Expand Down

0 comments on commit 8a3600a

Please sign in to comment.