From 6956d2711272f2781690a79bae5bfa5ca3dada2e Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sun, 27 Dec 2020 01:34:41 +0100 Subject: 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 --- linearize.h | 5 +++++ 1 file changed, 5 insertions(+) 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); -- cgit 1.2.3-korg