]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Add prompt variable to parse_kconfig
authorKarel Kočí <cynerd@email.cz>
Wed, 29 Apr 2015 08:17:05 +0000 (10:17 +0200)
committerKarel Kočí <cynerd@email.cz>
Wed, 29 Apr 2015 08:17:05 +0000 (10:17 +0200)
scripts/parse_kconfig/cnfexpr.c
scripts/parse_kconfig/cnfexpr.h
scripts/parse_kconfig/parse.c
scripts/parse_kconfig/symlist.c
scripts/parse_kconfig/symlist.h

index 9939670b27beacbb6d6f5d09bb81de9e7123b872..ea0b453c693acd4f63a2ce4ca417ce212234fc30 100644 (file)
@@ -9,7 +9,7 @@ struct cnfexpr *cnf_not(struct cnfexpr *el);
 struct cnfexpr *cnf_copy(struct cnfexpr *el);
 void free_cnf(struct cnfexpr *e);
 
-struct cnfexpr *kconfig_cnfexpr(struct symlist *sl, bool nt,
+struct cnfexpr *kconfig_cnfexpr(struct symlist *sl, bool nt, bool def,
                                 struct symbol *sym, struct expr *expr) {
     struct stck {
         struct expr *expr;
@@ -94,7 +94,7 @@ struct cnfexpr *kconfig_cnfexpr(struct symlist *sl, bool nt,
     free(stack);
 
     struct symlist_el *se = symlist_find(sl, sym->name);
-    if (se->prompt || nt == true)
+    if (se->prompt || (nt == true && def == true))
         rtrn = cnf_or(cnf_sym(sl, !nt, sym), rtrn);
     else {
         struct cnfexpr *w12 = cnf_not(cnf_copy(rtrn));
index c38625a6010bd2c58df4236d96197bd689026d11..685ad9bbdcb01aad331dca5e4416e8c6d7aef110 100644 (file)
@@ -18,7 +18,7 @@ struct cnfexpr {
     unsigned size;
 };
 
-struct cnfexpr *kconfig_cnfexpr(struct symlist *sl, bool nt,
+struct cnfexpr *kconfig_cnfexpr(struct symlist *sl, bool nt, bool def,
                                 struct symbol *sym, struct expr *expr);
 void cnf_printf(struct cnfexpr *);
 
index 576595c4cfcfc4f8bd26a4ac94de5eacdf495fb6..e4e9ec5be63cb6c9459ee02d0c87c3f7df8bb4cb 100644 (file)
@@ -81,6 +81,10 @@ void build_symlist() {
             gsymlist->array[gsymlist->pos - 1].prompt = true;
             break;
         }
+        for_all_defaults(sym, prop) {
+            gsymlist->array[gsymlist->pos - 1].def = true;
+            break;
+        }
     }
 }
 
@@ -97,7 +101,7 @@ void cpy_dep() {
                 if (verbose_level > 3)
                     printf_original(gsymlist, sym->dir_dep.expr);
                 el->be =
-                    kconfig_cnfexpr(gsymlist, false, sym,
+                    kconfig_cnfexpr(gsymlist, false, el->def, sym,
                                     sym->dir_dep.expr);
                 Iprintf("Direct:\n");
                 if (verbose_level > 2)
@@ -108,7 +112,7 @@ void cpy_dep() {
                 if (verbose_level > 3)
                     printf_original(gsymlist, sym->rev_dep.expr);
                 el->re_be =
-                    kconfig_cnfexpr(gsymlist, true, sym,
+                    kconfig_cnfexpr(gsymlist, true, el->def, sym,
                                     sym->rev_dep.expr);
                 Iprintf("Revers:\n");
                 if (verbose_level > 2)
index c6e51405399b6472416ff057e41ef286a581a54e..b0b90eab90050b14f3a6229e345a1b2b8df13c99 100644 (file)
@@ -19,6 +19,7 @@ void symlist_add(struct symlist *sl, char *name) {
     sl->array[sl->pos].name = name;
     sl->array[sl->pos].be = NULL;
     sl->array[sl->pos].prompt = false;
+    sl->array[sl->pos].def = true;
     sl->pos++;
 }
 
index 99d9bfb12ef4363d4315a8d1b9b1155f608b4109..6f1f32fe957274b46e19e326d669dfd6d0fddbc7 100644 (file)
@@ -8,7 +8,7 @@
 struct symlist_el {
     unsigned int id;
     char *name;
-    bool prompt;
+    bool prompt, def;
     struct cnfexpr *be;
     struct cnfexpr *re_be; // forward dependency
 };