mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +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,
|
||||
StrReserve; STR_RESERVE; 2,
|
||||
StrToNum; STR_TO_NUM; 1,
|
||||
StrGetCapacity; STR_CAPACITY; 1,
|
||||
StrWithCapacity; STR_WITH_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,
|
||||
)
|
||||
}
|
||||
StrGetCapacity => {
|
||||
// Str.capacity : Str -> Nat
|
||||
arguments!(string);
|
||||
|
||||
call_bitcode_fn(env, &[string], bitcode::STR_CAPACITY)
|
||||
}
|
||||
StrSubstringUnsafe => {
|
||||
// Str.substringUnsafe : Str, Nat, Nat -> Str
|
||||
arguments!(string, start, length);
|
||||
|
|
|
@ -204,7 +204,6 @@ impl<'a> LowLevelCall<'a> {
|
|||
StrCountUtf8Bytes => {
|
||||
self.load_args_and_call_zig(backend, bitcode::STR_COUNT_UTF8_BYTES)
|
||||
}
|
||||
StrGetCapacity => self.load_args_and_call_zig(backend, bitcode::STR_CAPACITY),
|
||||
StrToNum => {
|
||||
let number_layout = match backend.layout_interner.get_repr(self.ret_layout) {
|
||||
LayoutRepr::Struct(field_layouts) => field_layouts[0],
|
||||
|
|
|
@ -24,7 +24,6 @@ pub enum LowLevel {
|
|||
StrGetUnsafe,
|
||||
StrSubstringUnsafe,
|
||||
StrReserve,
|
||||
StrGetCapacity,
|
||||
StrWithCapacity,
|
||||
StrReleaseExcessCapacity,
|
||||
ListLen,
|
||||
|
@ -271,7 +270,6 @@ map_symbol_to_lowlevel! {
|
|||
StrSubstringUnsafe <= STR_SUBSTRING_UNSAFE;
|
||||
StrReserve <= STR_RESERVE;
|
||||
StrToNum <= STR_TO_NUM;
|
||||
StrGetCapacity <= STR_CAPACITY;
|
||||
StrWithCapacity <= STR_WITH_CAPACITY;
|
||||
StrReleaseExcessCapacity <= STR_RELEASE_EXCESS_CAPACITY;
|
||||
ListLen <= LIST_LEN;
|
||||
|
|
|
@ -1533,8 +1533,8 @@ fn low_level_no_rc(lowlevel: &LowLevel) -> RC {
|
|||
|
||||
match lowlevel {
|
||||
Unreachable => RC::Uknown,
|
||||
ListLen | StrIsEmpty | StrCountUtf8Bytes | StrGetCapacity | ListGetCapacity
|
||||
| ListWithCapacity | StrWithCapacity => RC::NoRc,
|
||||
ListLen | StrIsEmpty | StrCountUtf8Bytes | ListGetCapacity | ListWithCapacity
|
||||
| StrWithCapacity => RC::NoRc,
|
||||
ListReplaceUnsafe => RC::Rc,
|
||||
StrGetUnsafe | ListGetUnsafe => RC::NoRc,
|
||||
ListConcat => RC::Rc,
|
||||
|
|
|
@ -1283,7 +1283,7 @@ fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[Ownership] {
|
|||
match op {
|
||||
Unreachable => 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])
|
||||
}
|
||||
ListWithCapacity | StrWithCapacity => arena.alloc_slice_copy(&[irrelevant]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue