Skip to content

Commit

Permalink
GC find_main
Browse files Browse the repository at this point in the history
  • Loading branch information
acl-cqc committed Jan 29, 2025
1 parent 3b89bcb commit 9f477b0
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions hugr-passes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ mod half_node;
pub mod lower;
pub mod merge_bbs;
mod monomorphize;
use hugr_core::{HugrView, Node};
// TODO: Deprecated re-export. Remove on a breaking release.
#[deprecated(
since = "0.14.1",
Expand All @@ -33,15 +32,3 @@ pub mod validation;
pub use force_order::{force_order, force_order_by_key};
pub use lower::{lower_ops, replace_many_ops};
pub use non_local::{ensure_no_nonlocal_edges, nonlocal_edges};

fn find_main(h: &impl HugrView) -> Option<Node> {
let root = h.root();
if !h.get_optype(root).is_module() {
return None;
}
h.children(root).find(|n| {
h.get_optype(*n)
.as_func_defn()
.is_some_and(|f| f.name == "main")
})
}

0 comments on commit 9f477b0

Please sign in to comment.