This commit is contained in:
Folkert 2023-06-18 22:05:27 +02:00
parent 51f3752c94
commit 052ce8f2aa
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
8 changed files with 114 additions and 18 deletions

View file

@ -803,7 +803,7 @@ trait Backend<'a> {
union_layout,
index,
} => {
todo!();
self.load_union_field_ptr_at_index(sym, structure, *tag_id, *index, union_layout);
}
Expr::GetTagId {
structure,
@ -2331,6 +2331,16 @@ trait Backend<'a> {
union_layout: &UnionLayout<'a>,
);
/// load_union_at_index loads into `sym` the value at `index` for `tag_id`.
fn load_union_field_ptr_at_index(
&mut self,
sym: &Symbol,
structure: &Symbol,
tag_id: TagIdIntType,
index: u64,
union_layout: &UnionLayout<'a>,
);
/// get_tag_id loads the tag id from a the union.
fn get_tag_id(&mut self, sym: &Symbol, structure: &Symbol, union_layout: &UnionLayout<'a>);