aboutsummaryrefslogtreecommitdiff
path: root/test/conditional-compound-literal.qbe
AgeCommit message (Collapse)Author
2021-09-28expr: Skip codegen for unused expression in conditional with constant expressionMichael Forney
This compiles `0 ? e1 : e2` as `e2`, and `1 ? e1 : e2` as `e1` (while still adjusting the type as necessary).
2021-09-28Skip unnecessary conversion to bool for logical and conditional expressionsMichael 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-07-01qbe: Remove unnecessary distinction between loaduw and loadswMichael Forney
We always store the result to a w temporary, so there is no difference. In fact, QBE provides loadw as an alias for loadsw precisely for this reason.
2020-05-24qbe: Omit unnecessary add to help QBE's memopt passMichael Forney
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.