Lots of improvements.

* Better script names and grammar fix.
* Bump Rust
* Enforce more lints.
* Improve few struct definitions by removing box.
* Many minor implementation improvements.
This commit is contained in:
Janggun Lee
2022-11-21 15:27:04 +09:00
parent cb698a5e43
commit 094cbfdd2c
40 changed files with 446 additions and 498 deletions

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
rsync --exclude=".git" --delete --archive ./ ../kecc-public

View File

@@ -8,4 +8,4 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_asmgen
RUST_MIN_STACK=33554432 cargo test --release test_examples_asmgen_small -- --nocapture

View File

@@ -8,4 +8,4 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_asmgen_small
RUST_MIN_STACK=33554432 cargo test --release test_examples_asmgen -- --nocapture

View File

@@ -8,4 +8,4 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_deadcode
RUST_MIN_STACK=33554432 cargo test --release test_examples_deadcode -- --nocapture

View File

@@ -8,4 +8,4 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_gvn
RUST_MIN_STACK=33554432 cargo test --release test_examples_gvn -- --nocapture

View File

@@ -8,4 +8,4 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_irgen_small
RUST_MIN_STACK=33554432 cargo test --release test_examples_irgen_small --nocapture

View File

@@ -8,5 +8,5 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_irgen
RUST_MIN_STACK=33554432 cargo test --release test_examples_irgen -- --nocapture
RUST_MIN_STACK=33554432 python3 tests/fuzz.py --irgen -n80 --seed 22

View File

@@ -8,4 +8,4 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_mem2reg
RUST_MIN_STACK=33554432 cargo test --release test_examples_mem2reg -- --nocapture

View File

@@ -8,4 +8,4 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_simplify_cfg
RUST_MIN_STACK=33554432 cargo test --release test_examples_simplify_cfg -- --nocapture

View File

@@ -8,5 +8,5 @@ cargo fmt --all -- --check # run `cargo fmt` to auto-correct format.
cargo clippy
# Run tests.
RUST_MIN_STACK=33554432 cargo test --release test_examples_write_c
RUST_MIN_STACK=33554432 cargo test --release test_examples_write_c -- --nocapture
RUST_MIN_STACK=33554432 python3 tests/fuzz.py --print -n80 --seed 22

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env python3
"""Makes public skeleton.
"""
import os
import subprocess
import itertools
import argparse
import sys
import re
if __name__ == "__main__":
for root, dir, files in os.walk("src"):
for f in files:
(filename, ext) = os.path.splitext(f)
if ext == ".public":
os.rename(os.path.join(root, f), os.path.join(root, filename))

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env bash
# Clears the previous submissions.
rm -rf hw2.zip hw3.zip hw4.zip hw5.zip hw6.zip hw7.zip
rm -rf irgen.zip simplify_cfg.zip mem2reg.zip gvn.zip deadcode.zip asmgen.zip final.zip
# Creates new submissions.
zip hw2.zip -j src/c/write_c.rs src/irgen/mod.rs
zip hw3.zip -j src/opt/opt_utils.rs src/opt/simplify_cfg.rs
zip hw4.zip -j src/opt/opt_utils.rs src/opt/mem2reg.rs
zip hw5.zip -j src/opt/opt_utils.rs src/opt/gvn.rs
zip hw6.zip -j src/opt/opt_utils.rs src/opt/deadcode.rs
zip hw7.zip -r src/c/write_c.rs src/irgen/mod.rs src/opt/opt_utils.rs src/asmgen/*.rs
zip irgen.zip -j src/c/write_c.rs src/irgen/mod.rs
zip simplify_cfg.zip -j src/opt/opt_utils.rs src/opt/simplify_cfg.rs
zip mem2reg.zip -j src/opt/opt_utils.rs src/opt/mem2reg.rs
zip gvn.zip -j src/opt/opt_utils.rs src/opt/gvn.rs
zip deadcode.zip -j src/opt/opt_utils.rs src/opt/deadcode.rs
zip asmgen.zip -r src/c/write_c.rs src/irgen/mod.rs src/opt/opt_utils.rs src/asmgen/*.rs
zip final.zip -r src/

View File

@@ -1,16 +0,0 @@
#!/usr/bin/env bash
files="src/asmgen/mod.rs src/c/write_c.rs src/irgen/mod.rs src/opt/deadcode.rs src/opt/gvn.rs src/opt/mem2reg.rs src/opt/opt_utils.rs src/opt/simplify_cfg.rs"
for file in $files; do
mv $file $file.public
done
# deleted: src/asmgen/mod.rs.public
# deleted: src/c/write_c.rs.public
# deleted: src/irgen/mod.rs.public
# deleted: src/opt/deadcode.rs.public
# deleted: src/opt/gvn.rs.public
# deleted: src/opt/mem2reg.rs.public
# deleted: src/opt/opt_utils.rs.public
# deleted: src/opt/simplify_cfg.rs.public