Commit graph

6 commits

Author SHA1 Message Date
Nicholas Wilson
05eaa1cc53
Opaque Pointers: codegen/const_struct.d (#4207) 2022-09-23 13:00:46 +08:00
Martin
d53ffb6ebb Adapt lit-tests to new Win32 D mangling 2017-10-07 14:06:17 +02:00
Johan Engelen
3eab44ae85 Consider pointer literals as constant in isConstLiteral. 2016-11-16 17:57:53 +01:00
LemonBoy
557a8bd756 Consider string literals as constant in isConstLiteral. 2016-11-10 21:26:11 +01:00
Martin
ab1432ed06 Use the regular LL type for all init symbols and most globals
There's no <Type>_init type for aggregates (structs and classes) anymore,
effectively eliminating a *lot* of named LLVM types, some bitcasts as well
as replacements of globals etc.

To get there, it was even required to use the regular type for compatible
literals too, otherwise structs embedded as fields in other aggregates had
an anonymous type (well, the LLVM constant for the field initializer had)
and so the container initializer wasn't compatible with the regular type
anymore.

What was also necessary was a fix wrt. static arrays of bools (LLVM
constant of type `[N x i1]` vs. `[N x i8]` for regular type).
I also had to change the initializer for `char[2][3] x = 0xff` from
`[6 x i8]` to `[3 x [2 x i8]]`, i.e., NOT flattening multi-dimensional
inits from a scalar.

So only literals with overlapping (union) fields and an explicit
initializer initializing dominated non-alias union fields should still
have a mismatching anonymous type - i.e., very, very few cases.
2016-10-23 02:52:51 +02:00
LemonBoy
517f9095a4 Check StructLiteralExp elements in isConstLiteral. 2016-10-17 23:37:04 +02:00