diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-12-27 01:34:41 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-12-29 14:54:17 +0100 |
commit | 6956d2711272f2781690a79bae5bfa5ca3dada2e (patch) | |
tree | 7b3d53dc6e99c010aae7bf180476505503a70fc9 | |
parent | 1b896707d95982c7c9cdd5cd0ab4afd80f766a94 (diff) | |
download | sparse-6956d2711272f2781690a79bae5bfa5ca3dada2e.tar.gz |
add helper has_definition()
Add the helper has_definition() to check if the pseudo belong to one
of the pseudo types having a definition: PSEUDO_REG & PSEUDO_PHI.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | linearize.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linearize.h b/linearize.h index 2c548d43..c5bdd042 100644 --- a/linearize.h +++ b/linearize.h @@ -249,6 +249,11 @@ static inline int has_use_list(pseudo_t p) return (p && p->type != PSEUDO_VOID && p->type != PSEUDO_UNDEF && p->type != PSEUDO_VAL); } +static inline bool has_definition(pseudo_t p) +{ + return p->type == PSEUDO_REG || p->type == PSEUDO_PHI; +} + static inline int pseudo_user_list_size(struct pseudo_user_list *list) { return ptr_list_size((struct ptr_list *)list); |