Commit Graph

70 Commits

Author SHA1 Message Date
Joe Groff
0566088bf2 Move name mangling into SIL.
Sever the last load-bearing link between SILFunction and SILConstant by naming SILFunctions with their mangled symbol names. Move the core of the mangler up to SIL, and teach SILGen how to use it to mangle a SILConstant.

Swift SVN r4964
2013-04-28 03:32:41 +00:00
John McCall
ba54c976d6 Move IsPOD_t and IsFixedSize_t into the IR-gen global header.
Swift SVN r4898
2013-04-25 01:39:35 +00:00
John McCall
38b34b7307 Pass #1 at localizing assumptions about fixed layout and
handling non-fixed layouts.

This uncovered a bug where we weren't rounding up the header
size to the element alignment when allocating an array of archetypes.

Writing up a detailed test case for *that* revealed that we were
never initializing the length field of heap arrays.  Fixing that
caused a bunch of tests to crash trying to release stuff.  So...
I've left this in a workaround state right now because I have to
catch a plane.

Swift SVN r4804
2013-04-18 07:58:21 +00:00
John McCall
3713b6a549 Add a framework for distinguishing between deallocating
and non-deallocating destructors and allocating/non-allocating
constructors.

Non-deallocating destructors might not play well with ObjC
classes;  we might have to limit them to pure-swift hierarchies.

No functionality change except that I decided to not force
destructors to have internal linkage unconditionally.

Swift SVN r3814
2013-01-20 19:40:12 +00:00
John McCall
f44ff7bc62 Add offsets in class metadata for fields of generic classes.
The exact condition is that the field's offset might be contingent
on a generic parameter.

Swift SVN r3543
2012-12-19 08:45:52 +00:00
John McCall
d01b272531 Untested infrastructure for emitting non-constant field accesses.
Swift SVN r3542
2012-12-19 08:45:47 +00:00
John McCall
85490080c2 Make protocol thunks expect a metatype pointer (for This) as
their last argument.  Pass it down correctly.

Swift SVN r3042
2012-10-23 07:59:35 +00:00
John McCall
2353465f3f Add an API for reemitting as a substituted type and change
protocol witnesses over to the new API.  There's some badness
that we're papering over here involving generic types, but
this is a necessary first step.

Swift SVN r3003
2012-10-14 07:36:22 +00:00
John McCall
5b10c5df32 Move emitClassMetadataRef to GenMeta.cpp and make it work for
an arbitrary metadata type.

Swift SVN r2862
2012-09-18 07:23:44 +00:00
Chris Lattner
bb92b747f9 make "swift -arc-optimize" actually run the arc optimizer.
Swift SVN r2075
2012-05-30 20:26:34 +00:00
Chris Lattner
d1487a3ede Scaffolding for ARC optimizer pass.
Swift SVN r2027
2012-05-28 00:04:29 +00:00
John McCall
034387b5bb Fix the definition of Alignment::isOne() and implement a
roundUpToAlignment method on Size.

Swift SVN r1649
2012-04-26 07:33:57 +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
d76aaea2b6 Remove the outdated RValue concept; no functionality change.
Swift SVN r1216
2012-03-16 09:26:39 +00:00
John McCall
ea6d6f6f51 Define ResilienceScope, which is used to make optimizations more
aggressive when their ramifications are purely local.



Swift SVN r1093
2012-01-24 22:25:10 +00:00
John McCall
44da666866 Move ExplosionKind to IRGen.h so that using it doesn't
require Explosion.h.  This is just to isolate the parts
of IR-generation that shouldn't have anything to do with
emitting code within functions.



Swift SVN r1039
2012-01-13 10:20:59 +00:00
John McCall
2cd676bf99 IR generation for 'if' statements. Adjust the standard library
to use global functions for the relational operators, just to get
prettier IR.



Swift SVN r679
2011-09-02 19:02:36 +00:00
John McCall
29b25c5868 Add an accessor for computing the alignment at a known offset.
Swift SVN r606
2011-08-25 07:16:39 +00:00
John McCall
ba077c667c Permit sizes to be scaled by a constant factor.
Swift SVN r591
2011-08-24 18:51:14 +00:00
John McCall
97c6ccadfb More IR-generation infrastructure.
Swift SVN r576
2011-08-20 05:55:02 +00:00