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
19 #include "smatch_slist.h"
22 static struct stree
*ignored
;
24 void add_ignore(int owner
, const char *name
, struct symbol
*sym
)
26 set_state_stree(&ignored
, owner
, name
, sym
, &ignore
);
29 int is_ignored(int owner
, const char *name
, struct symbol
*sym
)
31 return !!get_state_stree(ignored
, owner
, name
, sym
);
34 void add_ignore_expr(int owner
, struct expression
*expr
)
39 name
= expr_to_str_sym(expr
, &sym
);
42 add_ignore(owner
, name
, sym
);
46 int is_ignored_expr(int owner
, struct expression
*expr
)
52 name
= expr_to_str_sym(expr
, &sym
);
55 ret
= is_ignored(owner
, name
, sym
);
60 static void clear_ignores(void)
67 void register_smatch_ignore(int id
)
69 add_hook(&clear_ignores
, AFTER_FUNC_HOOK
);