From 1e86a9a2aa0686a990ab52639d5206fba6e68155 Mon Sep 17 00:00:00 2001 From: sofia Date: Tue, 22 Jul 2025 22:42:29 +0300 Subject: [PATCH] Remove main.rs, remove debug prints --- reid-llvm-lib/src/builder.rs | 2 -- reid/src/main.rs | 46 ------------------------------------ 2 files changed, 48 deletions(-) delete mode 100644 reid/src/main.rs diff --git a/reid-llvm-lib/src/builder.rs b/reid-llvm-lib/src/builder.rs index 24b4efd..eaf875e 100644 --- a/reid-llvm-lib/src/builder.rs +++ b/reid-llvm-lib/src/builder.rs @@ -385,12 +385,10 @@ impl Builder { } Instr::FunctionCall(fun, params) => { let param_types = self.function_data(&fun).params; - dbg!(¶ms, ¶m_types); if param_types.len() != params.len() { return Err(()); // TODO error: invalid amount of params } for (a, b) in param_types.iter().zip(params) { - dbg!(b.get_type(&self)?); if *a != b.get_type(&self)? { return Err(()); // TODO error: params do not match } diff --git a/reid/src/main.rs b/reid/src/main.rs deleted file mode 100644 index 9d7a9d8..0000000 --- a/reid/src/main.rs +++ /dev/null @@ -1,46 +0,0 @@ -use std::{env, fs, path::PathBuf}; - -use reid::compile_simple; -use reid_lib::compile::CompileOutput; - -fn main() -> Result<(), std::io::Error> { - let args: Vec = env::args().collect(); - if let Some(filename) = args.get(1) { - let path = PathBuf::from(filename).canonicalize().unwrap(); - let parent = path.with_extension(""); - let llvm_ir_path = parent.with_extension("ll"); - let object_path = parent.with_extension("o"); - let asm_path = parent.with_extension("asm"); - - let before = std::time::SystemTime::now(); - - let text = fs::read_to_string(&path)?; - match compile_simple(&text, PathBuf::from(&path)) { - Ok(CompileOutput { - triple, - assembly, - obj_buffer, - llvm_ir, - }) => { - println!("{}", llvm_ir); - - let after = std::time::SystemTime::now(); - println!("Compiled with triple: {}\n", &triple); - fs::write(&llvm_ir_path, &llvm_ir).expect("Could not write LLVM IR -file!"); - println!("Output LLVM IR to {:?}", llvm_ir_path); - fs::write(&asm_path, &assembly).expect("Could not write Assembly-file!"); - println!("Output Assembly to {:?}", asm_path); - fs::write(&object_path, &obj_buffer).expect("Could not write Object-file!"); - println!("Output Object-file to {:?}\n", object_path); - println!( - "Compilation took: {:.2}ms\n", - (after.duration_since(before).unwrap().as_micros() as f32) / 1000. - ); - } - Err(e) => panic!("{}", e), - }; - } else { - println!("Please input compiled file path!") - } - Ok(()) -}