Pointers to the void type descriptor looked just like null pointers and
that was terribly confusing. Avoid that confusion by pre-allocating a
small amount of data in order to reserve space for a null descriptor.
Assignment of nil to a field function is permitted, but trying to use one
as a builtin or as a normal function is treated as an error.
.void (float y) func; OK
.void (float y) bi = #0; error
.void (float y) ni = nil; OK
.void (float y) co = { }; error
The parser wants to treat .float () foo; as a function returning a float
field, but qcc treats it as a field holding a function variable.
Fortuantely, field types are always "simple" (ie, at worst, just more
field type wrappers around the non-field type), so all that's needed to
obtain qcc grammar is to reach into the field type layers and do the
function type calculation based on the non-field type found there.
Structures etc now never encode the fields as well (I might revert that
at some time). Type parsing has been removed: it has proven unnecessary
and overly complicated, and the new qfo encoding should be more useful.
Access to struct fields in near data can be done using only one operand,
but offset relocs need to be used. However, as not all defs want offset
relocs, a flag has been added to the def struct.
Local defs may be initialized with non-constant expressions, which
includes function calls. Both function calls and aggregate initializers
use block expressions.
For certain values of "fix" :/. The code is ugly, but it does the right
thing: calculate the effect address and use the resulting pointer in a
move instruction.
It seems that building types is very fragile: all too easy to fix things
in one place and break something somewhere else. I guess the type system
will need a comlete rewrite at some stage.
find_type() does type comparisons based on tag name for struct/union/enum
but when it returns the previous tag (eg, from "struct foo;") the returned
type has a null symtab pointer, so setting the symtab pointer in the type
before calling find_type() only throws away the symtab. Thus, since
find_type() doesn't check the symtab pointer when comparing the types, set
the symtab pointer after calling find_type().