diff mbox series

[1/2] add helper has_definition()

Message ID 20201227092759.30999-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series fix rem_usage() | expand

Commit Message

Luc Van Oostenryck Dec. 27, 2020, 9:27 a.m. UTC
Add he 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>
---
 linearize.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ramsay Jones Dec. 28, 2020, 5:20 p.m. UTC | #1
On 27/12/2020 09:27, Luc Van Oostenryck wrote:
> Add he helper has_definition() to check if the pseudo belong to one

s/Add he/Add the/

ATB,
Ramsay Jones

> of the pseudo types having a definition: PSEUDO_REG & PSEUDO_PHI.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
>  linearize.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/linearize.h b/linearize.h
> index 2c548d43526f..c5bdd04257a1 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);
>
diff mbox series

Patch

diff --git a/linearize.h b/linearize.h
index 2c548d43526f..c5bdd04257a1 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);