mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-13 18:05:28 +00:00
module: delete LowLevel enum variant ListMapWithIndex
This commit is contained in:
parent
a129e0458c
commit
eb2ac4c82b
5 changed files with 4 additions and 13 deletions
|
|
@ -5976,7 +5976,7 @@ fn run_low_level<'a, 'ctx, 'env>(
|
||||||
set
|
set
|
||||||
}
|
}
|
||||||
|
|
||||||
ListMap | ListMap2 | ListMap3 | ListMap4 | ListMapWithIndex | ListSortWith | DictWalk => {
|
ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith | DictWalk => {
|
||||||
unreachable!("these are higher order, and are handled elsewhere")
|
unreachable!("these are higher order, and are handled elsewhere")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ impl<'a> LowLevelCall<'a> {
|
||||||
|
|
||||||
ListIsUnique => self.load_args_and_call_zig(backend, bitcode::LIST_IS_UNIQUE),
|
ListIsUnique => self.load_args_and_call_zig(backend, bitcode::LIST_IS_UNIQUE),
|
||||||
|
|
||||||
ListMap | ListMap2 | ListMap3 | ListMap4 | ListMapWithIndex | ListSortWith
|
ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith
|
||||||
| DictWalk => {
|
| DictWalk => {
|
||||||
internal_error!("HigherOrder lowlevels should not be handled here")
|
internal_error!("HigherOrder lowlevels should not be handled here")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ pub enum LowLevel {
|
||||||
ListMap2,
|
ListMap2,
|
||||||
ListMap3,
|
ListMap3,
|
||||||
ListMap4,
|
ListMap4,
|
||||||
ListMapWithIndex,
|
|
||||||
ListSortWith,
|
ListSortWith,
|
||||||
ListSublist,
|
ListSublist,
|
||||||
ListDropAt,
|
ListDropAt,
|
||||||
|
|
@ -120,7 +119,7 @@ pub enum LowLevel {
|
||||||
|
|
||||||
macro_rules! higher_order {
|
macro_rules! higher_order {
|
||||||
() => {
|
() => {
|
||||||
ListMap | ListMap2 | ListMap3 | ListMap4 | ListMapWithIndex | ListSortWith | DictWalk
|
ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith | DictWalk
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,7 +140,6 @@ impl LowLevel {
|
||||||
ListMap2 => 2,
|
ListMap2 => 2,
|
||||||
ListMap3 => 3,
|
ListMap3 => 3,
|
||||||
ListMap4 => 4,
|
ListMap4 => 4,
|
||||||
ListMapWithIndex => 1,
|
|
||||||
ListSortWith => 1,
|
ListSortWith => 1,
|
||||||
DictWalk => 2,
|
DictWalk => 2,
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
|
|
@ -206,7 +204,6 @@ impl LowLevelWrapperType {
|
||||||
Symbol::LIST_MAP2 => WrapperIsRequired,
|
Symbol::LIST_MAP2 => WrapperIsRequired,
|
||||||
Symbol::LIST_MAP3 => WrapperIsRequired,
|
Symbol::LIST_MAP3 => WrapperIsRequired,
|
||||||
Symbol::LIST_MAP4 => WrapperIsRequired,
|
Symbol::LIST_MAP4 => WrapperIsRequired,
|
||||||
Symbol::LIST_MAP_WITH_INDEX => WrapperIsRequired,
|
|
||||||
Symbol::LIST_SORT_WITH => WrapperIsRequired,
|
Symbol::LIST_SORT_WITH => WrapperIsRequired,
|
||||||
Symbol::LIST_SUBLIST => WrapperIsRequired,
|
Symbol::LIST_SUBLIST => WrapperIsRequired,
|
||||||
Symbol::LIST_DROP_AT => CanBeReplacedBy(ListDropAt),
|
Symbol::LIST_DROP_AT => CanBeReplacedBy(ListDropAt),
|
||||||
|
|
|
||||||
|
|
@ -906,7 +906,7 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[bool] {
|
||||||
StrToNum => arena.alloc_slice_copy(&[borrowed]),
|
StrToNum => arena.alloc_slice_copy(&[borrowed]),
|
||||||
ListPrepend => arena.alloc_slice_copy(&[owned, owned]),
|
ListPrepend => arena.alloc_slice_copy(&[owned, owned]),
|
||||||
StrJoinWith => arena.alloc_slice_copy(&[borrowed, borrowed]),
|
StrJoinWith => arena.alloc_slice_copy(&[borrowed, borrowed]),
|
||||||
ListMap | ListMapWithIndex => arena.alloc_slice_copy(&[owned, function, closure_data]),
|
ListMap => arena.alloc_slice_copy(&[owned, function, closure_data]),
|
||||||
ListMap2 => arena.alloc_slice_copy(&[owned, owned, function, closure_data]),
|
ListMap2 => arena.alloc_slice_copy(&[owned, owned, function, closure_data]),
|
||||||
ListMap3 => arena.alloc_slice_copy(&[owned, owned, owned, function, closure_data]),
|
ListMap3 => arena.alloc_slice_copy(&[owned, owned, owned, function, closure_data]),
|
||||||
ListMap4 => arena.alloc_slice_copy(&[owned, owned, owned, owned, function, closure_data]),
|
ListMap4 => arena.alloc_slice_copy(&[owned, owned, owned, owned, function, closure_data]),
|
||||||
|
|
|
||||||
|
|
@ -5108,12 +5108,6 @@ pub fn with_hole<'a>(
|
||||||
let xs = arg_symbols[0];
|
let xs = arg_symbols[0];
|
||||||
match_on_closure_argument!(ListMap, [xs])
|
match_on_closure_argument!(ListMap, [xs])
|
||||||
}
|
}
|
||||||
|
|
||||||
ListMapWithIndex => {
|
|
||||||
debug_assert_eq!(arg_symbols.len(), 2);
|
|
||||||
let xs = arg_symbols[0];
|
|
||||||
match_on_closure_argument!(ListMapWithIndex, [xs])
|
|
||||||
}
|
|
||||||
ListSortWith => {
|
ListSortWith => {
|
||||||
debug_assert_eq!(arg_symbols.len(), 2);
|
debug_assert_eq!(arg_symbols.len(), 2);
|
||||||
let xs = arg_symbols[0];
|
let xs = arg_symbols[0];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue