diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/parse_kconfig/doutput.c | 38 | ||||
-rw-r--r-- | scripts/parse_kconfig/doutput.h | 2 | ||||
-rw-r--r-- | scripts/parse_kconfig/parse.c | 2 |
3 files changed, 41 insertions, 1 deletions
diff --git a/scripts/parse_kconfig/doutput.c b/scripts/parse_kconfig/doutput.c index ac7927f..5b94842 100644 --- a/scripts/parse_kconfig/doutput.c +++ b/scripts/parse_kconfig/doutput.c @@ -2,7 +2,7 @@ void doutput_expr(struct expr *expr) { #ifdef DEBUG - if (verbose_level < 3) + if (verbose_level <= 3) return; switch (expr->type) { case E_OR: @@ -62,3 +62,39 @@ void doutput_expr(struct expr *expr) { } #endif /* DEBUG */ } + +void doutput_boolexpr(struct boolexpr *bl, struct symlist *sl) { +#ifdef DEBUG + if (verbose_level <= 3) + return; + switch (bl->type) { + case BT_TRUE: + printf(" true\n"); + break; + case BT_FALSE: + printf(" false\n"); + break; + case BT_SYM: + printf(" CONFIG_%s\n", sl->array[bl->id - 1].name); + break; + case BT_OR: + printf(" OR\n"); + doutput_boolexpr(bl->left, sl); + doutput_boolexpr(bl->right, sl); + break; + case BT_AND: + printf(" AND\n"); + doutput_boolexpr(bl->left, sl); + doutput_boolexpr(bl->right, sl); + break; + case BT_NOT: + if (bl->left->type == BT_SYM) { + printf(" NOT CONFIG_%s\n", sl->array[bl->left->id - 1].name); + } else { + printf(" NOT\n"); + doutput_boolexpr(bl->left, sl); + } + break; + } +#endif /* DEBUG */ +} diff --git a/scripts/parse_kconfig/doutput.h b/scripts/parse_kconfig/doutput.h index f82fd9b..0d1a5fb 100644 --- a/scripts/parse_kconfig/doutput.h +++ b/scripts/parse_kconfig/doutput.h @@ -7,7 +7,9 @@ #include <kconfig/lkc.h> #include <macros.h> +#include "boolexpr.h" void doutput_expr(struct expr *expr); +void doutput_boolexpr(struct boolexpr *bl, struct symlist *sl); #endif /* _DOUTPUT_H_ */ diff --git a/scripts/parse_kconfig/parse.c b/scripts/parse_kconfig/parse.c index 7de4f2b..54941dc 100644 --- a/scripts/parse_kconfig/parse.c +++ b/scripts/parse_kconfig/parse.c @@ -163,6 +163,8 @@ void cpy_dep() { pw = boolexpr_and(pw, w3); pw = boolexpr_and(pw, w4); } + Dprintf(" CNF:\n"); + doutput_boolexpr(pw, gsymlist); cnf_boolexpr(gsymlist, pw); switch (pw->type) { case BT_TRUE: |