mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Merge pull request #6486 from roc-lang/remove-unused-lowlevel
Remove unused lowlevel StrGetCapacity
This commit is contained in:
commit
0e7fee4e7f
6 changed files with 3 additions and 13 deletions
|
@ -128,7 +128,6 @@ map_symbol_to_lowlevel_and_arity! {
|
||||||
StrSubstringUnsafe; STR_SUBSTRING_UNSAFE; 3,
|
StrSubstringUnsafe; STR_SUBSTRING_UNSAFE; 3,
|
||||||
StrReserve; STR_RESERVE; 2,
|
StrReserve; STR_RESERVE; 2,
|
||||||
StrToNum; STR_TO_NUM; 1,
|
StrToNum; STR_TO_NUM; 1,
|
||||||
StrGetCapacity; STR_CAPACITY; 1,
|
|
||||||
StrWithCapacity; STR_WITH_CAPACITY; 1,
|
StrWithCapacity; STR_WITH_CAPACITY; 1,
|
||||||
StrReleaseExcessCapacity; STR_RELEASE_EXCESS_CAPACITY; 1,
|
StrReleaseExcessCapacity; STR_RELEASE_EXCESS_CAPACITY; 1,
|
||||||
|
|
||||||
|
|
|
@ -533,12 +533,6 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
||||||
bitcode::STR_COUNT_UTF8_BYTES,
|
bitcode::STR_COUNT_UTF8_BYTES,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
StrGetCapacity => {
|
|
||||||
// Str.capacity : Str -> Nat
|
|
||||||
arguments!(string);
|
|
||||||
|
|
||||||
call_bitcode_fn(env, &[string], bitcode::STR_CAPACITY)
|
|
||||||
}
|
|
||||||
StrSubstringUnsafe => {
|
StrSubstringUnsafe => {
|
||||||
// Str.substringUnsafe : Str, Nat, Nat -> Str
|
// Str.substringUnsafe : Str, Nat, Nat -> Str
|
||||||
arguments!(string, start, length);
|
arguments!(string, start, length);
|
||||||
|
|
|
@ -204,7 +204,6 @@ impl<'a> LowLevelCall<'a> {
|
||||||
StrCountUtf8Bytes => {
|
StrCountUtf8Bytes => {
|
||||||
self.load_args_and_call_zig(backend, bitcode::STR_COUNT_UTF8_BYTES)
|
self.load_args_and_call_zig(backend, bitcode::STR_COUNT_UTF8_BYTES)
|
||||||
}
|
}
|
||||||
StrGetCapacity => self.load_args_and_call_zig(backend, bitcode::STR_CAPACITY),
|
|
||||||
StrToNum => {
|
StrToNum => {
|
||||||
let number_layout = match backend.layout_interner.get_repr(self.ret_layout) {
|
let number_layout = match backend.layout_interner.get_repr(self.ret_layout) {
|
||||||
LayoutRepr::Struct(field_layouts) => field_layouts[0],
|
LayoutRepr::Struct(field_layouts) => field_layouts[0],
|
||||||
|
|
|
@ -24,7 +24,6 @@ pub enum LowLevel {
|
||||||
StrGetUnsafe,
|
StrGetUnsafe,
|
||||||
StrSubstringUnsafe,
|
StrSubstringUnsafe,
|
||||||
StrReserve,
|
StrReserve,
|
||||||
StrGetCapacity,
|
|
||||||
StrWithCapacity,
|
StrWithCapacity,
|
||||||
StrReleaseExcessCapacity,
|
StrReleaseExcessCapacity,
|
||||||
ListLen,
|
ListLen,
|
||||||
|
@ -271,7 +270,6 @@ map_symbol_to_lowlevel! {
|
||||||
StrSubstringUnsafe <= STR_SUBSTRING_UNSAFE;
|
StrSubstringUnsafe <= STR_SUBSTRING_UNSAFE;
|
||||||
StrReserve <= STR_RESERVE;
|
StrReserve <= STR_RESERVE;
|
||||||
StrToNum <= STR_TO_NUM;
|
StrToNum <= STR_TO_NUM;
|
||||||
StrGetCapacity <= STR_CAPACITY;
|
|
||||||
StrWithCapacity <= STR_WITH_CAPACITY;
|
StrWithCapacity <= STR_WITH_CAPACITY;
|
||||||
StrReleaseExcessCapacity <= STR_RELEASE_EXCESS_CAPACITY;
|
StrReleaseExcessCapacity <= STR_RELEASE_EXCESS_CAPACITY;
|
||||||
ListLen <= LIST_LEN;
|
ListLen <= LIST_LEN;
|
||||||
|
|
|
@ -1533,8 +1533,8 @@ fn low_level_no_rc(lowlevel: &LowLevel) -> RC {
|
||||||
|
|
||||||
match lowlevel {
|
match lowlevel {
|
||||||
Unreachable => RC::Uknown,
|
Unreachable => RC::Uknown,
|
||||||
ListLen | StrIsEmpty | StrCountUtf8Bytes | StrGetCapacity | ListGetCapacity
|
ListLen | StrIsEmpty | StrCountUtf8Bytes | ListGetCapacity | ListWithCapacity
|
||||||
| ListWithCapacity | StrWithCapacity => RC::NoRc,
|
| StrWithCapacity => RC::NoRc,
|
||||||
ListReplaceUnsafe => RC::Rc,
|
ListReplaceUnsafe => RC::Rc,
|
||||||
StrGetUnsafe | ListGetUnsafe => RC::NoRc,
|
StrGetUnsafe | ListGetUnsafe => RC::NoRc,
|
||||||
ListConcat => RC::Rc,
|
ListConcat => RC::Rc,
|
||||||
|
|
|
@ -1283,7 +1283,7 @@ fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[Ownership] {
|
||||||
match op {
|
match op {
|
||||||
Unreachable => arena.alloc_slice_copy(&[irrelevant]),
|
Unreachable => arena.alloc_slice_copy(&[irrelevant]),
|
||||||
DictPseudoSeed => arena.alloc_slice_copy(&[irrelevant]),
|
DictPseudoSeed => arena.alloc_slice_copy(&[irrelevant]),
|
||||||
ListLen | StrIsEmpty | StrCountUtf8Bytes | StrGetCapacity | ListGetCapacity => {
|
ListLen | StrIsEmpty | StrCountUtf8Bytes | ListGetCapacity => {
|
||||||
arena.alloc_slice_copy(&[borrowed])
|
arena.alloc_slice_copy(&[borrowed])
|
||||||
}
|
}
|
||||||
ListWithCapacity | StrWithCapacity => arena.alloc_slice_copy(&[irrelevant]),
|
ListWithCapacity | StrWithCapacity => arena.alloc_slice_copy(&[irrelevant]),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue