From 7dd18f1b4320445eb6625b479f17e2da8ad52110 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 30 Dec 2009 21:51:49 +0200 Subject: [PATCH] param_mapper: add --param-mapper option param_mapper is too spammy even for --spammy so it needs its own option. Signed-off-by: Dan Carpenter --- check_param_mapper.c | 2 +- smatch.c | 5 +++++ smatch.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/check_param_mapper.c b/check_param_mapper.c index b3f82e8f..e485460e 100644 --- a/check_param_mapper.c +++ b/check_param_mapper.c @@ -98,7 +98,7 @@ static void match_call(struct expression *expr) void check_param_mapper(int id) { - if (!option_spammy) + if (!option_param_mapper) return; my_id = id; add_hook(&match_function_def, FUNC_DEF_HOOK); diff --git a/smatch.c b/smatch.c index b7603035..417beb30 100644 --- a/smatch.c +++ b/smatch.c @@ -18,6 +18,7 @@ char *data_dir; int option_no_data = 0; int option_spammy = 0; int option_full_path = 0; +int option_param_mapper = 0; typedef void (*reg_func) (int id); void register_smatch_extra(int id); @@ -132,6 +133,7 @@ static void help(void) printf("--project= or -p=: project specific tests\n"); printf("--spammy: print superfluous crap.\n"); printf("--debug: print lots of debug output.\n"); + printf("--param-mapper: enable param_mapper output.\n"); printf("--no-data: do not use the /smatch_data/ directory.\n"); printf("--full-path: print the full pathname.\n"); printf("--debug-implied: print debug output about implications.\n"); @@ -185,6 +187,9 @@ void parse_args(int *argcp, char ***argvp) } else if (!strcmp((*argvp)[1], "--full-path")) { option_full_path = 1; (*argvp)[1] = (*argvp)[0]; + } else if (!strcmp((*argvp)[1], "--param-mapper")) { + option_param_mapper = 1; + (*argvp)[1] = (*argvp)[0]; } else if (!strcmp((*argvp)[1], "--help")) { help(); } else { diff --git a/smatch.h b/smatch.h index e65874ae..9a96129d 100644 --- a/smatch.h +++ b/smatch.h @@ -347,6 +347,7 @@ extern char *data_dir; extern int option_no_data; extern int option_spammy; extern int option_full_path; +extern int option_param_mapper; extern struct smatch_state *default_state[]; enum project_type { -- 2.11.4.GIT