mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[MemAccessUtils] Visit access as unique storage uses.
Add a new member functino UniqueStorageUseVisitor::visitBeginAccess and call it when GatherUniqueStorageUses runs.
This commit is contained in:
@@ -1098,7 +1098,6 @@ public:
|
||||
// ignores its subclass bits.
|
||||
AccessPath(AccessStorage storage, PathNode pathNode, int offset)
|
||||
: storage(storage), pathNode(pathNode), offset(offset) {
|
||||
assert(storage.getKind() != AccessStorage::Nested);
|
||||
assert(pathNode.isValid() || !storage && "Access path requires a pathNode");
|
||||
}
|
||||
|
||||
@@ -1337,6 +1336,7 @@ namespace swift {
|
||||
/// to the storage within this function is derived from these roots.
|
||||
///
|
||||
/// Gather the kinds of uses that are typically relevant to algorithms:
|
||||
/// - accesses (specifically, begin_access insts)
|
||||
/// - loads (including copies out of, not including inout args)
|
||||
/// - stores (including copies into and inout args)
|
||||
/// - destroys (of the entire aggregate)
|
||||
@@ -1353,6 +1353,7 @@ struct UniqueStorageUseVisitor {
|
||||
|
||||
virtual ~UniqueStorageUseVisitor() = default;
|
||||
|
||||
virtual bool visitBeginAccess(Operand *use) = 0;
|
||||
virtual bool visitLoad(Operand *use) = 0;
|
||||
virtual bool visitStore(Operand *use) = 0;
|
||||
virtual bool visitDestroy(Operand *use) = 0;
|
||||
|
||||
Reference in New Issue
Block a user