Skip to content

Commit 1933486

Browse files
authored
Merge pull request #62916 from gottesmm/pruned-liveness-boundary
[move-only-addr] Finish field sensitive pruned liveness boundary and use it in the move only address checker.
2 parents fb01580 + 1c459b6 commit 1933486

14 files changed

+2867
-874
lines changed

include/swift/Basic/FrozenMultiMap.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,26 @@ class FrozenMultiMap {
259259
return !pair.second.hasValue();
260260
});
261261
}
262+
263+
typename VectorStorage::iterator vector_begin() {
264+
assert(isFrozen() && "Can only call this in map mode");
265+
return storage.begin();
266+
}
267+
268+
typename VectorStorage::iterator vector_end() {
269+
assert(isFrozen() && "Can only call this in map mode");
270+
return storage.end();
271+
}
272+
273+
typename VectorStorage::const_iterator vector_begin() const {
274+
assert(isFrozen() && "Can only call this in map mode");
275+
return storage.begin();
276+
}
277+
278+
typename VectorStorage::const_iterator vector_end() const {
279+
assert(isFrozen() && "Can only call this in map mode");
280+
return storage.end();
281+
}
262282
};
263283

264284
template <typename Key, typename Value, typename Storage>

include/swift/SIL/FieldSensitivePrunedLiveness.h

Lines changed: 432 additions & 59 deletions
Large diffs are not rendered by default.

include/swift/SIL/SILType.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ class SILType {
495495
SILType getFieldType(VarDecl *field, SILModule &M,
496496
TypeExpansionContext context) const;
497497

498+
SILType getFieldType(VarDecl *field, SILFunction *fn) const;
499+
498500
/// Given that this is an enum type, return the lowered type of the
499501
/// data for the given element. Applies substitutions as necessary.
500502
/// The result will have the same value category as the base type.

lib/SIL/IR/SILType.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ SILType SILType::getFieldType(VarDecl *field, SILModule &M,
320320
return getFieldType(field, M.Types, context);
321321
}
322322

323+
SILType SILType::getFieldType(VarDecl *field, SILFunction *fn) const {
324+
return getFieldType(field, fn->getModule(), fn->getTypeExpansionContext());
325+
}
326+
323327
SILType SILType::getEnumElementType(EnumElementDecl *elt, TypeConverter &TC,
324328
TypeExpansionContext context) const {
325329
assert(elt->getDeclContext() == getEnumOrBoundGenericEnum());

0 commit comments

Comments
 (0)