aboutsummaryrefslogtreecommitdiff
path: root/expr.c
AgeCommit message (Collapse)Author
2019-04-07expr: Handle parenthesized paremeter name in __builtin_va_startMichael Forney
FreeBSD defines va_start(ap, last)=__builtin_va_start((ap), (last))
2019-04-06expr: Just use `unsigned long long` when calculating integer constant typeMichael Forney
Ideally, we shouldn't use uint64_t at all since it is not guaranteed to exist, and this case is easy enough to fix.
2019-04-06Track type qualifiers separatelyMichael Forney
Using a special qualified type kind has a number of problems: - Important fields such as size, align, and incomplete may not be set, since the qualified type was created before a struct was completed. - When we don't care about type qualifiers (which is the usual case), we have to explicitly unqualify the type which is annoying and error-prone. Instead, in derived types, keep track of the qualifiers of the base type alongside the base type (similar to what is done for members, parameters, declarations, and expressions in the past few commits).
2019-04-06Separate unqualified type and qualifiers in struct declMichael Forney
2019-04-06Separate unqualified type and qualifiers in struct memberMichael Forney
2019-04-06Separate unqualified type and qualifiers in struct exprMichael Forney
2019-04-05expr: Make lvalue default to false, and set where neededMichael Forney
2019-04-05expr: Use separate fields for lvalue and decayed instead of flagsMichael Forney
2019-04-04Merge headers into cc.hMichael Forney
2019-04-03Error on bit-field access for nowMichael Forney
2019-04-03Revert "Make member access its own expression type"Michael Forney
This reverts commit b3865e402e426387d4cdccdcd249a02d5ba1bc05. This breaks member address expressions in static initializers. We can support bit-fields by instead adding a "bit-field" expression that affects loads and stores to the underlying object.
2019-04-03Make member access its own expression typeMichael Forney
2019-03-15__builtin_constant_p doesn't need to consider address constantsMichael Forney
2019-03-14Don't need a table of int maximumsMichael Forney
2019-03-14Use precedence climbing to parse binary expressionsMichael Forney
2019-03-14Abbreviate tag namesMichael Forney
2019-03-12Implement __builtin_constant_pMichael Forney
2019-03-12Sort built-insMichael Forney
2019-03-12scan: Add support for prefixed string literals and character constantsMichael Forney
2019-02-24Check for negative array lengths/indicesMichael Forney
2019-02-22When & is applied to an array, it is no longer decayedMichael Forney
2019-02-22Implement __builtin_nanf for empty string literalsMichael Forney
2019-02-22Separate out built-in handling from postfixexprMichael Forney
2019-02-22Implement __builtin_inffMichael Forney
2019-02-22Keep track of built-in kind in declarationMichael Forney
Also, populate filescope with builtins outside of main.
2019-02-22Implement __builtin_allocaMichael Forney
2019-02-22Fix adding integer to pointerMichael Forney
2019-02-21Fix decay on qualified array typesMichael Forney
2019-02-20Remove some unused variablesMichael Forney
2019-02-19Implement __builtin_va_copyMichael Forney
2019-02-19Slight reorganization in expr.cMichael Forney
2019-02-19Add mkunaryexpr helperMichael Forney
2019-02-19Add missing lvalue conversionsMichael Forney
typeintpromote and typeargpromote assume they are dealing with an unqualified type, and return an incorrect result if they are given a qualified one. So, add an assert here. This was causing const integer types to get promoted to themselves due to missing lvalue conversions. Thanks to Andrew Chambers for the bug report and test case.
2019-02-19Check that left hand side of assignment expression is an lvalueMichael Forney
2019-02-18Pointer operands to + and - must be complete object typesMichael Forney
Also clean up a little and give some better error messages.
2019-02-17Fix sizeof with unparenthesized postfix or compound literal expressionMichael Forney
Determining whether it is a typename or unparenthesized expression requires consuming the '(', so we need to call postfixexpr/parseinit ourselves.
2019-02-17Ensure right number of arguments to non-prototype function definitionsMichael Forney
2019-02-15Don't embed anonymous struct members into parentMichael Forney
While this works nicely for structs, when unions are involved it makes it impossible to find the next member to initialize without keeping track of extra data per member.
2019-02-15Fix hex escape in char literals.Andrew Chambers
2019-02-14When subtracting pointers, divide after subtractionMichael Forney
The pointers might be global addresses, and it doesn't make sense to divide them before subtracting.
2019-02-13Fix decay on qualified array typesMichael Forney
2019-02-13Fold constexpr function into intconstexprMichael Forney
We usually only care about integer constant expressions, and when we parse initializers, we need to handle non-constant expressions too, so we call eval explicitly when emitting global data.
2019-02-13Add some missing lvalue conversionsMichael Forney
2019-02-13Implement __builtin_va_argMichael Forney
2019-02-13expr: Perform lvalue conversion on array and index in subscript expressionsMichael Forney
2019-02-12Fix adding pointer to integerMichael Forney
2019-02-12Allow overflow/underflow when parsing floating constantsMichael Forney
2019-02-12Initial importMichael Forney