Age | Commit message (Collapse) | Author | |
---|---|---|---|
2024-04-27 | Implement variable length arrays | Nihal Jere | |
Variably modified types are required for C23. Since QBE doesn't currently support saving and restoring the stack pointer, a current limitation is that we can't reclaim stack space from VLAs that go out of scope. This is potentially problematic for VLAs appearing in a loop, but this case is uncommon enough that it is silently ignored for now. Implements: https://todo.sr.ht/~mcf/cproc/1 References: https://todo.sr.ht/~mcf/cproc/88 Co-authored-by: Michael Forney <mforney@mforney.org> | |||
2024-04-27 | qbe: Add extra size for strict alignment with QBE instruction | Michael Forney | |
With upcoming VLA support, the size might not be constant. | |||
2024-04-27 | Use hlt to implement noreturn | Michael Forney | |
2024-04-19 | implement _Thread_local storage class | Drew DeVault | |
Implements: https://todo.sr.ht/~mcf/cproc/8 | |||
2024-04-16 | test: Add test for compatible array types | Michael Forney | |
2024-04-15 | decl: Support variadic functions with no other parameters | Michael Forney | |
2024-04-15 | decl: Save and re-open parameter scope for body | Michael Forney | |
2024-04-15 | Remove support for non-prototype function declarations and definitions | Michael Forney | |
These were removed in C23. | |||
2024-04-04 | test: Use C23 keywords in test data | Michael Forney | |
Apparently 8120240c1f missed some. | |||
2024-03-29 | Use C23 keywords in test data | Michael Forney | |
2024-03-24 | decl: Implement GNU packed attribute | Michael Forney | |
Implements: https://todo.sr.ht/~mcf/cproc/72 | |||
2024-03-24 | Add support for C23 attribute syntax | Michael Forney | |
Currently, all attributes are ignored. References: https://todo.sr.ht/~mcf/cproc/68 | |||
2024-03-23 | Add test for unreachable statements | Michael Forney | |
This used to trigger a bug. References: https://todo.sr.ht/~mcf/cproc/80 | |||
2024-03-23 | Add tests for standard enum types | Michael Forney | |
2024-03-23 | Change type of u8 string literals to unsigned char for C23 | Michael Forney | |
2024-03-22 | Implement C23 nullptr constant | Michael Forney | |
2024-03-22 | decl: Implement typeof_unqual | Michael Forney | |
2024-03-22 | Use C23 spelling of typeof in tests | Michael Forney | |
2024-03-21 | decl: Add support for enums with large values and fixed underlying types | Michael Forney | |
Fixes: https://todo.sr.ht/~mcf/cproc/64 | |||
2024-03-16 | Fix C23 empty initializers | Michael Forney | |
These should should act as zero initializers, but since init==NULL was used to mean both "no initializer" and "empty initializer", empty initializers weren't zero-initializing the variable. | |||
2022-11-29 | Implement C23 predefined bool constants | Michael Forney | |
2022-08-05 | expr: Fix constant evaluation of struct member address | Michael Forney | |
fb00ba6978 had the side-effect of introducing an integer to pointer cast, which was not evaluated as a constant expression. To fix this, just set the type of the expression. | |||
2022-06-13 | Fix tests for x86_64 -> x86_64-sysv target rename | Michael Forney | |
2022-05-09 | expr: Use integer type for member access intermediate address calculation | Michael Forney | |
2022-03-22 | init: Allow empty initializers | Michael Forney | |
2022-03-22 | Add test for typeof on expression with array type | Michael Forney | |
2022-03-22 | Allow unnamed parameters in function definitions | Michael Forney | |
2022-02-10 | qbe: Switch to new unsigned-float conversion operators | Michael Forney | |
2022-02-10 | qbe: Use new unary negation operator | Michael Forney | |
2022-01-22 | Handle unary minus specially instead of 0 - x | Michael Forney | |
This is necessary to fix unary negation of floating-point 0 (also depends on a pending qbe patch). | |||
2021-12-06 | decl: Fix typedefs with type qualifiers | Michael Forney | |
Previously, the qualifiers were saved, but accidentally ignored when the typedef was referenced. | |||
2021-12-06 | decl: Use strictest alignment when multiple specifiers are present | Michael Forney | |
This is specified by the last sentence in C11 6.7.5p6. | |||
2021-10-25 | decl: Allow alignment > 16 of locals | Michael Forney | |
This is not yet supported by QBE, so for now we allocate a bit extra and choose the address in the allocated region with an aligned address. | |||
2021-10-25 | decl: Allow alignment > 16 of globals and struct members | Michael Forney | |
2021-10-25 | eval: Fix int-to-float conversions | Michael Forney | |
Also, add bounds checks for float-to-int conversions. If the integer part can't be represented in the result type, C behavior is undefined. Although this means the result is arbitrary, we need to avoid undefined behavior in cproc itself when given such a program as input. | |||
2021-10-25 | qbe: Use ... to separate named and variadic arguments | Michael Forney | |
This requires a not-yet-upstream QBE patch, and is needed for riscv64 support, since the calling convention may be different depending on whether the argument is named or variadic. | |||
2021-10-21 | expr: Add support for UTF-8 character constants | Michael Forney | |
2021-10-21 | expr: Implement binary integer constants | Michael Forney | |
These are in the latest C23 draft. | |||
2021-10-20 | expr: Fix octal escapes followed by octal digits | Michael Forney | |
2021-10-20 | expr: Add support for wide string literals | Michael Forney | |
Thanks to Nihal Jere for his initial patches implementing this feature. Fixes #35. | |||
2021-10-18 | expr: Make sure __builtin_va_end argument is evaluated for side-effects | Michael Forney | |
2021-10-18 | qbe: Fix jnz controlled by short/char type | Michael Forney | |
Although we don't need the cnew in this case, we still need to do the appropriate extension to 32-bit. | |||
2021-10-02 | qbe: Re-add conversion to bool RHS of logical and/or | Michael Forney | |
7e838669 removed conversion to bool for int expressions used only to control jnz, but incorrectly dropped the conversion for the right-hand-side of logical and/or as well. We need the result of the expression to be 0 or 1, so we still need that conversion. | |||
2021-09-29 | eval: Allow subtraction in address constants | Michael Forney | |
2021-09-28 | expr: Skip codegen for unused expression in conditional with constant expression | Michael Forney | |
This compiles `0 ? e1 : e2` as `e2`, and `1 ? e1 : e2` as `e1` (while still adjusting the type as necessary). | |||
2021-09-28 | Skip unnecessary conversion to bool for logical and conditional expressions | Michael Forney | |
As in ede6a5c9, if an expression is used only to control a jnz, we don't need to convert it to a 0 or 1 value. QBE ignores the upper 32-bits of the argument to jnz, so the conversion is still needed for pointer, long, and floating point types (including float since -0 has non-zero bit representation). | |||
2021-09-14 | qbe: Fix temporary type for < 8 byte aligned struct copies | Michael Forney | |
2021-09-13 | Add test for string concatenation corner case | Michael Forney | |
2021-09-07 | expr: Fix varargs again and add more tests | Michael Forney | |
2021-09-06 | Add tests for char/wchar_t signedness | Michael Forney | |