at the end of a variables lifetime. Right now, this is only handles the most
simple case, but it should be conservatively correct now.
This also inserts destroy_addr instructions even for trivial instructions. If
there is a way for SIL passes to query a SILType for triviality, this can be
easily fixed.
Swift SVN r6422
If a protocol requirement is satisfied by a generic method, we'll need to save the substitutions necessary to call that method from the witness thunk. This patch adds the spot in the ProtocolConformance::Mapping to save the substitutions; for now, always leave it empty and update the code for the type change.
Swift SVN r6399
This is a temporary hack until we properly make these carry
their own generic parameters.
This removes the last valid way to get UnboundGenericTypes in
a checked program.
Swift SVN r6373
Elements of a tuple type now know if there is a default argument, and
what kind of default argument it is (callee side, __FILE__, __LINE__,
__COLUMN__), but they don't have an actual expression. There are a
number of cleanups this enables that will follow.
Note that the serialization support is as-yet-untested.
Swift SVN r6351
There is a bunch of copy-and-paste here from the tuple-shuffle
code. The expected trajectory is that ScalarToTupleExpr will grow into
a general TupleConversionExpr, obviating the need for TupleShuffleExpr
entirely and eliminating the redundancy.
Swift SVN r6347
Instead of quietly not bridging. If the Clang importer and other module importers did their job correctly, there's no way the bridge types shouldn't be there at SILGen time. Rearrange the checks to always look for the native type first; if we never see a String, we don't also need to see an NSString, which could legitimately be missing if we didn't import Foundation and don't use any NSString APIs.
Swift SVN r6340
Teach TuplePatternElt to keep track of the kind of the default
argument: none, normal (provided by calling into the appropriate
callee generator), __FILE__, __LINE__, or __COLUMN__. For the latter
three cases, the type checker forms the appropriate argument as part
of the call.
The actual default argument expression will only be held in the tuple
pattern element when we've parsed it; it won't be serialized or
deserialized, because only the defining module cares. This is a step
toward eliminate the initialization expression from tuple types.
The extension to TupleShuffleExpr is a hack, which will also be
replicated in ScalarToTupleExpr, until we finally rework the
representation of TupleShuffleExpr (<rdar://problem/12340004>).
Swift SVN r6299
This change switches SIL generation for default values over to using
the default argument generators we started emitting in r6258. Note
that we don't use these entry points for default arguments involving
__FILE__, __LINE__, or __COLUMN___. These will need a different kind
of magic.
Swift SVN r6295
As per Chris's suggestion (review of r6152), further refactored SILLocation not to derive from PointerUnion3 but to include it as a member.
In addition, added some template magic to make sure we don't have to chain dyn_casts, which I suspect will be/is happening a lot with SILLocation:
Ex:
- if (auto E = Func.dyn_cast<Expr*>()) {
- if (const FuncExpr *FE = dyn_cast<FuncExpr>(E))
- return SILLocation(FE->getBody())
+ if (const FuncExpr *FE = Func.getAs<FuncExpr>())
+ return SILLocation(FE->getBody());
Swift SVN r6283
Modify SILPrinter to print necessary types for parsing.
Format of copy_addr is changed from
copy_addr Src [take]? to Dst [initialization]?
to
copy_addr [take]? Src to [initialization]? Dst : DstType
to put the attribute in front of the actual value.
It also makes parsing easier since '[' can start an array type.
Swift SVN r6268
In the resilience model for default arguments, the presence of a
default argument is API, but its specific value is not. Thus, the
actual default argument values can evolve over time. To implement
this, for each default argument, we emit a function that
takes no arguments and produces the default value for that
argument. The caller will then call that function to form the default
argument.
This commit emits these functions for each default argument, even
though they are not currently being called. This is part of
<rdar://problem/11561185>.
We'll probably want a different calling convention for these functions
that preserves all registers, since they will often end up being very
trivial functions.
Swift SVN r6260