Skip to content

Commit

Permalink
Sort ports when compiling refs (fix #2016) (#2018)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsyo authored Apr 25, 2024
1 parent 56b99c5 commit c286cb7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions calyx-opt/src/passes/compile_invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,12 @@ impl RefPortMap {
/// Get all of the newly added ports associated with a component that had
/// ref cells
fn get_ports(&self, comp_name: &ir::Id) -> Option<Vec<RRC<ir::Port>>> {
self.0
.get(comp_name)
.map(|map| map.values().cloned().collect())
self.0.get(comp_name).map(|map| {
map.values()
.cloned()
.sorted_by(|a, b| a.borrow().name.cmp(&b.borrow().name))
.collect()
})
}
}

Expand Down

0 comments on commit c286cb7

Please sign in to comment.