Skip to content

Commit

Permalink
One clippy lint and remove workspac
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat-Lafon committed May 22, 2024
1 parent 95b3ca8 commit a9fba62
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
10 changes: 0 additions & 10 deletions bril-rs/brillvm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
workspace = { members = ["runtime"] }
[package]
name = "brillvm"
version = "0.1.0"
Expand Down Expand Up @@ -29,12 +28,3 @@ features = ["float", "ssa", "memory"]
[[bin]]
name = "main"
path = "src/main.rs"

# To properly set up the rt library for linking with LLVM
[profile.dev]
panic = "abort"
lto = true

[profile.release]
panic = "abort"
lto = true
2 changes: 1 addition & 1 deletion bril-rs/brillvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ clean:

.PHONY: rt
rt:
cd runtime && cargo rustc --release -- --emit=llvm-bc && mv ../target/release/deps/runtime-*.bc ../rt.bc
cd runtime && cargo rustc --release -- --emit=llvm-bc && mv target/release/deps/runtime-*.bc ../rt.bc

example:
# bril2json < ../../benchmarks/mem/sieve.bril | cargo run -- -i 100
Expand Down
11 changes: 10 additions & 1 deletion bril-rs/brillvm/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
libc-print = "0.1"
libc-print = "0.1"

# To properly set up the rt library for linking with LLVM
[profile.dev]
panic = "abort"
lto = true

[profile.release]
panic = "abort"
lto = true
6 changes: 3 additions & 3 deletions bril-rs/brillvm/src/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1048,9 +1048,9 @@ fn build_instruction<'a, 'b>(
// If this bril code follows LLVM's phi node restrictions, then
// there should be no observable sideeffects
let current_block = builder.get_insert_block().unwrap();
current_block
.get_first_instruction()
.map(|instruction| builder.position_before(&instruction));
if let Some(instruction) = current_block.get_first_instruction() {
builder.position_before(&instruction);
}

let phi = builder
.build_phi(context.ptr_type(AddressSpace::default()), &name)
Expand Down

0 comments on commit a9fba62

Please sign in to comment.