ConstructorDecl::getBody() and DestructorDecl::getBody() return 'BraceStmt *'.
After changing the AST representation for functions, FuncDecl::getBody() will
return 'BraceStmt *' and FuncDecl::getFuncExpr() will be gone.
Swift SVN r8050
global variables used by functions in the capture list as well.
SILGen and other things that don't care about these (i.e., all
current current clients) filter the list to get what they want.
This is needed for future definite init improvements, and unblocked
by Doug's patch in r8039 (thanks! :)
No functionality change.
Swift SVN r8045
move the corresponding functionality into SILGen.
I've switched around 'assign' so that it's no longer a
semantic assignment --- that is, so that it expects a properly
lowered value as its operand, not an r-value of the semantic
type. This actually simplifies quite a lot of code and removes
some ugly special-casing from MemoryPromotion.
Swift SVN r7942
Tuple exploding happens during RValue construction, so changed the constructor and addElement() method to take the location parameter. The imploding happens on RValue::forwardAsSingleValue and RValue::getAsSingleValue(). Make sure the right SIL locations are passed to all of these
Also, added some missing locations in pattern matching code.
Swift SVN r7916
Auto generated location should not be a separate location kind since
we might have different kinds of auto generated locations (ex: cleanup,
return). Even though the kind info might not be necessary for diagnostics or
debug info, it allows us to better use type system, for example, only pass
CleanupLocation where expected.
Swift SVN r7816
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
This was not likely an error-free change. Where you see problems
please correct them. This went through a fairly tedious audit
before committing, but comments might have been changed incorrectly,
not changed at all, etc.
Swift SVN r7631
This is was a very mechanical patch where I basically first renamed SILNodes.def
and then just kept fixing things until everything compiled, so even though it is
large patch I feel ok(ish) with committing it.
If anyone has any concerns/etc, please email me and I will revert in 1 second.
Swift SVN r7604
We had a weird (and problematic for me) situation before where
tuple initializations would not recursively finalize their tuple
elements when they were finalized. Making them do so runs afoul
of the poorly named Initialization::getSubInitializations(x,y,z)
method, which had nothing to do with the
Initialization::getSubInitializations() method. Rename the former
to "getSubInitializationsForTuple" to make it more clear what is
going on, and make it handle the finalization of the SingleElement
initialization when it explodes it.
No functionality change, this unblocks some cases definite init was
tripping over.
Swift SVN r7600
Generate union constructors as SIL functions using the new 'union' instruction. Change UnionTypeInfo::emitInjectionFunctionBody into UnionTypeInfo::emitInjection, which emits the union value to an explosion rather than emitting the scalar return directly, and use it to implement IRGen lowering of the 'union' instruction.
This breaks a few serialization tests because of mangler bugs handling generic unions, which I'll fix next.
Swift SVN r7559
This is a baby step toward eliminating GenericParamList from
PolymorphicFunctionType, fixing up the easy callers. No functionality
change.
Swift SVN r7370
Previously, TypeAliasDecl was used for typealiases, generic
parameters, and assocaited types, which is hideous and the source of
much confusion. Factor the latter two out into their own decl nodes,
with a common abstract base for "type parameters", and push these
nodes throughout the frontend.
No real functionality change, but this is a step toward uniquing
polymorphic types, among other things.
Swift SVN r7345