diff options
Diffstat (limited to 'src/parse.cff')
| -rw-r--r-- | src/parse.cff | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parse.cff b/src/parse.cff index b758061..46d71d8 100644 --- a/src/parse.cff +++ b/src/parse.cff @@ -689,7 +689,7 @@ fn parseenum(P *Parser, name *const u8, lax bool) *const Type { : max < 1i64 << 31 ? ty_i32 : ty_i64); static id int = 0; - return interntype({ .u: :Enum { intty, name, lax, id++, vals->move(P.alloc) }}); + return interntype(&Type{ .u: :Enum { intty, name, lax, id++, vals->move(P.alloc) }}); } fn isdecltokt(t TokT) bool { @@ -715,7 +715,7 @@ fn parseagg(P *Parser, loc Loc, kind AggKind, name *const u8, retdecl **Decl) *c decl = #null; } } - let ty = decl ? decl.u.Ty : interntype({ .u: :Agg { kind, name, id++ }}); + let ty = decl ? decl.u.Ty : interntype(&Type{ .u: :Agg { kind, name, id++ }}); let ty = as(*Type)ty; let constty = as(*Type)constify(ty); let agg = &ty.u.Agg; @@ -791,7 +791,7 @@ fn parseagg(P *Parser, loc Loc, kind AggKind, name *const u8, retdecl **Decl) *c ev.name = fld.name; ev.i = i; } - agg.enumty = interntype(enumty); + agg.enumty = interntype(&enumty); let off = f0align < 0 ? 0z : ALIGNUP(enumty.size, f0align); ty.size += off; @@ -889,7 +889,7 @@ fn parsebitfield(P *Parser, name *const u8) *const Type { lex(P); let signedty = *bitf.intty; signedty.u.Int.sgn = #t; - ty = interntype(signedty); + ty = interntype(&signedty); } iota += size; @@ -906,7 +906,7 @@ fn parsebitfield(P *Parser, name *const u8) *const Type { } bitf.flds = flds->move(P.alloc); - return interntype(ty); + return interntype(&ty); } fn typematchestarg(targ *const Type, ty *const Type) bool { @@ -1100,7 +1100,7 @@ fn parsefntype(P *Parser) *const Type { let paramtys Vec<*const Type> = {}; parsefnparams(P, &variadic, #null, ¶mtys); let ret = parsetype(P); - return interntype({ .u: :Fn { + return interntype(&Type{ .u: :Fn { paramtys->move(P.alloc), variadic, ret, @@ -1989,7 +1989,7 @@ fn pexprefix(P *Parser) Expr { case lexmatch(P, &tok, '&'); let ex = pexprefix(P); - let ty2 = interntype({ g_targ.ptrsize, .u: :Ptr(ex.ty) }); + let ty2 = interntype(&Type{ g_targ.ptrsize, .u: :Ptr(ex.ty) }); if !islvalue(&ex) and !(ex.u.#tag == :Symbol and ex.u.Symbol.u.#tag == :Fn) and !(ex.u.#tag == :ZeroIni or ex.u.#tag == :AggIni or ex.u.#tag == :ArrIni) { err(P, ex.loc, "invalid operand to `&': not an lvalue"); @@ -2780,7 +2780,7 @@ fn parsefn(P *Parser, loc Loc, toplevel bool, externp bool, name *const u8) *Dec parsefnparams(P, &Fn.variadic, ¶mnames, ¶mtys); Fn.paramnames = paramnames->move(P.alloc); let retty = parsetype(P); - Fn.ty = interntype({ .size: 0, .align: 1, .u: :Fn { + Fn.ty = interntype(&Type{ .size: 0, .align: 1, .u: :Fn { paramtys->move(P.alloc), Fn.variadic, retty }}); static id int = 0; |