introduce in_macro() which returns true if we're in a macro
[smatch.git] / check_call_tree.c
blob0ccf0271268f33e9042f27c021cd488c171bc805
1 /*
2 * sparse/check_call_tree.c
4 * Copyright (C) 2009 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
8 */
10 #include "smatch.h"
12 static int my_id;
14 static void match_call(struct expression *expr)
16 char *fn_name;
18 fn_name = get_variable_from_expr(expr->fn, NULL);
19 if (!fn_name)
20 return;
21 sm_msg("info: func_call %s", fn_name);
22 free_string(fn_name);
25 void check_call_tree(int id)
27 if (!option_call_tree)
28 return;
29 my_id = id;
30 add_hook(&match_call, FUNCTION_CALL_HOOK);