arocc icon indicating copy to clipboard operation
arocc copied to clipboard

Proposal: treat typedef types as separate type specifier

Open ehaas opened this issue 1 year ago • 0 comments

Briefly discussed here https://github.com/Vexu/arocc/pull/433#issuecomment-1324825394

This would add a new field .typedef to Type.Specifier with an associated data *Typedef, with Typedef defined as:

const Typedef = struct {
   name: StringId,
   ty: Type,
};

This could potentially help solve #437 and #367. Furthermore this will be necessary for translate-c support, since we currently do not maintain type name information. For example, if uint32_t immediately resolves to unsigned int, we can't translate that as u32 instead of c_uint. The same applies to typedef'd enums and records.

ehaas avatar Jul 31 '24 19:07 ehaas