aboutsummaryrefslogtreecommitdiff
path: root/eval.c
AgeCommit message (Collapse)Author
2021-09-29eval: Allow subtraction in address constantsMichael Forney
2021-09-29eval: Avoid implementation-defined unsigned to signed conversionsMichael 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-29Rename uint64_t field of constant union to uMichael Forney
This will prepare us for adding a signed int64_t field called i.
2021-09-29eval: Remove now unneeded handling of EXPRCONDMichael Forney
We now do this evaluation during parsing.
2020-01-31eval: Allow casting address constants to integer types in constant expressionsMichael Forney
2019-05-19eval: Collapse & and * operators in integer constant expressionsMichael Forney
They might be used to implement offsetof.
2019-05-12eval: Keep track of kind of constant expression we are evaluatingMichael 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-24Use a common member for expression baseMichael Forney
2019-04-24Use a common member for expression opMichael Forney
2019-04-24eval: Check that expression has integer type before checking if it's signedMichael Forney
It could be an integer constant cast to a pointer type.
2019-04-21Keep track of type properties in typeMichael Forney
2019-04-20eval: Handle casts in constant expressionsMichael Forney
Fixes #23.
2019-04-06Separate unqualified type and qualifiers in struct declMichael Forney
2019-04-06Separate unqualified type and qualifiers in struct exprMichael Forney
2019-04-04Merge headers into cc.hMichael Forney
2019-03-14Abbreviate tag namesMichael Forney
2019-02-20Remove some unused variablesMichael Forney
2019-02-20eval: Handle nested offset address constantsMichael Forney
2019-02-15Fix backwards constant evaluation of float-int castsMichael Forney
2019-02-15Rename emit.h -> backend.hMichael Forney
2019-02-14Handle compound literals in global initializersMichael Forney
2019-02-12Initial importMichael Forney