-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ssa refactor): Fix no returns & duplicate main (#1243)
* Implement first-class functions * Update crates/noirc_evaluator/src/ssa_refactor/ir/dfg.rs Co-authored-by: kevaundray <[email protected]> * Implement intrinsics * Fix no return & duplicate main * bad git. remove duplicated functions * Remove Option<Function> in builder * Undo debug printing in driver --------- Co-authored-by: kevaundray <[email protected]>
- Loading branch information
1 parent
06427e5
commit ed4691b
Showing
7 changed files
with
74 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
|
||
mod ir; | ||
mod ssa_builder; | ||
mod ssa_gen; | ||
pub mod ssa_gen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
crates/noirc_evaluator/src/ssa_refactor/ssa_gen/program.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::fmt::Display; | ||
|
||
use crate::ssa_refactor::ir::function::Function; | ||
|
||
/// Contains the entire Ssa representation of the program | ||
pub struct Ssa { | ||
functions: Vec<Function>, | ||
} | ||
|
||
impl Ssa { | ||
pub fn new(functions: Vec<Function>) -> Self { | ||
Self { functions } | ||
} | ||
} | ||
|
||
impl Display for Ssa { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
for function in &self.functions { | ||
writeln!(f, "{function}")?; | ||
} | ||
Ok(()) | ||
} | ||
} |