]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
parse_kconfig fix problems with generated rules to be UNSAT
authorKarel Kočí <cynerd@email.cz>
Sat, 2 May 2015 11:29:49 +0000 (13:29 +0200)
committerKarel Kočí <cynerd@email.cz>
Sat, 2 May 2015 11:29:49 +0000 (13:29 +0200)
scripts/parse_kconfig/boolexpr.c
scripts/parse_kconfig/output.c
scripts/parse_kconfig/output.h
scripts/parse_kconfig/symlist.c

index ccd7ceff6e7a3ba407164095e374fe33792372e8..4ce41542c6bd1e565393b13a2865d57d514f4955 100644 (file)
@@ -113,11 +113,17 @@ struct boolexpr *boolexpr_sym(struct symlist *sl, struct symbol *sym) {
     struct boolexpr *rtn;
     rtn = malloc(sizeof(struct boolexpr));
     rtn->overusage = 0;
-    rtn->id = symlist_id(sl, sym->name);
-    if (rtn->id != 0)
-        rtn->type = BT_SYM;
-    else
-        rtn->type = BT_FALSE;
+    if (!strcmp(sym->name, "m") || !strcmp(sym->name, "n")) {
+            rtn->type = BT_FALSE;
+    } else if (!strcmp(sym->name, "y")) {
+            rtn->type = BT_TRUE;
+    } else {
+        rtn->id = symlist_id(sl, sym->name);
+        if (rtn->id != 0)
+            rtn->type = BT_SYM;
+        else
+            rtn->type = BT_FALSE;
+    }
     return rtn;
 }
 
index 47442ce283847f6fb6cb367a5ccd045f6ef325df..81debaf1e90b32c12ba5edc69ee44226ee59b6ee 100644 (file)
@@ -30,6 +30,7 @@ void output_rules_endterm(void) {
     fprintf(frules, "\n");
 }
 
+// Functions for variable_count
 void output_write_variable_count(char *var_file, int count) {
     FILE *f;
     f = fopen(var_file, "w");
index de8f672b5ff77585330c5d0c2e05e275b10f19ec..2950f7a0c763b5819b359d24b48894efe385d6b1 100644 (file)
@@ -20,4 +20,5 @@ void output_rules_endterm(void);
 
 // Functions for variable_count
 void output_write_variable_count(char *var_file, int count);
+
 #endif /* _OUTPUT_H_ */
index 62cdd6c812818b20a488db94989beb1ee3db0602..d38dde104583f6dddb13e0f954b10e33810ee258 100644 (file)
@@ -26,7 +26,7 @@ void symlist_add(struct symlist *sl, char *name) {
 }
 
 void symlist_closesym(struct symlist *sl) {
-    sl->lastsym = (unsigned) sl->pos;
+    sl->lastsym = (unsigned) sl->pos + 1;
 }
 
 unsigned symlist_adddummy(struct symlist *sl) {