mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
remove transitive builtins
This commit is contained in:
parent
7b308d9efe
commit
4956fc5ef4
2 changed files with 0 additions and 25 deletions
|
@ -244,21 +244,6 @@ map_symbol_to_lowlevel_and_arity! {
|
|||
/// lookup (if the bounds check passed). That internal function is hardcoded in code gen,
|
||||
/// which works fine because it doesn't involve any open tag unions.
|
||||
|
||||
/// Does a builtin depend on any other builtins?
|
||||
///
|
||||
/// NOTE: you are supposed to give all symbols that are relied on,
|
||||
/// even those that are relied on transitively!
|
||||
pub fn builtin_dependencies(symbol: Symbol) -> &'static [Symbol] {
|
||||
match symbol {
|
||||
Symbol::LIST_SORT_ASC => &[Symbol::LIST_SORT_WITH, Symbol::NUM_COMPARE],
|
||||
Symbol::LIST_SORT_DESC => &[Symbol::LIST_SORT_WITH],
|
||||
Symbol::LIST_PRODUCT => &[Symbol::LIST_WALK, Symbol::NUM_MUL],
|
||||
Symbol::LIST_SUM => &[Symbol::LIST_WALK, Symbol::NUM_ADD],
|
||||
Symbol::LIST_SET => &[Symbol::LIST_REPLACE],
|
||||
_ => &[],
|
||||
}
|
||||
}
|
||||
|
||||
/// Implementation for a builtin
|
||||
pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def> {
|
||||
debug_assert!(symbol.is_builtin());
|
||||
|
|
|
@ -415,16 +415,6 @@ pub fn canonicalize_module_defs<'a>(
|
|||
referenced_values.extend(env.qualified_value_lookups.iter().copied());
|
||||
referenced_types.extend(env.qualified_type_lookups.iter().copied());
|
||||
|
||||
// add any builtins used by other builtins
|
||||
let transitive_builtins: Vec<Symbol> = referenced_values
|
||||
.iter()
|
||||
.filter(|s| s.is_builtin())
|
||||
.flat_map(|s| crate::builtins::builtin_dependencies(*s))
|
||||
.copied()
|
||||
.collect();
|
||||
|
||||
referenced_values.extend(transitive_builtins);
|
||||
|
||||
// NOTE previously we inserted builtin defs into the list of defs here
|
||||
// this is now done later, in file.rs.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue