mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
appease the clipman
This commit is contained in:
parent
fa5e5ab201
commit
bfa11cf6b0
4 changed files with 8 additions and 15 deletions
|
@ -207,7 +207,6 @@ pub fn list_prepend<'a, 'ctx, 'env>(
|
||||||
let ptr_bytes = env.ptr_bytes;
|
let ptr_bytes = env.ptr_bytes;
|
||||||
|
|
||||||
// Allocate space for the new array that we'll copy into.
|
// Allocate space for the new array that we'll copy into.
|
||||||
let elem_type = basic_type_from_layout(env.arena, ctx, elem_layout, env.ptr_bytes);
|
|
||||||
let clone_ptr = allocate_list(env, elem_layout, new_list_len);
|
let clone_ptr = allocate_list(env, elem_layout, new_list_len);
|
||||||
let int_type = ptr_int(ctx, ptr_bytes);
|
let int_type = ptr_int(ctx, ptr_bytes);
|
||||||
let ptr_as_int = builder.build_ptr_to_int(clone_ptr, int_type, "list_cast_ptr");
|
let ptr_as_int = builder.build_ptr_to_int(clone_ptr, int_type, "list_cast_ptr");
|
||||||
|
|
|
@ -313,7 +313,7 @@ impl<'a> BorrowInfState<'a> {
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
// get the borrow signature of the applied function
|
// get the borrow signature of the applied function
|
||||||
let ps = match self.param_map.get_symbol(call_type.into_inner()) {
|
let ps = match self.param_map.get_symbol(call_type.get_inner()) {
|
||||||
Some(slice) => slice,
|
Some(slice) => slice,
|
||||||
None => Vec::from_iter_in(
|
None => Vec::from_iter_in(
|
||||||
arg_layouts.iter().cloned().map(|layout| Param {
|
arg_layouts.iter().cloned().map(|layout| Param {
|
||||||
|
@ -356,7 +356,7 @@ impl<'a> BorrowInfState<'a> {
|
||||||
Stmt::Ret(z),
|
Stmt::Ret(z),
|
||||||
) = (v, b)
|
) = (v, b)
|
||||||
{
|
{
|
||||||
let g = call_type.into_inner();
|
let g = call_type.get_inner();
|
||||||
if self.current_proc == g && x == *z {
|
if self.current_proc == g && x == *z {
|
||||||
// anonymous functions (for which the ps may not be known)
|
// anonymous functions (for which the ps may not be known)
|
||||||
// can never be tail-recursive, so this is fine
|
// can never be tail-recursive, so this is fine
|
||||||
|
@ -460,7 +460,7 @@ impl<'a> BorrowInfState<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn lowlevel_borrow_signature<'a>(arena: &'a Bump, op: LowLevel) -> &'a [bool] {
|
pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[bool] {
|
||||||
use LowLevel::*;
|
use LowLevel::*;
|
||||||
|
|
||||||
// TODO is true or false more efficient for non-refcounted layouts?
|
// TODO is true or false more efficient for non-refcounted layouts?
|
||||||
|
|
|
@ -444,10 +444,8 @@ impl<'a> Context<'a> {
|
||||||
call_type,
|
call_type,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
let symbol = call_type.into_inner();
|
|
||||||
|
|
||||||
// get the borrow signature
|
// get the borrow signature
|
||||||
let ps = match self.param_map.get_symbol(call_type.into_inner()) {
|
let ps = match self.param_map.get_symbol(call_type.get_inner()) {
|
||||||
Some(slice) => slice,
|
Some(slice) => slice,
|
||||||
None => Vec::from_iter_in(
|
None => Vec::from_iter_in(
|
||||||
arg_layouts.iter().cloned().map(|layout| Param {
|
arg_layouts.iter().cloned().map(|layout| Param {
|
||||||
|
@ -786,14 +784,10 @@ pub fn collect_stmt(
|
||||||
vars.extend(arguments.iter().copied());
|
vars.extend(arguments.iter().copied());
|
||||||
|
|
||||||
// NOTE deviation from Lean
|
// NOTE deviation from Lean
|
||||||
match jp_live_vars.get(id) {
|
// we fall through when no join point is available
|
||||||
Some(jvars) => {
|
if let Some(jvars) = jp_live_vars.get(id) {
|
||||||
vars.extend(jvars);
|
vars.extend(jvars);
|
||||||
}
|
}
|
||||||
None => {
|
|
||||||
// a jump occured in the "remainder" of the join point, e.g.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vars
|
vars
|
||||||
}
|
}
|
||||||
|
|
|
@ -525,7 +525,7 @@ pub enum CallType {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CallType {
|
impl CallType {
|
||||||
pub fn into_inner(&self) -> Symbol {
|
pub fn get_inner(&self) -> Symbol {
|
||||||
match self {
|
match self {
|
||||||
CallType::ByName(s) => *s,
|
CallType::ByName(s) => *s,
|
||||||
CallType::ByPointer(s) => *s,
|
CallType::ByPointer(s) => *s,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue