-
Notifications
You must be signed in to change notification settings - Fork 220
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): Add DenseMap and SparseMap types (#1184)
* Add DenseMap and SparseMap * Update crates/noirc_evaluator/src/ssa_refactor/ir/map.rs Co-authored-by: kevaundray <kevtheappdev@gmail.com> * Update crates/noirc_evaluator/src/ssa_refactor/ir/map.rs Co-authored-by: kevaundray <kevtheappdev@gmail.com> * Apply suggestions from code review Co-authored-by: kevaundray <kevtheappdev@gmail.com> * Apply cfg test suggestion * Revert removal of Cast * Fix typo --------- Co-authored-by: kevaundray <kevtheappdev@gmail.com>
- Loading branch information
1 parent
750ed77
commit e1ba4f8
Showing
7 changed files
with
239 additions
and
126 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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pub(crate) mod extfunc; | ||
mod function; | ||
pub(crate) mod instruction; | ||
pub(crate) mod map; | ||
pub(crate) mod types; | ||
pub(crate) mod value; |
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 |
---|---|---|
@@ -1,23 +1,20 @@ | ||
//! Like Crane-lift all functions outside of the current function is seen as | ||
//! external. | ||
//! To reference external functions, one uses | ||
//! To reference external functions, one must first import the function signature | ||
//! into the current function's context. | ||
use super::types::Typ; | ||
use super::types::Type; | ||
|
||
#[derive(Debug, Default, Clone)] | ||
pub(crate) struct Signature { | ||
pub(crate) params: Vec<Typ>, | ||
pub(crate) returns: Vec<Typ>, | ||
pub(crate) params: Vec<Type>, | ||
pub(crate) returns: Vec<Type>, | ||
} | ||
/// Reference to a `Signature` in a map inside of | ||
/// a functions DFG. | ||
#[derive(Debug, Default, Clone, Copy)] | ||
pub(crate) struct SigRef(pub(crate) u32); | ||
|
||
#[test] | ||
fn sign_smoke() { | ||
let mut signature = Signature::default(); | ||
|
||
signature.params.push(Typ::Numeric(super::types::NumericType::NativeField)); | ||
signature.returns.push(Typ::Numeric(super::types::NumericType::Unsigned { bit_size: 32 })); | ||
signature.params.push(Type::Numeric(super::types::NumericType::NativeField)); | ||
signature.returns.push(Type::Numeric(super::types::NumericType::Unsigned { bit_size: 32 })); | ||
} |
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
Oops, something went wrong.