mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
rework our representations of subscripts to not curry the indexes
separately from the get/set value. There is no exposed way in the source language to use this, and this causes shorter term annoyance. I chose to flatten the value and indices so the value comes first. In principle, this allows us to completely eliminate our ObjC importer thunks. I haven't removed them though, because they might be useful for something else. Swift SVN r14049
This commit is contained in:
@@ -65,13 +65,12 @@ Initialization::getSubInitializationsForTuple(SILGenFunction &gen, CanType type,
|
||||
SmallVectorImpl<InitializationPtr> &buf,
|
||||
SILLocation Loc) {
|
||||
assert(canSplitIntoSubelementAddresses() && "Client shouldn't call this");
|
||||
auto tupleTy = cast<TupleType>(type);
|
||||
switch (kind) {
|
||||
case Kind::Tuple:
|
||||
return getSubInitializations();
|
||||
case Kind::Ignored:
|
||||
// "Destructure" an ignored binding into multiple ignored bindings.
|
||||
for (auto fieldType : tupleTy->getElementTypes()) {
|
||||
for (auto fieldType : cast<TupleType>(type)->getElementTypes()) {
|
||||
(void) fieldType;
|
||||
buf.push_back(InitializationPtr(new BlackHoleInitialization()));
|
||||
}
|
||||
@@ -79,6 +78,7 @@ Initialization::getSubInitializationsForTuple(SILGenFunction &gen, CanType type,
|
||||
case Kind::LetValue:
|
||||
case Kind::SingleBuffer: {
|
||||
// Destructure the buffer into per-element buffers.
|
||||
auto tupleTy = cast<TupleType>(type);
|
||||
SILValue baseAddr = getAddress();
|
||||
for (unsigned i = 0, size = tupleTy->getNumElements(); i < size; ++i) {
|
||||
auto fieldType = tupleTy.getElementType(i);
|
||||
|
||||
Reference in New Issue
Block a user