Commit Graph

83 Commits

Author SHA1 Message Date
John McCall
c3eae4ae04 Make it convenient to generate an undef address.
For most types, this is really only useful in the presence of
an unimplemented operation, but for empty types this does come
up quite reasonably.

Swift SVN r4897
2013-04-25 01:39:30 +00:00
Chris Lattner
5664431c9a remove Cleanup.h and references to the Cleanup class, along with
some dead logic in IRGenFunction.



Swift SVN r4847
2013-04-21 06:36:22 +00:00
Chris Lattner
9ae0cf3bee inline Initialization::emitLocalAllocation into each of its callers and
eliminate the Initialization class and GenInit.h.  GenInit.cpp will stay
around, as it has some other random stuff in it.


Swift SVN r4845
2013-04-21 06:13:59 +00:00
Chris Lattner
d523932d85 remove InitializedObject.
Swift SVN r4844
2013-04-21 06:05:01 +00:00
Chris Lattner
510042f939 removed the registration logic from Initialization and Depth from Scope.
Swift SVN r4842
2013-04-21 05:39:35 +00:00
Chris Lattner
e8686c9560 remove Cleanups from IGF, simplify Initialization a bit.
Swift SVN r4841
2013-04-21 05:28:04 +00:00
Chris Lattner
6e50329da3 remove the cleanups list from CallEmission and ManagedValue, along with the machinery for adding Cleanups.
Swift SVN r4840
2013-04-21 05:16:00 +00:00
Chris Lattner
e3d6a489af remove the Cleanup subclasses.
Swift SVN r4839
2013-04-21 05:06:52 +00:00
Chris Lattner
519fa983ac remove some more little bits of stuff. Move the last
method remaining in GenLValue.cpp to GenType.cpp where
it belongs, and zap GenLValue.cpp


Swift SVN r4826
2013-04-19 04:19:18 +00:00
Chris Lattner
f60b1b65cf remove some dead initialization logic.
Swift SVN r4806
2013-04-18 18:00:44 +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
Chris Lattner
1abf1d0ebc remove RValueEmitter and some implementation logic for it, as well as
FullExpr.  Scope is kept alive by one dangling thread, rdar://13681467


Swift SVN r4798
2013-04-18 05:24:50 +00:00
John McCall
8fe4246833 Hide StorageSize/Alignment behind accessors in preparation for moving
them to a subclass.

Swift SVN r4779
2013-04-17 21:55:41 +00:00
Chris Lattner
ffe3388aa5 remove the dead logic form GenTuple, RValueInitEmitter, and some
erasure/protocol expr logic.


Swift SVN r4775
2013-04-17 06:34:27 +00:00
Chris Lattner
dace3e95fd remove local decl emission and local pattern binding emission.
Swift SVN r4769
2013-04-17 05:09:37 +00:00
Joe Groff
08d06e850d IRGen: Emit top-level globals from SIL.
Set up IRGen to emit SIL code that uses top-level-code global variables. Add -sil-i to a bunch of Interpreter tests that use global variables.

Swift SVN r4480
2013-03-22 23:34:38 +00:00
Joe Groff
8320df8b9d IRGen: SIL branching and variable allocation.
Implement SIL-to-IR lowering for allocation, deallocation, load, store, and branching instructions so that local variables and branching control flow can be used. Add a Fibonacci loop test to exercise the new instructions.

Swift SVN r3767
2013-01-15 22:32:49 +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
Chris Lattner
47dbc4051c update for mainline LLVM header file moves.
Swift SVN r3634
2013-01-02 14:38:42 +00:00
Eli Friedman
6a34b36e67 Attempt to handle empty global variables correctly. <rdar://problem/12490628>
Swift SVN r2999
2012-10-12 22:18:42 +00:00
Eli Friedman
3d85d78651 Add a missing call to Initialization::markInitialized in GenInit. <rdar://problem/11851415>.
Swift SVN r2345
2012-07-11 21:45:21 +00:00
John McCall
e53aed65d7 Initial support for IR-genning generic function bodies.
Mangling is still a hack, pending a better type AST.  Fixed
a bug where arguments passed indirectly were not being destroyed
by the callee (when passed by value).  Changed some of the protocol
signatures to use the generic opaque pointer type, making the
types a bit more self-documenting in the IR.

Swift SVN r2274
2012-06-28 08:50:06 +00:00
John McCall
6c821ddc1b Support allocating local objects of archetype type, at least in
theory.

Swift SVN r2245
2012-06-25 20:45:04 +00:00
John McCall
8203b795ef Trivial refactor in preparation for making Initialization part
of the TypeInfo API.

Swift SVN r2244
2012-06-25 20:45:03 +00:00
John McCall
e3ea138183 Pack of changes leading towards a more-correct implementation
of archetypes.

Swift SVN r2243
2012-06-25 20:45:01 +00:00
John McCall
e2440ff94c Split TypeInfo into its own header.
Swift SVN r2240
2012-06-25 20:44:51 +00:00
Eli Friedman
26bebcfd61 IRGen for break/continue.
Swift SVN r2089
2012-05-31 02:45:18 +00:00
John McCall
40d1591f89 Some minor tweaks to make our use of the allocation entrypoints
match the actual entrypoints vended by the runtime:
1) there is no swift_slowRawAlloc
2) swift_deallocObject takes two arguments
Also, make all calls to swift_allocObject go through a common
function so that we can easily use optimized entrypoints if the
runtime provides them.

Swift SVN r1993
2012-05-25 17:34:59 +00:00
John McCall
675ec2234c Teach IRGen how to emit a call or load directly as the initializer for
some hunk of memory.

Swift SVN r1893
2012-05-18 10:01:38 +00:00
Eli Friedman
ae08edf5bb Do a bit of naming cleanup in IRGen. Make sure closure IRgen doesn't get confused when we capture something other than a variable.
Swift SVN r1644
2012-04-25 23:47:57 +00:00
Eli Friedman
d5e7784010 Get rid of isModuleScope bit, since we don't like scattering bits across the AST; as a replacement, introduce TopLevelCodeDecl, which provides a DeclContext for all expressions and statements at the top level. <rdar://problem/11259941>.
Swift SVN r1503
2012-04-19 21:22:12 +00:00
John McCall
5ad3782b01 Rework the IR-generation of initialization and teach the
compiler to enter properly-scoped cleanups to destroy local
variables.

Swift SVN r1385
2012-04-11 03:00:08 +00:00
John McCall
5c23fa7326 Move the initialization code out into its own file.
Swift SVN r1381
2012-04-11 02:59:55 +00:00