Commit graph

9 commits

Author SHA1 Message Date
Johan Engelen
cebd0337d8
Fix Lit tests for alignment attribute on parameters of memory intrinsics (LLVM 7) (#2684) 2018-05-07 19:55:26 +02:00
Martin
bda56b7263 Adapt lit-tests to new mangling scheme
Only those failing on Win64 so far.
2017-11-05 21:58:12 +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
Martin
126184a8b6 More in-place construction
Also for struct literal fields, array literal elements and associative array
literal elements as well as basic types allocated on the heap.
2016-07-21 19:49:28 +02:00
Martin
343147bf5e Use direct sret construction for return statements too 2016-07-06 12:12:02 +02:00
Martin
12ff7ef803 Let special __result variable be an alias for sret
So for functions using sret and featuring an out contract, we save an
additional alloca + memcpy by using the sret pointer as storage.
2016-07-04 19:47:55 +02:00
Martin
ed70c12b06 Enable in-place construction for static array literals 2016-07-03 00:23:08 +02:00
Martin
08fa2f093c Enable in-place construction for struct literals 2016-07-03 00:23:03 +02:00