From 6f18d77861e5e1cfe97a9b31c9916061d3a6709a Mon Sep 17 00:00:00 2001 From: Janggun Lee Date: Wed, 26 Feb 2025 20:20:54 +0900 Subject: [PATCH] Remove some deadcode and tqdm --- src/ir/interp.rs | 1 - src/ir/parse.rs | 2 +- src/opt/mod.rs | 2 -- src/tests.rs | 8 +++++--- tests/fuzz.py | 35 ----------------------------------- 5 files changed, 6 insertions(+), 42 deletions(-) diff --git a/src/ir/interp.rs b/src/ir/interp.rs index b38629c..db0ebeb 100644 --- a/src/ir/interp.rs +++ b/src/ir/interp.rs @@ -5,7 +5,6 @@ use ordered_float::OrderedFloat; use thiserror::Error; use crate::ir::*; -use crate::*; #[derive(Debug, PartialEq, Clone)] pub enum Value { diff --git a/src/ir/parse.rs b/src/ir/parse.rs index 10648e1..944431a 100644 --- a/src/ir/parse.rs +++ b/src/ir/parse.rs @@ -3,9 +3,9 @@ use std::path::Path; use lang_c::*; +use crate::Translate; use crate::ir::*; use crate::utils::AssertSupported; -use crate::{Translate, *}; peg::parser! { grammar ir_parse() for str { diff --git a/src/opt/mod.rs b/src/opt/mod.rs index f8bb564..ad8c574 100644 --- a/src/opt/mod.rs +++ b/src/opt/mod.rs @@ -1,5 +1,3 @@ -use crate::*; - mod deadcode; mod gvn; mod mem2reg; diff --git a/src/tests.rs b/src/tests.rs index b69f8f4..149d533 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -194,9 +194,11 @@ pub fn test_irgen(path: &Path) { println!("clang (expected): {}, kecc: {}", status as u8, value as u8); if status as u8 != value as u8 { let mut stderr = io::stderr().lock(); - stderr.write_fmt(format_args!( - "[irgen] Failed to correctly generate {path:?}.\n\n [incorrect ir]" - )); + stderr + .write_fmt(format_args!( + "[irgen] Failed to correctly generate {path:?}.\n\n [incorrect ir]" + )) + .unwrap(); write(&ir, &mut stderr).unwrap(); drop(stderr); panic!("[irgen]"); diff --git a/tests/fuzz.py b/tests/fuzz.py index 7f9bfe4..b6d7777 100644 --- a/tests/fuzz.py +++ b/tests/fuzz.py @@ -51,28 +51,6 @@ CSMITH_DIR = "csmith-2.3.0" SKIP_TEST = 102 -class ProgressBar: - def __init__(self): - self.stage = 0 - self.stage_indicators = [ - "-", - "\\", - "|", - "/", - ] - self.pbar = tqdm.tqdm( - total=1, bar_format="{l_bar}{bar}| [Elapsed:{elapsed},