aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
AgeCommit message (Collapse)Author
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
2019-03-12Revert "Zero uninitialized decls/returns."Michael Forney
This reverts commit 7722c7593a1a249e1a6d98d84afdff3cb086ca81. This causes problems with large stack allocations, such as https://github.com/madler/pigz/blob/fe822cb435622c43f491013da77b127e9fe851a9/pigz.c#L3403-L3405
2019-03-03Fix emittype for qualified nested structMichael Forney
We don't have to strip qualifiers off of array types since array types can only be qualified when used in a parameter declaration before adjustment.
2019-02-26Use funcinst macro in a few more placesMichael Forney
2019-02-26Simplify common funcinst case.Andrew Chambers
2019-02-26Zero uninitialized decls/returns.Andrew Chambers
Resolves #12 and #15.
2019-02-26Don't add zero offsets when zeroing.Andrew Chambers
2019-02-24Make __PRETTY_FUNCTION__ a synonym for __func__Michael Forney
2019-02-22Fix use of uninitialized character in string arrayMichael Forney
String data in expressions is just an array and is not NULL-terminated.