remove box and unbox expressions

This commit is contained in:
Folkert 2023-07-05 18:01:00 +02:00
parent a9813aeae7
commit d64930c17f
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
12 changed files with 9 additions and 196 deletions

View file

@ -149,12 +149,6 @@ impl<'a> LastSeenMap<'a> {
self.set_last_seen(*sym, stmt);
}
}
Expr::ExprBox { symbol } => {
self.set_last_seen(*symbol, stmt);
}
Expr::ExprUnbox { symbol } => {
self.set_last_seen(*symbol, stmt);
}
Expr::Struct(syms) => {
for sym in *syms {
self.set_last_seen(*sym, stmt);
@ -842,21 +836,6 @@ trait Backend<'a> {
let reuse = reuse.map(|ru| ru.symbol);
self.tag(sym, arguments, tag_layout, *tag_id, reuse);
}
Expr::ExprBox { symbol: value } => {
let element_layout = match self.interner().get_repr(*layout) {
LayoutRepr::Boxed(boxed) => boxed,
_ => unreachable!("{:?}", self.interner().dbg(*layout)),
};
self.load_literal_symbols([*value].as_slice());
self.expr_box(*sym, *value, element_layout, None)
}
Expr::ExprUnbox { symbol: ptr } => {
let element_layout = *layout;
self.load_literal_symbols([*ptr].as_slice());
self.expr_unbox(*sym, *ptr, element_layout)
}
Expr::NullPointer => {
self.load_literal_i64(sym, 0);
}