Skip to content

Commit 4f1eb64

Browse files
committed
Extract an asm-cleanup library for reuse
1 parent 3f42ffe commit 4f1eb64

File tree

8 files changed

+29
-7
lines changed

8 files changed

+29
-7
lines changed

compiler/base/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
asm-cleanup/target
12
modify-cargo-toml/target

compiler/base/asm-cleanup/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cargo.lock
2+
target/

compiler/base/asm-cleanup/Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "asm-cleanup"
3+
version = "0.1.0"
4+
edition = "2018"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
9+
lazy_static = "1.0.0"
10+
petgraph = "0.6.0"
11+
regex = "1.0.0"
12+
rustc-demangle = "0.1.5"
File renamed without changes.

ui/Cargo.lock

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ default = ['fork-bomb-prevention']
99
fork-bomb-prevention = []
1010

1111
[dependencies]
12+
asm-cleanup = { path = "../compiler/base/asm-cleanup" }
1213
async-trait = "0.1.52"
1314
axum = { version = "0.6", features = ["headers", "ws"] }
1415
dotenv = "0.15.0"
1516
futures = "0.3.21"
1617
lazy_static = "1.0.0"
1718
octocrab = "0.25"
1819
openssl-probe = "0.1.2"
19-
petgraph = "0.6.0"
2020
prometheus = "0.13.0"
2121
regex = "1.0.0"
22-
rustc-demangle = "0.1.5"
2322
serde = { version = "1.0", features = ["rc"] }
2423
serde_derive = "1.0"
2524
serde_json = "1.0"

ui/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use tracing::{error, info, warn};
1414
const DEFAULT_ADDRESS: &str = "127.0.0.1";
1515
const DEFAULT_PORT: u16 = 5000;
1616

17-
mod asm_cleanup;
1817
mod env;
1918
mod gist;
2019
mod metrics;

ui/src/sandbox.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ impl Sandbox {
314314

315315
if let CompileTarget::Assembly(_, demangle, process) = req.target {
316316
if demangle == DemangleAssembly::Demangle {
317-
code = crate::asm_cleanup::demangle_asm(&code);
317+
code = asm_cleanup::demangle_asm(&code);
318318
}
319319

320320
if process == ProcessAssembly::Filter {
321-
code = crate::asm_cleanup::filter_asm(&code);
321+
code = asm_cleanup::filter_asm(&code);
322322
}
323323
} else if CompileTarget::Hir == req.target {
324324
// TODO: Run rustfmt on the generated HIR.

0 commit comments

Comments
 (0)