math: array parameters can be NULL
[smatch.git] / check_debug.c
blob8f283dbac9c7580b0a46a8eb9cd85769cbef3948
1 /*
2 * Copyright (C) 2009 Dan Carpenter.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
18 #include <string.h>
20 #include "smatch.h"
21 #include "smatch_slist.h"
22 #include "smatch_extra.h"
24 void show_sname_alloc(void);
25 void show_data_range_alloc(void);
26 void show_ptrlist_alloc(void);
27 void show_rl_ptrlist_alloc(void);
28 void show_sm_state_alloc(void);
30 int local_debug;
31 static int my_id;
32 char *trace_variable;
34 static void match_all_values(const char *fn, struct expression *expr, void *info)
36 struct stree *stree;
38 stree = get_all_states_stree(SMATCH_EXTRA);
39 __print_stree(stree);
40 free_stree(&stree);
43 static void match_cur_stree(const char *fn, struct expression *expr, void *info)
45 __print_cur_stree();
48 static void match_state(const char *fn, struct expression *expr, void *info)
50 struct expression *check_arg, *state_arg;
51 struct sm_state *sm;
52 int found = 0;
54 check_arg = get_argument_from_call_expr(expr->args, 0);
55 if (check_arg->type != EXPR_STRING) {
56 sm_error("the check_name argument to %s is supposed to be a string literal", fn);
57 return;
59 state_arg = get_argument_from_call_expr(expr->args, 1);
60 if (!state_arg || state_arg->type != EXPR_STRING) {
61 sm_error("the state_name argument to %s is supposed to be a string literal", fn);
62 return;
65 FOR_EACH_SM(__get_cur_stree(), sm) {
66 if (strcmp(check_name(sm->owner), check_arg->string->data) != 0)
67 continue;
68 if (strcmp(sm->name, state_arg->string->data) != 0)
69 continue;
70 sm_msg("'%s' = '%s'", sm->name, sm->state->name);
71 found = 1;
72 } END_FOR_EACH_SM(sm);
74 if (!found)
75 sm_msg("%s '%s' not found", check_arg->string->data, state_arg->string->data);
78 static void match_states(const char *fn, struct expression *expr, void *info)
80 struct expression *check_arg;
82 check_arg = get_argument_from_call_expr(expr->args, 0);
83 if (check_arg->type != EXPR_STRING) {
84 sm_error("the check_name argument to %s is supposed to be a string literal", fn);
85 return;
88 if (__print_states(check_arg->string->data))
89 return;
91 if (!id_from_name(check_arg->string->data))
92 sm_msg("invalid check name '%s'", check_arg->string->data);
93 else
94 sm_msg("%s: no states", check_arg->string->data);
97 static void match_print_value(const char *fn, struct expression *expr, void *info)
99 struct stree *stree;
100 struct sm_state *tmp;
101 struct expression *arg_expr;
103 arg_expr = get_argument_from_call_expr(expr->args, 0);
104 if (arg_expr->type != EXPR_STRING) {
105 sm_error("the argument to %s is supposed to be a string literal", fn);
106 return;
109 stree = __get_cur_stree();
110 FOR_EACH_MY_SM(SMATCH_EXTRA, stree, tmp) {
111 if (!strcmp(tmp->name, arg_expr->string->data))
112 sm_msg("%s = %s", tmp->name, tmp->state->name);
113 } END_FOR_EACH_SM(tmp);
116 static void match_print_known(const char *fn, struct expression *expr, void *info)
118 struct expression *arg;
119 struct range_list *rl = NULL;
120 char *name;
121 int known = 0;
122 sval_t sval;
124 arg = get_argument_from_call_expr(expr->args, 0);
125 if (get_value(arg, &sval))
126 known = 1;
128 get_implied_rl(arg, &rl);
130 name = expr_to_str(arg);
131 sm_msg("known: '%s' = '%s'. implied = '%s'", name, known ? sval_to_str(sval) : "<unknown>", show_rl(rl));
132 free_string(name);
135 static void match_print_implied(const char *fn, struct expression *expr, void *info)
137 struct expression *arg;
138 struct range_list *rl = NULL;
139 char *name;
141 arg = get_argument_from_call_expr(expr->args, 0);
142 get_implied_rl(arg, &rl);
144 name = expr_to_str(arg);
145 sm_msg("implied: %s = '%s'", name, show_rl(rl));
146 free_string(name);
149 static void match_real_absolute(const char *fn, struct expression *expr, void *info)
151 struct expression *arg;
152 struct range_list *rl = NULL;
153 char *name;
155 arg = get_argument_from_call_expr(expr->args, 0);
156 get_real_absolute_rl(arg, &rl);
158 name = expr_to_str(arg);
159 sm_msg("real absolute: %s = '%s'", name, show_rl(rl));
160 free_string(name);
163 static void match_print_implied_min(const char *fn, struct expression *expr, void *info)
165 struct expression *arg;
166 sval_t sval;
167 char *name;
169 arg = get_argument_from_call_expr(expr->args, 0);
170 name = expr_to_str(arg);
172 if (get_implied_min(arg, &sval))
173 sm_msg("implied min: %s = %s", name, sval_to_str(sval));
174 else
175 sm_msg("implied min: %s = <unknown>", name);
177 free_string(name);
180 static void match_print_implied_max(const char *fn, struct expression *expr, void *info)
182 struct expression *arg;
183 sval_t sval;
184 char *name;
186 arg = get_argument_from_call_expr(expr->args, 0);
187 name = expr_to_str(arg);
189 if (get_implied_max(arg, &sval))
190 sm_msg("implied max: %s = %s", name, sval_to_str(sval));
191 else
192 sm_msg("implied max: %s = <unknown>", name);
194 free_string(name);
197 static void match_user_rl(const char *fn, struct expression *expr, void *info)
199 struct expression *arg;
200 struct range_list *rl = NULL;
201 bool capped = false;
202 char *name;
204 if (option_project != PROJ_KERNEL)
205 sm_msg("no user data for project = '%s'", option_project_str);
207 arg = get_argument_from_call_expr(expr->args, 0);
208 name = expr_to_str(arg);
210 get_user_rl(arg, &rl);
211 if (rl)
212 capped = user_rl_capped(arg);
213 sm_msg("user rl: '%s' = '%s'%s", name, show_rl(rl), capped ? " (capped)" : "");
215 free_string(name);
218 static void match_capped(const char *fn, struct expression *expr, void *info)
220 struct expression *arg;
221 char *name;
223 arg = get_argument_from_call_expr(expr->args, 0);
224 name = expr_to_str(arg);
225 sm_msg("'%s' = '%s'", name, is_capped(arg) ? "capped" : "not capped");
226 free_string(name);
229 static void match_print_hard_max(const char *fn, struct expression *expr, void *info)
231 struct expression *arg;
232 sval_t sval;
233 char *name;
235 arg = get_argument_from_call_expr(expr->args, 0);
236 name = expr_to_str(arg);
238 if (get_hard_max(arg, &sval))
239 sm_msg("hard max: %s = %s", name, sval_to_str(sval));
240 else
241 sm_msg("hard max: %s = <unknown>", name);
243 free_string(name);
246 static void match_print_fuzzy_max(const char *fn, struct expression *expr, void *info)
248 struct expression *arg;
249 sval_t sval;
250 char *name;
252 arg = get_argument_from_call_expr(expr->args, 0);
253 name = expr_to_str(arg);
255 if (get_fuzzy_max(arg, &sval))
256 sm_msg("fuzzy max: %s = %s", name, sval_to_str(sval));
257 else
258 sm_msg("fuzzy max: %s = <unknown>", name);
260 free_string(name);
263 static void match_print_absolute(const char *fn, struct expression *expr, void *info)
265 struct expression *arg;
266 struct range_list *rl;
267 char *name;
269 arg = get_argument_from_call_expr(expr->args, 0);
270 name = expr_to_str(arg);
272 get_absolute_rl(arg, &rl);
273 sm_msg("absolute: %s = %s", name, show_rl(rl));
275 free_string(name);
278 static void match_print_absolute_min(const char *fn, struct expression *expr, void *info)
280 struct expression *arg;
281 sval_t sval;
282 char *name;
284 arg = get_argument_from_call_expr(expr->args, 0);
285 name = expr_to_str(arg);
287 if (get_absolute_min(arg, &sval))
288 sm_msg("absolute min: %s = %s", name, sval_to_str(sval));
289 else
290 sm_msg("absolute min: %s = <unknown>", name);
292 free_string(name);
295 static void match_print_absolute_max(const char *fn, struct expression *expr, void *info)
297 struct expression *arg;
298 sval_t sval;
299 char *name;
301 arg = get_argument_from_call_expr(expr->args, 0);
302 get_absolute_max(arg, &sval);
304 name = expr_to_str(arg);
305 sm_msg("absolute max: %s = %s", name, sval_to_str(sval));
306 free_string(name);
309 static void match_sval_info(const char *fn, struct expression *expr, void *info)
311 struct expression *arg;
312 sval_t sval;
313 char *name;
315 arg = get_argument_from_call_expr(expr->args, 0);
316 name = expr_to_str(arg);
318 if (!get_implied_value(arg, &sval)) {
319 sm_msg("no sval for '%s'", name);
320 goto free;
323 sm_msg("implied: %s %c%d ->value = %llx", name, sval_unsigned(sval) ? 'u' : 's', sval_bits(sval), sval.value);
324 free:
325 free_string(name);
328 static void match_member_name(const char *fn, struct expression *expr, void *info)
330 struct expression *arg;
331 char *name, *member_name;
333 arg = get_argument_from_call_expr(expr->args, 0);
334 name = expr_to_str(arg);
335 member_name = get_member_name(arg);
336 sm_msg("member name: '%s => %s'", name, member_name);
337 free_string(member_name);
338 free_string(name);
341 static void print_possible(struct sm_state *sm)
343 struct sm_state *tmp;
345 sm_msg("Possible values for %s", sm->name);
346 FOR_EACH_PTR(sm->possible, tmp) {
347 printf("%s\n", tmp->state->name);
348 } END_FOR_EACH_PTR(tmp);
349 sm_msg("===");
352 static void match_possible(const char *fn, struct expression *expr, void *info)
354 struct stree *stree;
355 struct sm_state *tmp;
356 struct expression *arg_expr;
358 arg_expr = get_argument_from_call_expr(expr->args, 0);
359 if (arg_expr->type != EXPR_STRING) {
360 sm_error("the argument to %s is supposed to be a string literal", fn);
361 return;
364 stree = __get_cur_stree();
365 FOR_EACH_MY_SM(SMATCH_EXTRA, stree, tmp) {
366 if (!strcmp(tmp->name, arg_expr->string->data))
367 print_possible(tmp);
368 } END_FOR_EACH_SM(tmp);
371 static void match_strlen(const char *fn, struct expression *expr, void *info)
373 struct expression *arg;
374 struct range_list *rl;
375 char *name;
377 arg = get_argument_from_call_expr(expr->args, 0);
378 get_implied_strlen(arg, &rl);
380 name = expr_to_str(arg);
381 sm_msg("strlen: '%s' %s characters", name, show_rl(rl));
382 free_string(name);
385 static void match_buf_size(const char *fn, struct expression *expr, void *info)
387 struct expression *arg, *comp;
388 struct range_list *rl;
389 int elements, bytes;
390 char *name;
391 char buf[256] = "";
392 int limit_type;
393 int n;
394 sval_t sval;
396 arg = get_argument_from_call_expr(expr->args, 0);
398 elements = get_array_size(arg);
399 bytes = get_array_size_bytes_max(arg);
400 rl = get_array_size_bytes_rl(arg);
401 comp = get_size_variable(arg, &limit_type);
403 name = expr_to_str(arg);
404 n = snprintf(buf, sizeof(buf), "buf size: '%s' %d elements, %d bytes", name, elements, bytes);
405 free_string(name);
407 if (!rl_to_sval(rl, &sval))
408 n += snprintf(buf + n, sizeof(buf) - n, " (rl = %s)", show_rl(rl));
410 if (comp) {
411 name = expr_to_str(comp);
412 snprintf(buf + n, sizeof(buf) - n, "[size_var=%s %s]", limit_type_str(limit_type), name);
413 free_string(name);
415 sm_msg("%s", buf);
418 static void match_note(const char *fn, struct expression *expr, void *info)
420 struct expression *arg_expr;
422 arg_expr = get_argument_from_call_expr(expr->args, 0);
423 if (arg_expr->type != EXPR_STRING) {
424 sm_error("the argument to %s is supposed to be a string literal", fn);
425 return;
427 sm_msg("%s", arg_expr->string->data);
430 static void print_related(struct sm_state *sm)
432 struct relation *rel;
434 if (!estate_related(sm->state))
435 return;
437 sm_prefix();
438 sm_printf("%s: ", sm->name);
439 FOR_EACH_PTR(estate_related(sm->state), rel) {
440 sm_printf("%s ", rel->name);
441 } END_FOR_EACH_PTR(rel);
442 sm_printf("\n");
445 static void match_dump_related(const char *fn, struct expression *expr, void *info)
447 struct stree *stree;
448 struct sm_state *tmp;
450 stree = __get_cur_stree();
451 FOR_EACH_MY_SM(SMATCH_EXTRA, stree, tmp) {
452 print_related(tmp);
453 } END_FOR_EACH_SM(tmp);
456 static void match_compare(const char *fn, struct expression *expr, void *info)
458 struct expression *one, *two;
459 char *one_name, *two_name;
460 int comparison;
461 char buf[16];
463 one = get_argument_from_call_expr(expr->args, 0);
464 two = get_argument_from_call_expr(expr->args, 1);
466 comparison = get_comparison(one, two);
467 if (!comparison)
468 snprintf(buf, sizeof(buf), "<none>");
469 else
470 snprintf(buf, sizeof(buf), "%s", show_special(comparison));
472 one_name = expr_to_str(one);
473 two_name = expr_to_str(two);
475 sm_msg("%s %s %s", one_name, buf, two_name);
477 free_string(one_name);
478 free_string(two_name);
481 static void match_debug_on(const char *fn, struct expression *expr, void *info)
483 option_debug = 1;
486 static void match_debug_check(const char *fn, struct expression *expr, void *info)
488 struct expression *arg;
490 arg = get_argument_from_call_expr(expr->args, 0);
491 if (!arg || arg->type != EXPR_STRING)
492 return;
493 option_debug_check = arg->string->data;
494 sm_msg("arg = '%s'", option_debug_check);
497 static void match_debug_off(const char *fn, struct expression *expr, void *info)
499 option_debug_check = (char *)"";
500 option_debug = 0;
503 static void match_local_debug_on(const char *fn, struct expression *expr, void *info)
505 local_debug = 1;
508 static void match_local_debug_off(const char *fn, struct expression *expr, void *info)
510 local_debug = 0;
513 static void match_debug_db_on(const char *fn, struct expression *expr, void *info)
515 debug_db = 1;
518 static void match_debug_db_off(const char *fn, struct expression *expr, void *info)
520 debug_db = 0;
523 static void mtag_info(struct expression *expr)
525 mtag_t tag = 0;
526 int offset = 0;
527 struct range_list *rl = NULL;
529 expr_to_mtag_offset(expr, &tag, &offset);
530 get_mtag_rl(expr, &rl);
531 sm_msg("mtag = %llu offset = %d rl = '%s'", tag, offset, show_rl(rl));
534 static void match_about(const char *fn, struct expression *expr, void *info)
536 struct expression *arg;
537 struct sm_state *sm;
538 char *name;
540 sm_msg("---- about ----");
541 match_print_implied(fn, expr, NULL);
542 match_buf_size(fn, expr, NULL);
543 match_strlen(fn, expr, NULL);
544 match_real_absolute(fn, expr, NULL);
545 mtag_info(expr);
547 arg = get_argument_from_call_expr(expr->args, 0);
548 name = expr_to_str(arg);
549 if (!name) {
550 sm_msg("info: not a straight forward variable.");
551 return;
554 FOR_EACH_SM(__get_cur_stree(), sm) {
555 if (strcmp(sm->name, name) != 0)
556 continue;
557 sm_msg("%s", show_sm(sm));
558 } END_FOR_EACH_SM(sm);
561 static void match_intersection(const char *fn, struct expression *expr, void *info)
563 struct expression *one, *two;
564 struct range_list *one_rl, *two_rl;
565 struct range_list *res;
567 one = get_argument_from_call_expr(expr->args, 0);
568 two = get_argument_from_call_expr(expr->args, 1);
570 get_absolute_rl(one, &one_rl);
571 get_absolute_rl(two, &two_rl);
573 res = rl_intersection(one_rl, two_rl);
574 sm_msg("'%s' intersect '%s' is '%s'", show_rl(one_rl), show_rl(two_rl), show_rl(res));
577 static void match_type(const char *fn, struct expression *expr, void *info)
579 struct expression *one;
580 struct symbol *type;
581 char *name;
583 one = get_argument_from_call_expr(expr->args, 0);
584 type = get_type(one);
585 name = expr_to_str(one);
586 sm_msg("type of '%s' is: '%s'", name, type_to_str(type));
587 free_string(name);
590 static int match_type_rl_return(struct expression *call, void *unused, struct range_list **rl)
592 struct expression *one, *two;
593 struct symbol *type;
595 one = get_argument_from_call_expr(call->args, 0);
596 type = get_type(one);
598 two = get_argument_from_call_expr(call->args, 1);
599 if (!two || two->type != EXPR_STRING) {
600 sm_msg("expected: __smatch_type_rl(type, \"string\")");
601 return 0;
603 call_results_to_rl(call, type, two->string->data, rl);
604 return 1;
607 static void print_left_right(struct sm_state *sm)
609 if (!sm)
610 return;
611 if (!sm->left && !sm->right)
612 return;
614 sm_printf("[ ");
615 if (sm->left)
616 sm_printf("(%d: %s->'%s')", get_stree_id(sm->left->pool), sm->left->name, sm->left->state->name);
617 else
618 sm_printf(" - ");
621 print_left_right(sm->left);
623 if (sm->right)
624 sm_printf("(%d: %s->'%s')", get_stree_id(sm->right->pool), sm->right->name, sm->right->state->name);
625 else
626 sm_printf(" - ");
628 print_left_right(sm->right);
631 static void match_print_merge_tree(const char *fn, struct expression *expr, void *info)
633 struct sm_state *sm;
634 struct expression *arg;
635 char *name;
637 arg = get_argument_from_call_expr(expr->args, 0);
638 name = expr_to_str(arg);
640 sm = get_sm_state_expr(SMATCH_EXTRA, arg);
641 if (!sm) {
642 sm_msg("no sm state for '%s'", name);
643 goto free;
646 sm_prefix();
647 sm_printf("merge tree: %s -> %s", name, sm->state->name);
648 print_left_right(sm);
649 sm_printf("\n");
651 free:
652 free_string(name);
655 static void match_print_stree_id(const char *fn, struct expression *expr, void *info)
657 sm_msg("stree_id %d", __stree_id);
660 static void match_bits(const char *fn, struct expression *expr, void *_unused)
662 struct expression *arg;
663 struct bit_info *info;
664 char *name;
666 arg = get_argument_from_call_expr(expr->args, 0);
667 name = expr_to_str(arg);
669 info = get_bit_info(arg);
671 sm_msg("bit info '%s': definitely set 0x%llx. possibly set 0x%llx.",
672 name, info->set, info->possible);
675 static void match_mtag(const char *fn, struct expression *expr, void *info)
677 struct expression *arg;
678 char *name;
679 mtag_t tag = 0;
680 int offset = 0;
682 arg = get_argument_from_call_expr(expr->args, 0);
683 name = expr_to_str(arg);
684 expr_to_mtag_offset(arg, &tag, &offset);
685 sm_msg("mtag: '%s' => tag: %llu %d", name, tag, offset);
686 free_string(name);
689 static void match_mtag_data_offset(const char *fn, struct expression *expr, void *info)
691 struct expression *arg;
692 char *name;
693 mtag_t tag = 0;
694 int offset = -1;
696 arg = get_argument_from_call_expr(expr->args, 0);
697 name = expr_to_str(arg);
698 expr_to_mtag_offset(arg, &tag, &offset);
699 sm_msg("mtag: '%s' => tag: %lld, offset: %d", name, tag, offset);
700 free_string(name);
703 static void match_container(const char *fn, struct expression *expr, void *info)
705 struct expression *container, *x;
706 char *cont, *name, *str;
708 container = get_argument_from_call_expr(expr->args, 0);
709 x = get_argument_from_call_expr(expr->args, 1);
711 str = get_container_name(container, x);
712 cont = expr_to_str(container);
713 name = expr_to_str(x);
714 sm_msg("container: '%s' vs '%s' --> '%s'", cont, name, str);
715 free_string(cont);
716 free_string(name);
719 static void match_expr(const char *fn, struct expression *expr, void *info)
721 struct expression *arg, *str, *new;
722 char *name, *new_name;
724 str = get_argument_from_call_expr(expr->args, 0);
725 arg = get_argument_from_call_expr(expr->args, 1);
726 if (!arg || !str)
727 return;
729 if (str->type != EXPR_STRING)
730 return;
732 new = gen_expression_from_key(arg, str->string->data);
733 name = expr_to_str(arg);
734 new_name = expr_to_str(new);
736 sm_msg("str = '%s', arg = '%s' expr = '%s'", str->string->data, name, new_name);
738 free_string(new_name);
739 free_string(name);
741 static void match_state_count(const char *fn, struct expression *expr, void *info)
743 sm_msg("state_count = %d\n", sm_state_counter);
746 static void match_mem(const char *fn, struct expression *expr, void *info)
748 show_sname_alloc();
749 show_data_range_alloc();
750 show_rl_ptrlist_alloc();
751 show_ptrlist_alloc();
752 sm_msg("%lu pools", get_pool_count());
753 sm_msg("%d strees", unfree_stree);
754 show_smatch_state_alloc();
755 show_sm_state_alloc();
758 static void match_exit(const char *fn, struct expression *expr, void *info)
760 exit(0);
763 static struct stree *old_stree;
764 static void trace_var(struct statement *stmt)
766 struct sm_state *sm, *old;
767 int printed = 0;
769 if (!trace_variable)
770 return;
771 if (__inline_fn)
772 return;
774 FOR_EACH_SM(__get_cur_stree(), sm) {
775 if (strcmp(sm->name, trace_variable) != 0)
776 continue;
777 old = get_sm_state_stree(old_stree, sm->owner, sm->name, sm->sym);
778 if (old && old->state == sm->state)
779 continue;
780 sm_msg("[%d] %s '%s': '%s' => '%s'", stmt->type,
781 check_name(sm->owner),
782 sm->name, old ? old->state->name : "<none>", sm->state->name);
783 printed = 1;
784 } END_FOR_EACH_SM(sm);
786 if (printed) {
787 free_stree(&old_stree);
788 old_stree = clone_stree(__get_cur_stree());
792 static void free_old_stree(struct symbol *sym)
794 free_stree(&old_stree);
797 void check_debug(int id)
799 my_id = id;
800 add_function_hook("__smatch_about", &match_about, NULL);
801 add_function_hook("__smatch_all_values", &match_all_values, NULL);
802 add_function_hook("__smatch_state", &match_state, NULL);
803 add_function_hook("__smatch_states", &match_states, NULL);
804 add_function_hook("__smatch_value", &match_print_value, NULL);
805 add_function_hook("__smatch_known", &match_print_known, NULL);
806 add_function_hook("__smatch_implied", &match_print_implied, NULL);
807 add_function_hook("__smatch_implied_min", &match_print_implied_min, NULL);
808 add_function_hook("__smatch_implied_max", &match_print_implied_max, NULL);
809 add_function_hook("__smatch_user_rl", &match_user_rl, NULL);
810 add_function_hook("__smatch_capped", &match_capped, NULL);
811 add_function_hook("__smatch_hard_max", &match_print_hard_max, NULL);
812 add_function_hook("__smatch_fuzzy_max", &match_print_fuzzy_max, NULL);
813 add_function_hook("__smatch_absolute", &match_print_absolute, NULL);
814 add_function_hook("__smatch_absolute_min", &match_print_absolute_min, NULL);
815 add_function_hook("__smatch_absolute_max", &match_print_absolute_max, NULL);
816 add_function_hook("__smatch_real_absolute", &match_real_absolute, NULL);
817 add_function_hook("__smatch_sval_info", &match_sval_info, NULL);
818 add_function_hook("__smatch_member_name", &match_member_name, NULL);
819 add_function_hook("__smatch_possible", &match_possible, NULL);
820 add_function_hook("__smatch_cur_stree", &match_cur_stree, NULL);
821 add_function_hook("__smatch_strlen", &match_strlen, NULL);
822 add_function_hook("__smatch_buf_size", &match_buf_size, NULL);
823 add_function_hook("__smatch_note", &match_note, NULL);
824 add_function_hook("__smatch_dump_related", &match_dump_related, NULL);
825 add_function_hook("__smatch_compare", &match_compare, NULL);
826 add_function_hook("__smatch_debug_on", &match_debug_on, NULL);
827 add_function_hook("__smatch_debug_check", &match_debug_check, NULL);
828 add_function_hook("__smatch_debug_off", &match_debug_off, NULL);
829 add_function_hook("__smatch_local_debug_on", &match_local_debug_on, NULL);
830 add_function_hook("__smatch_local_debug_off", &match_local_debug_off, NULL);
831 add_function_hook("__smatch_debug_db_on", &match_debug_db_on, NULL);
832 add_function_hook("__smatch_debug_db_off", &match_debug_db_off, NULL);
833 add_function_hook("__smatch_intersection", &match_intersection, NULL);
834 add_function_hook("__smatch_type", &match_type, NULL);
835 add_implied_return_hook("__smatch_type_rl_helper", &match_type_rl_return, NULL);
836 add_function_hook("__smatch_merge_tree", &match_print_merge_tree, NULL);
837 add_function_hook("__smatch_stree_id", &match_print_stree_id, NULL);
838 add_function_hook("__smatch_bits", &match_bits, NULL);
839 add_function_hook("__smatch_mtag", &match_mtag, NULL);
840 add_function_hook("__smatch_mtag_data", &match_mtag_data_offset, NULL);
841 add_function_hook("__smatch_expr", &match_expr, NULL);
842 add_function_hook("__smatch_state_count", &match_state_count, NULL);
843 add_function_hook("__smatch_mem", &match_mem, NULL);
844 add_function_hook("__smatch_exit", &match_exit, NULL);
845 add_function_hook("__smatch_container", &match_container, NULL);
847 add_hook(free_old_stree, AFTER_FUNC_HOOK);
848 add_hook(trace_var, STMT_HOOK_AFTER);