Handle unions

Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
This commit is contained in:
Ryszard Rozak 2026-02-26 10:17:38 +01:00
parent 625a33c155
commit 7fd1e83235
1 changed files with 5 additions and 0 deletions

View File

@ -355,6 +355,11 @@ private:
enStructp = new AstStructDType{structp->fileline(), structp->packed()
? VSigning::SIGNED
: VSigning::NOSIGN};
} else if (VN_IS(structp, UnionDType) && structp->packed()) {
const AstUnionDType* const unionp = VN_AS(structp, UnionDType);
enStructp = new AstUnionDType{
unionp->fileline(), unionp->isSoft(), unionp->isTagged(),
unionp->packed() ? VSigning::SIGNED : VSigning::NOSIGN};
} else {
varp->v3fatalSrc("Unsupported: Force of variable of unhandled data type");
return dtypep;