type* typeCreateFunction (type* returnType, type** paramTypes, int params, bool variadic) { type* DT = typeCreate(typeFunction); DT->returnType = returnType; DT->paramTypes = paramTypes; DT->params = params; DT->variadic = variadic; return DT; }
type* typeUnitary (typeSys* ts, typeKind kind) { precond(!typeKindIsntUnitary(kind)); /*Only allocate one struct per unitary type*/ if (!ts->unitaries[kind]) ts->unitaries[kind] = typeCreate(kind, (type) {}); return ts->unitaries[kind]; }
static type* typeNonUnitary (typeSys* ts, typeKind kind, type init) { type* dt = typeCreate(kind, init); vectorPush(&ts->others, dt); return dt; }
type* typeCreateInvalid () { return typeCreate(typeInvalid); }
type* typeCreateArray (type* base, int size) { type* DT = typeCreate(typeArray); DT->base = base; DT->array = size; return DT; }
type* typeCreatePtr (type* base) { type* DT = typeCreate(typePtr); DT->base = base; return DT; }
type* typeCreateBasic (const sym* basic) { type* DT = typeCreate(typeBasic); DT->basic = basic; return DT; }