Age | Commit message (Collapse) | Author | |
---|---|---|---|
2024-04-27 | Store enum constant value in struct decl | Michael Forney | |
2024-04-21 | expr: Create decl for compound literal during parse | Michael Forney | |
2024-04-20 | qbe: Pass struct decl to mkglobal instead of fields from the decl | Michael Forney | |
2024-04-19 | implement _Thread_local storage class | Drew DeVault | |
Implements: https://todo.sr.ht/~mcf/cproc/8 | |||
2024-04-12 | decl: Add name field to decl struct | Michael Forney | |
2024-04-07 | eval: Use enum instead of define for float/signed flags | Michael Forney | |
2024-04-02 | map: Use simpler fnv-1a hash function | Michael Forney | |
2024-03-23 | expr: Keep track of storage duration of compound literals | Michael Forney | |
2022-05-19 | eval: Fix range check of double during conversion to int | Michael Forney | |
2⁶⁴-1 and 2⁶³-1 are not representable as double and get rounded to 2⁶⁴ and 2⁶³ respectively, which are outside the range of 64-bit [u]int. This causes undefined behavior when a constant expression is evaluated that involves a conversion of a very large or small value to an integer type. To fix this, change the > to >= and use constants representable as double. | |||
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). | |||
2022-01-22 | Remove most usage of fixed-width integer types | Michael Forney | |
We only require a type of at least 64 bits, so just use unsigned long long. Only siphash remains as the last user of uint64_t. | |||
2022-01-22 | eval: Simplify sign/zero extension | Michael Forney | |
2022-01-22 | Port to C99 | 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-09-29 | eval: Allow subtraction in address constants | Michael Forney | |
2021-09-29 | eval: Avoid implementation-defined unsigned to signed conversions | Michael Forney | |
Instead, use an additional int64_t member in the union. Since exact-width integer types have no padding bits or trap representations, and use two's-complement representation, we can portably access an int64_t union member stored as uint64_t and vice-versa. This allows us to reinterpret the value without invoking potentially implementation-defined behavior of casting an unsigned integer to a signed integer type which may not be able to represent its value. | |||
2021-09-29 | Rename uint64_t field of constant union to u | Michael Forney | |
This will prepare us for adding a signed int64_t field called i. | |||
2021-09-29 | eval: Remove now unneeded handling of EXPRCOND | Michael Forney | |
We now do this evaluation during parsing. | |||
2020-01-31 | eval: Allow casting address constants to integer types in constant expressions | Michael Forney | |
2019-05-19 | eval: Collapse & and * operators in integer constant expressions | Michael Forney | |
They might be used to implement offsetof. | |||
2019-05-12 | eval: Keep track of kind of constant expression we are evaluating | Michael Forney | |
When we are evaluating an arithmetic constant expression, we don't want to indroduce static data definitions for string or compound literals. Fixes #59. | |||
2019-04-24 | Use a common member for expression base | Michael Forney | |
2019-04-24 | Use a common member for expression op | Michael Forney | |
2019-04-24 | eval: Check that expression has integer type before checking if it's signed | Michael Forney | |
It could be an integer constant cast to a pointer type. | |||
2019-04-21 | Keep track of type properties in type | Michael Forney | |
2019-04-20 | eval: Handle casts in constant expressions | Michael Forney | |
Fixes #23. | |||
2019-04-06 | Separate unqualified type and qualifiers in struct decl | Michael Forney | |
2019-04-06 | Separate unqualified type and qualifiers in struct expr | Michael Forney | |
2019-04-04 | Merge headers into cc.h | Michael Forney | |
2019-03-14 | Abbreviate tag names | Michael Forney | |
2019-02-20 | Remove some unused variables | Michael Forney | |
2019-02-20 | eval: Handle nested offset address constants | Michael Forney | |
2019-02-15 | Fix backwards constant evaluation of float-int casts | Michael Forney | |
2019-02-15 | Rename emit.h -> backend.h | Michael Forney | |
2019-02-14 | Handle compound literals in global initializers | Michael Forney | |
2019-02-12 | Initial import | Michael Forney | |