appease the clipman

This commit is contained in:
Folkert 2020-08-19 23:46:56 +02:00
parent fa5e5ab201
commit bfa11cf6b0
4 changed files with 8 additions and 15 deletions

View file

@ -207,7 +207,6 @@ pub fn list_prepend<'a, 'ctx, 'env>(
let ptr_bytes = env.ptr_bytes;
// 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 int_type = ptr_int(ctx, ptr_bytes);
let ptr_as_int = builder.build_ptr_to_int(clone_ptr, int_type, "list_cast_ptr");

View file

@ -313,7 +313,7 @@ impl<'a> BorrowInfState<'a> {
..
} => {
// 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,
None => Vec::from_iter_in(
arg_layouts.iter().cloned().map(|layout| Param {
@ -356,7 +356,7 @@ impl<'a> BorrowInfState<'a> {
Stmt::Ret(z),
) = (v, b)
{
let g = call_type.into_inner();
let g = call_type.get_inner();
if self.current_proc == g && x == *z {
// anonymous functions (for which the ps may not be known)
// 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::*;
// TODO is true or false more efficient for non-refcounted layouts?

View file

@ -444,10 +444,8 @@ impl<'a> Context<'a> {
call_type,
..
} => {
let symbol = call_type.into_inner();
// 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,
None => Vec::from_iter_in(
arg_layouts.iter().cloned().map(|layout| Param {
@ -786,14 +784,10 @@ pub fn collect_stmt(
vars.extend(arguments.iter().copied());
// NOTE deviation from Lean
match jp_live_vars.get(id) {
Some(jvars) => {
// we fall through when no join point is available
if let Some(jvars) = jp_live_vars.get(id) {
vars.extend(jvars);
}
None => {
// a jump occured in the "remainder" of the join point, e.g.
}
}
vars
}

View file

@ -525,7 +525,7 @@ pub enum CallType {
}
impl CallType {
pub fn into_inner(&self) -> Symbol {
pub fn get_inner(&self) -> Symbol {
match self {
CallType::ByName(s) => *s,
CallType::ByPointer(s) => *s,