Collect references to functions passed to HOLLs in borrow inference

During borrow inference, SCCs of references between procs are first
constructed. Previously we didn't collect any references for HOLL calls,
but since such calls pass a Roc-function, we need to include a reference
to the Roc function.
This commit is contained in:
Ayaz Hafiz 2022-12-28 13:48:30 -06:00
parent 3bc78c2251
commit a31b617ac8
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -1,7 +1,9 @@
use std::collections::HashMap;
use std::hash::Hash;
use crate::ir::{Expr, HigherOrderLowLevel, JoinPointId, Param, Proc, ProcLayout, Stmt};
use crate::ir::{
Expr, HigherOrderLowLevel, JoinPointId, Param, PassedFunction, Proc, ProcLayout, Stmt,
};
use crate::layout::Layout;
use bumpalo::collections::Vec;
use bumpalo::Bump;
@ -977,7 +979,12 @@ fn call_info_call<'a>(call: &crate::ir::Call<'a>, info: &mut CallInfo<'a>) {
}
Foreign { .. } => {}
LowLevel { .. } => {}
HigherOrder(_) => {}
HigherOrder(HigherOrderLowLevel {
passed_function: PassedFunction { name, .. },
..
}) => {
info.keys.push(name.name());
}
}
}