rdar://159143492
Previously all bits after the spare bits of the first element were marked as spare bits. This caused enum tags to be stored in bits used by the payload.
When a `FixedArray`'s fixed size is 1, it looks like `[1 x %Ty]`. Given
an array's address, performing an operation on each element's address
entail's indexing into the array to each element's index to produce an
element's address for each index. That is true even when the array
consists of a single element. In that case, produce an address for that
single element by indexing to index 0 into each passed-in array.
rdar://151726387
`Builtin.FixedArray<let N: Int, T: ~Copyable & ~Escapable>` has the layout of `N` elements of type `T` laid out
sequentially in memory (with the tail padding of every element occupied by the array). This provides a primitive
on which the standard library `Vector` type can be built.
These let SILGen retain and release arbitrary Explosions without having to work around cleanups. Also remove 'transfer' because I'm dumb and didn't realize 'reexplode' already does the same thing.
Swift SVN r3816
Implement IRGen for RefElementAddr so that class accessors work. Add a loadUnmanaged method to TypeInfo classes so that we can populate Explosions without accruing unwanted cleanups.
Swift SVN r3779
This is kindof a pain in a few places where the type system
doesn't propagate canonicality. Also, member initializations
are always direct-initializations and so are allowed to use
explicit constructors, which is a hole in our canonicality
tracking. But overall I like the idea of always working
with canonical types.
Swift SVN r2893
a lot closer to successfully emitting the polymorphic-min-over-ranges
example; the main blocker right now seems to be that the witness
for a static member function is not, in fact, a static member
function at al, but a freestanding function. That's legitimate,
but it probably needs some shepherding through the witness
system.
Swift SVN r2532
This is much more convenient for IRGen, and gives us a reasonable representation for a static
polymorphic function on a polymorphic type.
I had to hack up irgen::emitArrayInjectionCall a bit to make the rest of this patch work; John, please
revert those bits once emitCallee is fixed.
Swift SVN r2488
by abstraction from the concrete return type.
This basically gets generic calls working totally as long
as there's no remapping required.
Swift SVN r2402
of protocol types to correctly handle self-assignment.
This ends up creating such a large amount of code that it's
worth extracting into its own helper function. Fortunately,
this can be the same helper function for every protocol type.
Swift SVN r1905
first, we weren't registering the cleanup for the temporary
if it needed materialization, and second, we were potentially
double-consuming cleanups associated with the l-value, e.g.
subscript indices.
Swift SVN r1631
heap allocations it makes, and switch swift_alloc over to pass
that pointer in as well as the alignment. Also, compute
whether a type is POD during its generation and cache that in
the object, and introduce a method on TypeInfo to destroy an
object in memory.
Swift SVN r1356
very useful; it is much more interesting to divide r-value emission
into "to arguments" and "to memory" models. To that end, introduce a
new structure for holding an "exploded" r-value.
Swift SVN r1006