From 97694d46a39e3d537bfb5bf0880c8649d3f906f7 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 12 Jan 2017 11:55:45 +0300 Subject: [PATCH] estate: add an estate_is_empty() function Signed-off-by: Dan Carpenter --- smatch_estate.c | 5 +++++ smatch_extra.h | 1 + 2 files changed, 6 insertions(+) diff --git a/smatch_estate.c b/smatch_estate.c index cac408da..1a82db5e 100644 --- a/smatch_estate.c +++ b/smatch_estate.c @@ -192,6 +192,11 @@ int estate_is_whole(struct smatch_state *state) return is_whole_rl(estate_rl(state)); } +int estate_is_empty(struct smatch_state *state) +{ + return !estate_rl(state); +} + int estate_is_unknown(struct smatch_state *state) { if (!estate_is_whole(state)) diff --git a/smatch_extra.h b/smatch_extra.h index 08f0408b..bcce859d 100644 --- a/smatch_extra.h +++ b/smatch_extra.h @@ -122,6 +122,7 @@ struct smatch_state *merge_estates(struct smatch_state *s1, struct smatch_state int estates_equiv(struct smatch_state *one, struct smatch_state *two); int estate_is_whole(struct smatch_state *state); +int estate_is_empty(struct smatch_state *state); struct range_list *estate_rl(struct smatch_state *state); struct related_list *estate_related(struct smatch_state *state); -- 2.11.4.GIT