Commit Graph

68 Commits

Author SHA1 Message Date
Dmitri Hrybenko
d0455ca1c6 Remove unneeded llvm:: qualifier for llvm::ArrayRef
Swift SVN r7093
2013-08-09 20:05:02 +00:00
Dmitri Hrybenko
de59d8dcd4 Remove unneeded llvm:: qualifier for llvm::StringRef and llvm::SmallVector
Swift SVN r7089
2013-08-09 18:41:46 +00:00
Argyrios Kyrtzidis
e31bfa9859 Fix some -Wnon-virtual-dtor warnings.
Swift SVN r5938
2013-07-01 18:25:23 +00:00
John McCall
d8cdb0160f Switch IR-generation to generally traffic in alignment
masks rather than raw alignments.

Swift SVN r5136
2013-05-10 06:16:28 +00:00
John McCall
7bf40e2f08 Project a non-fixed-size initial element using a bitcast instead
of a GEP.

LLVM does not permit GEPs over unsized types, even if the index
is a constant zero.

This makes simple code involving generic tuples work.

Swift SVN r4969
2013-04-29 00:18:30 +00:00
John McCall
1fec73a8d2 Untested support for tuples with generically-sized elements.
Swift SVN r4926
2013-04-26 21:33:24 +00:00
John McCall
65fc2b74f8 Basics of dynamic struct layout.
Swift SVN r4902
2013-04-25 01:39:58 +00:00
John McCall
03c04d04df Prepare StructLayout and StructLayoutBuilder for non-fixed layouts.
Swift SVN r4900
2013-04-25 01:39:45 +00:00
John McCall
80a82b6849 Abstract ElementLayout to work with non-fixed layouts.
Swift SVN r4899
2013-04-25 01:39:40 +00:00
John McCall
d4f80a3993 Introduce a ClassLayoutBuilder and use it to build layouts.
The test changes are that we're setting a class body on
some types that we weren't before.  For some of these,
this is okay;  for others, it's more questionable, but
ultimately not *harmful*.

Swift SVN r3746
2013-01-11 08:09:06 +00:00
John McCall
288210e5df Refactor StructLayout into a builder pattern.
Swift SVN r3745
2013-01-11 08:09:03 +00:00
John McCall
ce7ddef710 Change value witnesses to take the metatype as 'self'.
The motivations here are that (1) the parametric types
that actually need the 'self' argument don't necessarily
all want to do what tuples do and put the VWT relative
to the metatype at some definable offset and (2)
recovering type parameters from the metatype is much
better defined than also hopping some relationship back.
Plus this allows VWTs to be shared across instances of
generic types.  Also, I'm going to need to add a VW
that takes a metatype, and consistency seems right here.

If keeping two values live is actually punishing, I
might have to reconsider this.  But the VWT is at least
always recoverable from the metatype, so....

I ended up abstracting the thing that GenHeap was doing
in order to save archetypes for arrays, because I
needed it to save metatypes instead of VWTs and because
it really needed abstractin'.

Swift SVN r3096
2012-10-31 08:09:33 +00:00
John McCall
48cd78cfef Allow an opaque struct type to be specified as the struct
to perform struct-layout into.

Swift SVN r1823
2012-05-12 07:19:43 +00:00
John McCall
875d914c77 Extract the layout logic out of GenTuple.cpp into a template header.
It does seem silly for this to all be templated, but I couldn't
really see a very elegant solution given how I wanted things to
be genericized.

...interestingly, a ?t.t[] type would have done nicely for some
of this.

Swift SVN r1807
2012-05-11 01:34:56 +00:00
John McCall
980f94817c Abstract out adding the heap header to things.
Swift SVN r1650
2012-04-26 07:34:00 +00:00
John McCall
f3e27d90ff Change IR-generation so that it emits metadata objects for the
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
2012-04-10 06:28:22 +00:00
John McCall
df7ebcd9e8 Introduce the concept of an 'owned address', i.e. an address with
an owner attached.  Use this to implement [byref(heap)].  Force
locals to the heap if they've been referenced in a way that requires
this.

Swift SVN r1265
2012-03-26 03:26:21 +00:00
John McCall
883a16710b Extract out struct layout into a separate file. No clients yet.
Swift SVN r1091
2012-01-19 23:28:41 +00:00