Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions libs/pavexc/src/compiler/analyses/call_graph/core_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ where
let root_node_index = add_node_for_component(&mut call_graph, &mut node_deduplicator, root_id);
let mut nodes_to_be_visited: IndexSet<VisitorStackElement> =
IndexSet::from_iter([VisitorStackElement::orphan(root_node_index)]);
let mut processed_nodes = HashSet::new();

loop {
while let Some(node_to_be_visited) = nodes_to_be_visited.pop() {
Expand All @@ -179,6 +180,11 @@ where
}
}

// We've already processed dependencies for this node.
if processed_nodes.contains(&current_index) {
continue;
}

// We need to recursively build the input types for all our compute components;
if let CallGraphNode::Compute { component_id, .. } = call_graph[current_index].clone() {
let component = component_db.hydrated_component(component_id, computation_db);
Expand Down Expand Up @@ -243,6 +249,8 @@ where
}
}
}

processed_nodes.insert(current_index);
}

let indexes = call_graph.node_indices().collect::<Vec<_>>();
Expand Down