2 * smatch/check_db_info.c
4 * Copyright (C) 2010 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
11 #include "smatch_extra.h"
15 static struct range_list
*return_ranges
;
17 static void add_return_range(struct range_list
*rl
)
23 return_ranges
= range_list_union(return_ranges
, rl
);
26 static void match_return(struct expression
*ret_value
)
28 struct range_list
*rl
;
30 ret_value
= strip_expr(ret_value
);
34 if (get_implied_range_list(ret_value
, &rl
))
37 add_return_range(whole_range_list());
40 static void match_end_func(struct symbol
*sym
)
44 sm_msg("info: function_return_values '%s' %s",
45 show_ranges(return_ranges
), global_static());
49 void check_db_info(int id
)
54 add_hook(&match_return
, RETURN_HOOK
);
55 add_hook(&match_end_func
, END_FUNC_HOOK
);