added branch info and uniqueness check

This commit is contained in:
J.Teeuwissen 2023-06-18 20:00:15 +02:00
parent d10d71cdec
commit fdfa978ca8
No known key found for this signature in database
GPG key ID: DB5F7A1ED8D478AD
3 changed files with 45 additions and 14 deletions

View file

@ -1355,8 +1355,21 @@ where
arena.alloc(Stmt::Switch {
cond_symbol: unique_symbol,
cond_layout: Layout::BOOL,
branches: &*arena.alloc([(1, BranchInfo::None, u.clone())]),
default_branch: (BranchInfo::None, n),
branches: &*arena.alloc([(
1,
BranchInfo::Unique {
scrutinee: unique_symbol,
unique: true,
},
u.clone(),
)]),
default_branch: (
BranchInfo::Unique {
scrutinee: unique_symbol,
unique: false,
},
n,
),
ret_layout: environment.layout,
})
};