Age | Commit message (Collapse) | Author |
|
Resolves #12 and #15.
|
|
|
|
|
|
updatearray takes an index, so was allocating an extra byte.
|
|
|
|
|
|
|
|
|
|
|
|
Thanks to Andrew Chambers for the bug report.
|
|
|
|
The QBE documentation suggested that the subtypes in an aggregate must
be simple types, but they can actually be any type (this is necessary
for getting the alignment and padding right between fields adjacent to
the nested struct).
|
|
|
|
typeintpromote and typeargpromote assume they are dealing with an
unqualified type, and return an incorrect result if they are given a
qualified one. So, add an assert here.
This was causing const integer types to get promoted to themselves due
to missing lvalue conversions.
Thanks to Andrew Chambers for the bug report and test case.
|
|
|
|
This check was only supposed to return true for enum types and their
corresponding integer type. However, it had the side effect of making
'int' compatible with 'unsigned'.
To fix this, introduce a new basic type kind for enums with the same
rank as 'int', that is only compatible with itself and the 'int' type
with the matching sign.
Thanks to Andrew Chambers for the bug report.
|
|
|
|
Determining whether it is a typename or unparenthesized expression
requires consuming the '(', so we need to call postfixexpr/parseinit
ourselves.
|
|
We currently compile '.' member access as taking the address of
the struct, adding the offset, and then dereferencing as the member
type. However, the '.' operator is allowed on non-lvalues, even though
the '&' operator is not. So, we need to handle arbitrary struct/union
expressions in objectaddr by just compiling them normally, then converting
them to regular pointers (since struct/union values are just pointers
with additional type information).
|
|
|
|
Implement typecompatible for types created with non-prototype function
declarations.
Require a function definition with parameter declaration list after a
declaration with a non-empty identifier list.
Detect function definitions with parameter declaration lists containing
types incompatible with the promoted types, and report an error for now.
|
|
Thanks to Andrew Chambers for reporting the issue.
|
|
|
|
|
|
|
|
The pointers might be global addresses, and it doesn't make sense to
divide them before subtracting.
|
|
|
|
|
|
|
|
|
|
|
|
We need to traverse the type hierarchy from inside to out to calculate
size/alignment of arrays.
|
|
|