mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
WIP
This commit is contained in:
parent
4a9514d2c4
commit
0247237fe8
16 changed files with 625 additions and 163 deletions
|
@ -163,6 +163,9 @@ impl<'a> LastSeenMap<'a> {
|
|||
Expr::UnionAtIndex { structure, .. } => {
|
||||
self.set_last_seen(*structure, stmt);
|
||||
}
|
||||
Expr::UnionFieldPtrAtIndex { structure, .. } => {
|
||||
self.set_last_seen(*structure, stmt);
|
||||
}
|
||||
Expr::Array { elems, .. } => {
|
||||
for elem in *elems {
|
||||
if let ListLiteralElement::Symbol(sym) = elem {
|
||||
|
@ -794,6 +797,14 @@ trait Backend<'a> {
|
|||
} => {
|
||||
self.load_union_at_index(sym, structure, *tag_id, *index, union_layout);
|
||||
}
|
||||
Expr::UnionFieldPtrAtIndex {
|
||||
structure,
|
||||
tag_id,
|
||||
union_layout,
|
||||
index,
|
||||
} => {
|
||||
todo!();
|
||||
}
|
||||
Expr::GetTagId {
|
||||
structure,
|
||||
union_layout,
|
||||
|
@ -1581,7 +1592,7 @@ trait Backend<'a> {
|
|||
|
||||
self.build_ptr_cast(sym, &args[0])
|
||||
}
|
||||
LowLevel::PtrWrite => {
|
||||
LowLevel::PtrStore => {
|
||||
let element_layout = match self.interner().get_repr(*ret_layout) {
|
||||
LayoutRepr::Boxed(boxed) => boxed,
|
||||
_ => unreachable!("cannot write to {:?}", self.interner().dbg(*ret_layout)),
|
||||
|
@ -1589,6 +1600,10 @@ trait Backend<'a> {
|
|||
|
||||
self.build_ptr_write(*sym, args[0], args[1], element_layout);
|
||||
}
|
||||
LowLevel::PtrLoad => {
|
||||
//
|
||||
todo!()
|
||||
}
|
||||
LowLevel::RefCountDecRcPtr => self.build_fn_call(
|
||||
sym,
|
||||
bitcode::UTILS_DECREF_RC_PTR.to_string(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue