From 562b114c34f84b2aec0b025bf92af7cb10ebfb31 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 1 Dec 2015 16:08:38 +0300 Subject: [PATCH] smatch: remove --known_conditions option This option is useless. Remove it. Signed-off-by: Dan Carpenter --- smatch.c | 2 -- smatch.h | 1 - smatch_flow.c | 13 ------------- 3 files changed, 16 deletions(-) diff --git a/smatch.c b/smatch.c index ff81469a..3830f334 100644 --- a/smatch.c +++ b/smatch.c @@ -132,7 +132,6 @@ static void help(void) printf("--debug-implied: print debug output about implications.\n"); printf("--no-implied: ignore implications.\n"); printf("--assume-loops: assume loops always go through at least once.\n"); - printf("--known-conditions: don't branch for known conditions.\n"); printf("--two-passes: use a two pass system for each function.\n"); printf("--file-output: instead of printing stdout, print to \"file.c.smatch_out\".\n"); printf("--help: print this helpful message.\n"); @@ -216,7 +215,6 @@ void parse_args(int *argcp, char ***argvp) OPTION(debug_related); OPTION(no_implied); OPTION(assume_loops); - OPTION(known_conditions); OPTION(no_data); OPTION(two_passes); OPTION(full_path); diff --git a/smatch.h b/smatch.h index f4c9749f..0b4c4ba3 100644 --- a/smatch.h +++ b/smatch.h @@ -409,7 +409,6 @@ void __split_expr(struct expression *expr); void __split_stmt(struct statement *stmt); extern int __in_function_def; extern int option_assume_loops; -extern int option_known_conditions; extern int option_two_passes; extern int option_no_db; extern int option_file_output; diff --git a/smatch_flow.c b/smatch_flow.c index 71521f87..a9605bb1 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -66,7 +66,6 @@ static void add_inline_function(struct symbol *sym); static void parse_inline(struct expression *expr); int option_assume_loops = 0; -int option_known_conditions = 0; int option_two_passes = 0; struct symbol *cur_func_sym = NULL; struct stree *global_states; @@ -891,18 +890,6 @@ void __split_stmt(struct statement *stmt) __split_stmt(stmt->if_false); break; } - if (option_known_conditions && - implied_condition_true(stmt->if_conditional)) { - sm_info("this condition is true."); - __split_stmt(stmt->if_true); - break; - } - if (option_known_conditions && - implied_condition_false(stmt->if_conditional)) { - sm_info("this condition is false."); - __split_stmt(stmt->if_false); - break; - } __split_whole_condition(stmt->if_conditional); __split_stmt(stmt->if_true); if (empty_statement(stmt->if_true) && -- 2.11.4.GIT