aboutsummaryrefslogtreecommitdiff
path: root/targ.c
AgeCommit message (Collapse)Author
2024-04-07Store length expression in array typesMichael Forney
We don't need the length constant anymore, so just use that name for the length expression. References: https://todo.sr.ht/~mcf/cproc/1
2024-04-04type: Fix qualifiers of adjusted array types of parametersMichael Forney
2024-04-03Use 'bool' in headers instead of '_Bool'Michael Forney
_Bool is deprecated in C23, and using it breaks bootstrap with implementations that don't fully support C99 and define bool to some other type in stdbool.h.
2024-04-02map: Use simpler fnv-1a hash functionMichael Forney
2022-06-06Rename x86_64 target to include ABIMichael Forney
2022-01-22Remove unused type propertiesMichael Forney
2022-01-22Port to C99Michael Forney
2021-09-06Fix type-checking of va_list arguments to varargs built-insMichael Forney
If the argument was a function parameter, its type has already been adjusted. So on x86_64, we can't just ignore the automatic array-to-pointer conversion, since it was never a pointer to begin with. Instead, keep track of the adjusted va_list type, and check that the arguments to varargs built-ins match that type.
2021-09-04Use architecture-specific va_list typeMichael Forney
Previously, cproc effectively used used typedef struct { /* 32 bytes, 8-byte aligned */ } __builtin_va_list[1]; However, this is not quite correct for x86_64 nor aarch64, though it was close enough for both to work in most cases. In actuality, for x86_64 we want typedef struct { /* 24 bytes, 8-byte aligned */ } __builtin_va_list[1]; and for aarch64 we want typedef struct { /* 32 bytes, 8-byte aligned */ } __builtin_va_list; The difference only appears when the size of va_list matters, or when va_list is passed as a parameter. However, the former is not often the case, and the aarch64 ABI replaces aggregate arguments with pointers to caller-allocated memory, which is quite similar to arrays decaying to pointers in C except that the struct is not copied. Additionally, riscv64 simply uses typedef void *__builtin_va_list; which again has a different size and calling convention. To fix this, make the __builtin_va_list type architecture-specific and use architecture-specific tests for varargs-related functionality.
2021-04-23Make some static data constMichael Forney
2021-04-23targ: Use correct char signedness for aarch64 and riscv64Michael Forney
2021-04-21Add support for riscv64 targetMichael Forney
QBE support isn't quite there yet, but is progressing smoothly.
2019-06-27Implement prefixed character constantsMichael Forney
2019-06-27Pass target to cc-qbeMichael Forney