From ddbd42e66cc71b470730037d76f4f267e98d8d40 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 13 Apr 2026 19:25:11 +0200 Subject: C99 complex types MVP Missing: static eval of complex values, Silly inefficient implementation of equality comparisons between them The whole thing is pretty inefficient without proper aggregate mem2reg anyway --- src/c_type.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/c_type.h') diff --git a/src/c_type.h b/src/c_type.h index 6ef1bc3..1347fcc 100644 --- a/src/c_type.h +++ b/src/c_type.h @@ -137,10 +137,12 @@ Type typedecay(Type); bool assigncompat(Type dst, Type src); enum typetag intpromote(enum typetag); Type cvtarith(Type a, Type b); +Type complex2struct(Type); static inline Type typechild(Type t) { if (t.t == TYENUM) return mktype(typedata[t.dat].backing); + if (iscomplex(t)) return mktype(t.t - TYCOMPLEXF + TYFLOAT); if (t.flag & TFCHLDPRIM) return mktype(t.child); if (t.flag & TFCHLDISDAT) { Type chld = mktype(typedata[t.dat].t, .flag = typedata[t.dat].flag, .dat = t.dat); -- cgit v1.2.3