Skip to content

Commit 89dce92

Browse files
committed
---
yaml --- r: 349194 b: refs/heads/master-next c: 9bd6fec h: refs/heads/master
1 parent 8ef5b4b commit 89dce92

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 70ad47332ece273599642faedc3a8718a9289459
3+
refs/heads/master-next: 9bd6fec6970799ee419cff712005b81e7dfd74b4
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/include/swift/SIL/Projection.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,9 @@ class ProjectionTreeNode {
757757

758758
llvm::Optional<Projection> &getProjection() { return Proj; }
759759

760-
llvm::SmallVector<Operand *, 4> getNonProjUsers() const {
761-
return NonProjUsers;
762-
};
760+
const ArrayRef<Operand *> getNonProjUsers() const {
761+
return llvm::makeArrayRef(NonProjUsers);
762+
}
763763

764764
bool isLeaf() const { return ChildProjections.empty(); }
765765

@@ -960,7 +960,9 @@ class ProjectionTree {
960960
void
961961
replaceValueUsesWithLeafUses(SILBuilder &B, SILLocation Loc,
962962
llvm::SmallVectorImpl<SILValue> &Leafs);
963-
963+
964+
void getUsers(SmallPtrSetImpl<SILInstruction *> &users) const;
965+
964966
private:
965967
void createRoot(SILType BaseTy) {
966968
assert(ProjectionTreeNodes.empty() &&

branches/master-next/lib/SIL/Projection.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,3 +1514,11 @@ replaceValueUsesWithLeafUses(SILBuilder &Builder, SILLocation Loc,
15141514
NewNodes.clear();
15151515
}
15161516
}
1517+
1518+
void ProjectionTree::getUsers(SmallPtrSetImpl<SILInstruction *> &users) const {
1519+
for (auto *node : ProjectionTreeNodes) {
1520+
for (auto *op : node->getNonProjUsers()) {
1521+
users.insert(op->getUser());
1522+
}
1523+
}
1524+
}

0 commit comments

Comments
 (0)