diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2016-12-17 10:29:56 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-07-23 13:11:20 +0200 |
| commit | 90cc2706010c1d2eb8cedf0765c95cbb2d5bd38b (patch) | |
| tree | 9784418bede0ff8d6a0e6b7fc2c6f5d353616d73 /linearize.h | |
| parent | 68e67287e6f373e100813dbebd10b01ab722dd18 (diff) | |
| download | sparse-dev-90cc2706010c1d2eb8cedf0765c95cbb2d5bd38b.tar.gz | |
extract nbr_users() from unssa.c
This small helper was used in unssa.c but is useful elsewhere too.
Move it as an inline function to linearize.h and rename it to
'nbr_users()' since it is close to the existing 'has_users()'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'linearize.h')
| -rw-r--r-- | linearize.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linearize.h b/linearize.h index 092e1ac2..2bd6185a 100644 --- a/linearize.h +++ b/linearize.h @@ -338,6 +338,11 @@ static inline int has_users(pseudo_t p) return pseudo_user_list_size(p->users) != 0; } +static inline int nbr_users(pseudo_t p) +{ + return pseudo_user_list_size(p->users); +} + static inline struct pseudo_user *alloc_pseudo_user(struct instruction *insn, pseudo_t *pp) { struct pseudo_user *user = __alloc_pseudo_user(0); |
