File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -466,9 +466,15 @@ class ValueBase : public SILNode, public SILAllocated<ValueBase> {
466
466
// / entire use list.
467
467
inline bool hasTwoUses () const ;
468
468
469
- // / Helper struct for DowncastUserFilterRange
469
+ // / Helper struct for DowncastUserFilterRange and UserRange
470
470
struct UseToUser ;
471
471
472
+ using UserRange =
473
+ llvm::iterator_range<llvm::mapped_iterator<swift::ValueBaseUseIterator,
474
+ swift::ValueBase::UseToUser,
475
+ swift::SILInstruction *>>;
476
+ inline UserRange getUsers () const ;
477
+
472
478
template <typename Subclass>
473
479
using DowncastUserFilterRange =
474
480
DowncastFilterRange<Subclass,
@@ -1439,6 +1445,10 @@ struct ValueBase::UseToUser {
1439
1445
SILInstruction *operator ()(Operand &use) { return use.getUser (); }
1440
1446
};
1441
1447
1448
+ inline ValueBase::UserRange ValueBase::getUsers () const {
1449
+ return llvm::map_range (getUses (), ValueBase::UseToUser ());
1450
+ }
1451
+
1442
1452
template <typename T>
1443
1453
inline ValueBase::DowncastUserFilterRange<T> ValueBase::getUsersOfType () const {
1444
1454
auto begin = llvm::map_iterator (use_begin (), UseToUser ());
You can’t perform that action at this time.
0 commit comments