Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-hartl committed Jul 8, 2024
1 parent 9353463 commit 044e359
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ir/crates/back/src/codegen/register_allocator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ impl<TM: TargetMachine> Function<TM> {
if let Some(reg) = out.and_then(|reg| reg.try_as_virtual()) {
live_sets.remove(bb_id, reg);
local_live_ranges[reg]
.get_or_insert_default()
.get_or_insert_with(Default::default)
.set_start(ProgPoint::Write(instr_nr));
}
let read = instr.reads();
Expand All @@ -812,7 +812,7 @@ impl<TM: TargetMachine> Function<TM> {
};
live_sets.insert(bb_id, reg);
local_live_ranges[reg]
.get_or_insert_default()
.get_or_insert_with(Default::default)
.maybe_set_end(ProgPoint::Read(instr_nr));
}
if let Some(val) = instr_nr.checked_sub(1) {
Expand All @@ -823,7 +823,7 @@ impl<TM: TargetMachine> Function<TM> {
if let Some(def) = def.try_as_virtual() {
live_sets.remove(bb_id, def);
local_live_ranges[def]
.get_or_insert_default()
.get_or_insert_with(Default::default)
.set_start(entry_pp);
}
}
Expand Down
1 change: 0 additions & 1 deletion ir/crates/back/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(option_get_or_insert_default)]
#![deny(clippy::enum_glob_use)]
#![warn(clippy::pedantic)]
#![forbid(unsafe_code)]
Expand Down
7 changes: 5 additions & 2 deletions lang/src/codegen/c/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ impl CProgram {
let mut file = File::create(Self::C_INPUT_FILE)?;
let transpiled_code = self.source_code();
file.write_all(transpiled_code.as_bytes())?;
Command::new(Self::C_COMPILER)
if !Command::new(Self::C_COMPILER)
.arg(Self::C_INPUT_FILE)
.arg("-o")
.arg(Self::OUTPUT_FILE)
.status()?
.exit_ok()?;
.success()
{
return Err(anyhow!("Failed to compile C program"));
}
Ok(file)
}

Expand Down
2 changes: 0 additions & 2 deletions lang/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(exit_status_error)]

use std::{fs::File, io::Write};

use anyhow::{anyhow, Result};
Expand Down

0 comments on commit 044e359

Please sign in to comment.