aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
AgeCommit message (Collapse)Author
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.
2019-02-22Make sure to zero the rest of an array initialized with a stringMichael Forney
2019-02-22Implement __builtin_allocaMichael Forney
2019-02-21Emit complete union type definitions instead of just using the first memberMichael Forney
2019-02-20Fix emittype for unionsMichael Forney
Thanks to Andrew Chambers for the bug report.
2019-02-20Fix definitions for nested structsMichael Forney
The QBE documentation suggested that the subtypes in an aggregate must be simple types, but they can actually be any type (this is necessary for getting the alignment and padding right between fields adjacent to the nested struct).
2019-02-17Allow computing address of non-lvalue structs/unionsMichael Forney
We currently compile '.' member access as taking the address of the struct, adding the offset, and then dereferencing as the member type. However, the '.' operator is allowed on non-lvalues, even though the '&' operator is not. So, we need to handle arbitrary struct/union expressions in objectaddr by just compiling them normally, then converting them to regular pointers (since struct/union values are just pointers with additional type information).
2019-02-17Fix returning struct/union typesMichael Forney
2019-02-17Improve old-style function declaration supportMichael Forney
Implement typecompatible for types created with non-prototype function declarations. Require a function definition with parameter declaration list after a declaration with a non-empty identifier list. Detect function definitions with parameter declaration lists containing types incompatible with the promoted types, and report an error for now.
2019-02-16Extend char/short types before comparingMichael Forney
Thanks to Andrew Chambers for reporting the issue.
2019-02-16Fix casts from integer types less than 32 bits wideMichael Forney
2019-02-15Make sure that aggregates and pointers to aggregates are passed/return correctlyMichael Forney
2019-02-15Handle main with no returnMichael 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-15Use bool typedef in .c filesMichael Forney
2019-02-15Rename emit.h -> backend.hMichael Forney
2019-02-15Remove a dead conditional in ftouMichael Forney
2019-02-15Fix bad assertion.Andrew Chambers
2019-02-13When storing initial value of parameters, use unqualified typeMichael Forney
2019-02-13Make basic store independent of ABIMichael Forney
2019-02-13Implement __builtin_va_argMichael Forney