remove dbg lowlevel

This commit is contained in:
Folkert 2022-12-22 02:45:09 +01:00
parent f76df8a356
commit 4ef541395a
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C
7 changed files with 2 additions and 53 deletions

View File

@ -1288,14 +1288,6 @@ fn lowlevel_spec<'a>(
builder.add_make_tuple(block, &[byte_index, string, is_ok, problem_code])
}
Dbg => {
let arguments = [env.symbols[&arguments[0]]];
let result_type =
layout_spec(env, builder, interner, layout, &WhenRecursive::Unreachable)?;
builder.add_unknown_with(block, &arguments, result_type)
}
_other => {
// println!("missing {:?}", _other);
// TODO overly pessimstic

View File

@ -87,7 +87,6 @@ macro_rules! map_symbol_to_lowlevel_and_arity {
LowLevel::PtrCast => unimplemented!(),
LowLevel::RefCountInc => unimplemented!(),
LowLevel::RefCountDec => unimplemented!(),
LowLevel::Dbg => unimplemented!(),
// these are not implemented, not sure why
LowLevel::StrFromInt => unimplemented!(),

View File

@ -11,7 +11,7 @@ use roc_builtins::bitcode::{self, FloatWidth, IntWidth};
use roc_error_macros::internal_error;
use roc_module::{low_level::LowLevel, symbol::Symbol};
use roc_mono::{
ir::{HigherOrderLowLevel, LookupType},
ir::HigherOrderLowLevel,
layout::{Builtin, LambdaSet, Layout, LayoutIds},
};
use roc_target::PtrWidth;
@ -1149,36 +1149,6 @@ pub(crate) fn run_low_level<'a, 'ctx, 'env>(
ptr.into()
}
},
Dbg => {
assert_eq!(args.len(), 2);
let condition = load_symbol(scope, &args[0]);
let dbg_spec_var_symbol = args[1];
if env.mode.runs_expects() {
let region = unsafe { std::mem::transmute::<_, roc_region::all::Region>(args[0]) };
let shared_memory = crate::llvm::expect::SharedMemoryPointer::get(env);
// HACK(dbg-spec-var): the specialized type variable is passed along as a fake symbol
let specialized_var =
unsafe { LookupType::from_index(dbg_spec_var_symbol.ident_id().index() as _) };
crate::llvm::expect::clone_to_shared_memory(
env,
scope,
layout_ids,
&shared_memory,
args[0],
region,
&[args[0]],
&[specialized_var],
);
crate::llvm::expect::notify_parent_dbg(env, &shared_memory);
}
condition
}
}
}

View File

@ -1867,8 +1867,6 @@ impl<'a> LowLevelCall<'a> {
},
StoredValue::StackMemory { .. } => { /* do nothing */ }
},
Dbg => todo!("{:?}", self.lowlevel),
}
}

View File

@ -112,7 +112,6 @@ pub enum LowLevel {
RefCountDec,
BoxExpr,
UnboxExpr,
Dbg,
Unreachable,
}
@ -215,7 +214,6 @@ macro_rules! map_symbol_to_lowlevel {
LowLevel::PtrCast => unimplemented!(),
LowLevel::RefCountInc => unimplemented!(),
LowLevel::RefCountDec => unimplemented!(),
LowLevel::Dbg => unreachable!(),
// these are not implemented, not sure why
LowLevel::StrFromInt => unimplemented!(),

View File

@ -953,8 +953,6 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[bool] {
ListIsUnique => arena.alloc_slice_copy(&[borrowed]),
Dbg => arena.alloc_slice_copy(&[borrowed, /* dbg-spec-var */ irrelevant]),
BoxExpr | UnboxExpr => {
unreachable!("These lowlevel operations are turned into mono Expr's")
}

View File

@ -562,13 +562,7 @@ impl<'a, 'i> Context<'a, 'i> {
match &call_type {
LowLevel { op, .. } => {
let ps = crate::borrow::lowlevel_borrow_signature(self.arena, *op);
let b = match op {
roc_module::low_level::LowLevel::Dbg => {
// NB(dbg-spec-var) second var is the Variable
self.add_dec_after_lowlevel(&arguments[..1], ps, b, b_live_vars)
}
_ => self.add_dec_after_lowlevel(arguments, ps, b, b_live_vars),
};
let b = self.add_dec_after_lowlevel(arguments, ps, b, b_live_vars);
let v = Expr::Call(crate::ir::Call {
call_type,