Type fixes

This commit is contained in:
Ayaz Hafiz 2023-07-02 10:37:18 -05:00
parent b2d3b52bd5
commit 3e3d3cc7f3
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58
6 changed files with 2 additions and 44 deletions

View File

@ -846,16 +846,6 @@ trait Backend<'a> {
self.load_literal_i64(sym, 0);
}
Expr::FunctionPointer { .. } => todo_lambda_erasure!(),
Expr::Reuse {
tag_layout,
tag_id,
symbol: reused,
arguments,
..
} => {
self.load_literal_symbols(arguments);
self.tag(sym, arguments, tag_layout, *tag_id, Some(*reused));
}
Expr::Reset { symbol, .. } => {
let layout = *self.layout_map().get(symbol).unwrap();

View File

@ -1142,14 +1142,6 @@ impl<'a, 'r> WasmBackend<'a, 'r> {
Expr::FunctionPointer { .. } => todo_lambda_erasure!(),
Expr::Reuse {
tag_layout,
tag_id,
arguments,
symbol: reused,
..
} => self.expr_tag(tag_layout, *tag_id, arguments, sym, storage, Some(*reused)),
Expr::Reset { symbol: arg, .. } => self.expr_reset(*arg, sym, storage),
Expr::ResetRef { symbol: arg, .. } => self.expr_resetref(*arg, sym, storage),

View File

@ -1044,7 +1044,7 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[Ownership] {
PtrCast => arena.alloc_slice_copy(&[owned]),
Alloca => arena.alloc_slice_copy(&[owned]),
PtrClearTagId | PtrCast | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
PtrClearTagId | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
| RefCountDecDataPtr | RefCountIsUnique => {
unreachable!("Only inserted *after* borrow checking: {:?}", op);
}

View File

@ -495,21 +495,6 @@ impl<'a, 'r> Ctx<'a, 'r> {
}
Some(Layout::OPAQUE_PTR)
}
&Expr::Reuse {
symbol,
update_tag_id: _,
update_mode: _,
tag_layout,
tag_id: _,
arguments: _,
} => {
let union = self
.interner
.insert_direct_no_semantic(LayoutRepr::Union(tag_layout));
self.check_sym_layout(symbol, union, UseKind::TagReuse);
// TODO also check update arguments
Some(union)
}
&Expr::Reset {
symbol,
update_mode: _,

View File

@ -1601,7 +1601,7 @@ fn low_level_no_rc(lowlevel: &LowLevel) -> RC {
PtrCast => RC::NoRc,
Alloca => RC::NoRc,
PtrClearTagId | PtrCast | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
PtrClearTagId | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
| RefCountDecDataPtr | RefCountIsUnique => {
unreachable!("Only inserted *after* borrow checking: {:?}", lowlevel);
}

View File

@ -1900,15 +1900,6 @@ pub enum Expr<'a> {
lambda_name: LambdaName<'a>,
},
Reuse {
symbol: Symbol,
update_tag_id: bool,
update_mode: UpdateModeId,
// normal Tag fields
tag_layout: UnionLayout<'a>,
tag_id: TagIdIntType,
arguments: &'a [Symbol],
},
Reset {
symbol: Symbol,
update_mode: UpdateModeId,