This commit is contained in:
Richard Feldman 2020-06-20 13:45:03 -04:00
parent 920b530008
commit 461e166254
16 changed files with 279 additions and 488 deletions

View file

@ -137,11 +137,16 @@ pub fn canonicalize_module_defs<'a>(
let mut references = MutSet::default();
// Gather up all the symbols that were referenced across all the defs.
// Gather up all the symbols that were referenced across all the defs' lookups.
for symbol in output.references.lookups.iter() {
references.insert(*symbol);
}
// Gather up all the symbols that were referenced across all the defs' calls.
for symbol in output.references.calls.iter() {
references.insert(*symbol);
}
// Gather up all the symbols that were referenced from other modules.
for symbol in env.referenced_symbols.iter() {
references.insert(*symbol);
@ -231,6 +236,11 @@ pub fn canonicalize_module_defs<'a>(
references.insert(symbol);
}
// Incorporate any remaining output.calls entries into references.
for symbol in output.references.calls {
references.insert(symbol);
}
Ok(ModuleOutput {
aliases,
rigid_variables,