aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
AgeCommit message (Collapse)Author
2021-03-31qbe: Use second argument of call/arg to store type nameMichael Forney
2021-03-31qbe: Use separate type for block/labelMichael Forney
Labels are no longer used as instruction arguments.
2021-03-31qbe: Switch to fixed-size instruction structMichael Forney
Move jump and phi instructions to struct block, and function arguments to their own instruction. This will facilitate allocating instructions as an array.
2021-03-27qbe: Change value kind naming schemeMichael Forney
2020-05-24qbe: Omit unnecessary add to help QBE's memopt passMichael Forney
2020-01-31qbe: Make non-constant initializer expression a proper errorMichael Forney
2020-01-30Fix links to issue trackerMichael Forney
2019-07-10Remove comment for completed TODOMichael Forney
2019-07-05Specify function name in error messageMichael Forney
2019-07-05qbe: Handle K&R function definition argument promotionMichael Forney
Parameters for K&R function definitions that are affected by default argument promotion are passed as their promoted type, so need to be converted back before storing into memory allocated for the parameter.
2019-07-05qbe: Separate out value conversion from funcexprMichael Forney
2019-07-05Move some functions aroundMichael Forney
2019-06-27qbe: Fix switch statements with 64-bit controlling expressionMichael Forney
2019-05-29Temporarily avoid %a when printing floating constantsMichael Forney
This is C99, but is not supported by fscanf in OpenBSD, so floating constants can't be read back in by QBE.
2019-05-16qbe: Fix error check for invalid objectMichael Forney
The result of funcexpr might be NULL if we are in a dead branch, but this doesn't mean that we had an invalid object.
2019-05-15Implement asm labelsMichael 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.
2019-05-10qbe: Fix QBE types for structs containing bit-fieldsMichael Forney
2019-04-27Sign-extend result of bit-field assignmentsMichael Forney
Fixes #51. Thanks to Andrew Chambers for the bug report and test case.
2019-04-25qbe: Error out when va_arg is called with non-scalar typeMichael Forney
2019-04-24Use a common member for expression baseMichael Forney
2019-04-24Use a common member for expression opMichael Forney
2019-04-24Free function call argument listsMichael Forney
2019-04-24Free functions when we're done with themMichael Forney
2019-04-24qbe: Make sure generated code doesn't depend on argument evaluation orderMichael Forney
It would be correct in any order, but this is a bit simpler and guarantees the same output.
2019-04-23Fix integer promotion on bit-fieldsMichael Forney
Fixes #47.
2019-04-21Keep track of type properties in typeMichael Forney
2019-04-20Make basic types have their own kindMichael Forney
2019-04-18Fix potential overflow of bit-field initializers into following memberMichael Forney
Fixes #46. Thanks to Andrew Chambers for the bug report.
2019-04-17Merge map.h and tree.h into util.hMichael Forney
2019-04-17Just use a single mapkey functionMichael Forney
2019-04-17htab -> mapMichael Forney
2019-04-17Implement bit-field initializersMichael Forney
2019-04-16Error instead of segfault when working with `long double`Michael Forney
2019-04-16Fix offset of initializer following fixed-length stringMichael Forney
2019-04-15Handle static sub-initializersMichael Forney
2019-04-14Initial support for loading/storing bit-fieldsMichael Forney
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 paramMichael Forney
2019-04-06Separate unqualified type and qualifiers in struct exprMichael Forney
2019-04-04Merge headers into cc.hMichael 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-15Start to handle overlapping initializersMichael Forney
2019-03-14Abbreviate tag namesMichael Forney
2019-03-13Use instruction op for varargs call instead of "ellipsis" valueMichael Forney
2019-03-13Update __PRETTY_FUNCTION__ commentMichael Forney
2019-03-13Make `struct function` opaqueMichael Forney