Skip to content

Commit 6f18d77

Browse files
committed
Remove some deadcode and tqdm
1 parent 0b01588 commit 6f18d77

File tree

5 files changed

+6
-42
lines changed

5 files changed

+6
-42
lines changed

src/ir/interp.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use ordered_float::OrderedFloat;
55
use thiserror::Error;
66

77
use crate::ir::*;
8-
use crate::*;
98

109
#[derive(Debug, PartialEq, Clone)]
1110
pub enum Value {

src/ir/parse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use std::path::Path;
33

44
use lang_c::*;
55

6+
use crate::Translate;
67
use crate::ir::*;
78
use crate::utils::AssertSupported;
8-
use crate::{Translate, *};
99

1010
peg::parser! {
1111
grammar ir_parse() for str {

src/opt/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use crate::*;
2-
31
mod deadcode;
42
mod gvn;
53
mod mem2reg;

src/tests.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,11 @@ pub fn test_irgen(path: &Path) {
194194
println!("clang (expected): {}, kecc: {}", status as u8, value as u8);
195195
if status as u8 != value as u8 {
196196
let mut stderr = io::stderr().lock();
197-
stderr.write_fmt(format_args!(
198-
"[irgen] Failed to correctly generate {path:?}.\n\n [incorrect ir]"
199-
));
197+
stderr
198+
.write_fmt(format_args!(
199+
"[irgen] Failed to correctly generate {path:?}.\n\n [incorrect ir]"
200+
))
201+
.unwrap();
200202
write(&ir, &mut stderr).unwrap();
201203
drop(stderr);
202204
panic!("[irgen]");

tests/fuzz.py

-35
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,6 @@
5151
SKIP_TEST = 102
5252

5353

54-
class ProgressBar:
55-
def __init__(self):
56-
self.stage = 0
57-
self.stage_indicators = [
58-
"-",
59-
"\\",
60-
"|",
61-
"/",
62-
]
63-
self.pbar = tqdm.tqdm(
64-
total=1, bar_format="{l_bar}{bar}| [Elapsed:{elapsed}, <ETA:{remaining}]"
65-
)
66-
self.last_progress = 0
67-
68-
def print_progressbar(self, progress):
69-
indicator = self.stage_indicators[self.stage % len(self.stage_indicators)]
70-
self.stage += 1
71-
self.pbar.set_description(indicator)
72-
self.pbar.update(progress - self.last_progress)
73-
self.last_progress = progress
74-
75-
7654
def execute_command(command, cwd=None):
7755
try:
7856
process = subprocess.Popen(
@@ -300,17 +278,6 @@ def creduce(tests_dir, fuzz_arg, analyze):
300278
proc = subprocess.Popen(
301279
args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=tests_dir
302280
)
303-
pbar = ProgressBar()
304-
while True:
305-
line = proc.stdout.readline()
306-
if not line:
307-
break
308-
line = line.decode()
309-
if "%" in line:
310-
try:
311-
pbar.print_progressbar(abs(float(line[1 : line.index("%")])) / 100)
312-
except:
313-
pass # This is for potential error
314281
(out, err) = proc.communicate()
315282
if proc.returncode != 0:
316283
print(out.decode())
@@ -456,8 +423,6 @@ def fuzz(tests_dir, fuzz_arg, num_iter, easy):
456423
)
457424

458425
if args.reduce:
459-
import tqdm
460-
461426
creduce(tests_dir, fuzz_arg, args.clang_analyze)
462427
else:
463428
fuzz(tests_dir, fuzz_arg, args.num, args.easy)

0 commit comments

Comments
 (0)