Commit Graph

57 Commits

Author SHA1 Message Date
John McCall
fd66196c21 Add CleanupStateRestorationScope, which allows the
state of a cleanup to be restored after emitting
a path that may have e.g. activated it.

This should be used very carefully, because it makes
it quite simple to foul up your cleanup logic.

To be useful for temporarily deactivating cleanups,
we need a state that prevents forwarding from killing
the cleanup.

Swift SVN r19331
2014-06-30 11:55:23 +00:00
Joe Groff
f3f9c3edb4 SILGen: Relax assertion that there are no active cleanups between the current scope and the return scope.
The cleanup stack pointer is not reset when there are only dead cleanups in a scope, so relax this assertion to check that there are no live cleanups instead of that the cleanup handles are at the same height. Fixes <rdar://problem/16203107>.

Swift SVN r14674
2014-03-05 05:34:53 +00:00
Chris Lattner
5c8e9bc070 split SILGenFunction & SGFContext out to a new header, to trim down SILGen.h
to being global stuff.


Swift SVN r10926
2013-12-06 18:40:20 +00:00
John McCall
916b566fa6 Push and invalidate uninitialized-local cleanups.
No effect currently; just resolves a FIXME.

Swift SVN r8830
2013-10-02 01:27:39 +00:00
Anna Zaks
8f3c9002d0 [SIL] Add cleanup locations to SIL instructions.
I've decided to keep only the location of the scope AST node that corresponds to the cleanup. (Currently, there is no user that needs the originator expression, which caused the cleanup. So keeping things simple.)

Added the cleanup location to the Scope and JumpDest classes, which gets assigned on construction of those. The Scope's and JumpDest locations are used when we emit the cleanup instructions.

We now give better location info for 2 existing tests for definitive initialization.

(+ Rather sparse testing of all this.)

Swift SVN r7764
2013-08-29 23:14:22 +00:00
Anna Zaks
b67f3c3552 [SIL] Use the ReturnLocation/ImplicitReturnLocation instead of generic SILLocations.
We mark the branch instructions leading into single epilog code with ReturnLocation/ImplicitReturnLocation. If SIL Gen simplifies the code and merges the code representing the return into the epilog block, the terminator of the epilog block (the ReturnInst) will have the return location info on it. Otherwise, the ReturnInst has the RegularLocation, which represents the enclosing FunctionExpr or Constructor/Destructor Decls.
(I've discussed dropping the optimization from SILGen, and keeping the epilog code canonical, with Adrian; but he said that there might not be any wins in doing so, so keeping it for now.)

Added AutoGeneratedLocation to represent segments of code generated by SILGen. This will be used for thunks and other auto-generated segments.

Swift SVN r7634
2013-08-27 22:16:24 +00:00
Stephen Lin
8d90466523 Reorganize SIL source tree: move lib/SIL/SILGen -> lib/SILGen, move lib/SIL/Passes -> lib/SILPasses, add lib/SILPasses/Utils
Swift SVN r7246
2013-08-14 23:47:29 +00:00