Skip to content

Commit

Permalink
Revert "add unnonlocalpass"
Browse files Browse the repository at this point in the history
This reverts commit 970ebb4.
  • Loading branch information
doug-q committed Feb 12, 2025
1 parent 75c7c85 commit f29031c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 58 deletions.
13 changes: 8 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ missing_docs = "warn"
[patch.crates-io]

# Uncomment to use unreleased versions of hugr
hugr = { git = "https://github.com/CQCL/hugr", branch = "doug/un-non-local"}
hugr-core = { git = "https://github.com/CQCL/hugr", branch = "doug/un-non-local"}
hugr-passes = { git = "https://github.com/CQCL/hugr", branch = "doug/un-non-local"}
hugr-cli = { git = "https://github.com/CQCL/hugr", branch = "doug/un-non-local"}
# hugr = { git = "https://github.com/CQCL/hugr", rev = "09bd748398ce5afb39f5628d838756ccc03fc775" }
# hugr-core = { git = "https://github.com/CQCL/hugr", rev = "09bd748398ce5afb39f5628d838756ccc03fc775" }
# hugr-passes = { git = "https://github.com/CQCL/hugr", rev = "09bd748398ce5afb39f5628d838756ccc03fc775" }
# hugr-cli = { git = "https://github.com/CQCL/hugr", rev = "09bd748398ce5afb39f5628d838756ccc03fc775" }
# hugr-model = { git = "https://github.com/CQCL/hugr", rev = "09bd748398ce5afb39f5628d838756ccc03fc775" }
# portgraph = { git = "https://github.com/CQCL/portgraph", rev = "68b96ac737e0c285d8c543b2d74a7aa80a18202c" }

Expand Down
49 changes: 23 additions & 26 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,10 @@
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1737465171,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"pre-commit-hooks",
"nixpkgs"
]
},
Expand Down Expand Up @@ -122,16 +101,34 @@
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1735882644,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "a5a961387e75ae44cc20f0a57ae463da5e959656",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"fenix": "fenix",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"nixpkgs-2305": "nixpkgs-2305",
"pre-commit-hooks": [
"git-hooks"
]
"pre-commit-hooks": "pre-commit-hooks"
}
},
"rust-analyzer-src": {
Expand Down
27 changes: 4 additions & 23 deletions tket2-hseries/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
use derive_more::{Display, Error, From};
use hugr::{
algorithms::{
const_fold::{ConstFoldError, ConstantFoldPass}, force_order, non_local::{NonLocalEdgesError, UnNonLocalPass}, validation::{ValidatePassError, ValidationLevel}, MonomorphizeError, MonomorphizePass, RemoveDeadFuncsError, RemoveDeadFuncsPass
const_fold::{ConstFoldError, ConstantFoldPass},
force_order,
validation::{ValidatePassError, ValidationLevel},
MonomorphizeError, MonomorphizePass, RemoveDeadFuncsError, RemoveDeadFuncsPass,
},
hugr::HugrError,
Hugr, HugrView,
Expand Down Expand Up @@ -34,7 +37,6 @@ pub struct QSystemPass {
monomorphize: bool,
force_order: bool,
lazify: bool,
unnonlocal: bool,
}

impl Default for QSystemPass {
Expand All @@ -45,7 +47,6 @@ impl Default for QSystemPass {
monomorphize: true,
force_order: true,
lazify: true,
unnonlocal: true,
}
}
}
Expand All @@ -71,8 +72,6 @@ pub enum QSystemPassError {
///
/// [RemoveDeadFuncsPass]: hugr::algorithms::RemoveDeadFuncsError
DCEError(RemoveDeadFuncsError),
/// TODO docs
UnNonLocalError(NonLocalEdgesError),
/// No [FuncDefn] named "main" in [Module].
///
/// [FuncDefn]: hugr::ops::FuncDefn
Expand All @@ -85,10 +84,6 @@ impl QSystemPass {
/// Run `QSystemPass` on the given [Hugr]. `registry` is used for
/// validation, if enabled.
pub fn run(&self, hugr: &mut Hugr) -> Result<(), QSystemPassError> {
if self.unnonlocal {
self.unnonlocal().run(hugr)?;
}

if self.monomorphize {
self.monomorphization().run(hugr)?;

Expand Down Expand Up @@ -177,12 +172,6 @@ impl QSystemPass {
MonomorphizePass::default().validation_level(self.validation_level)
}

fn unnonlocal(&self) -> UnNonLocalPass {
UnNonLocalPass::default().validation_level(self.validation_level)
}



/// Returns a new `QSystemPass` with the given [ValidationLevel].
pub fn with_validation_level(mut self, level: ValidationLevel) -> Self {
self.validation_level = level;
Expand Down Expand Up @@ -229,14 +218,6 @@ impl QSystemPass {
self.lazify = lazify;
self
}

/// TODO docs
pub fn with_unnonlocal(self, unnonlocal: bool) -> Self {
Self {
unnonlocal,
..self
}
}
}

#[cfg(test)]
Expand Down

0 comments on commit f29031c

Please sign in to comment.