cex: bind counterexample generation

* src/complain.h, src/complain.c: Add support for -Wcounterexample.
* src/conflicts.c (report_counterexamples): New.
(rule_conflicts_print): Use it when -Wcounterexample is given.
* src/getargs.h, src/getargs.c: Add support for --trace=cex.
* src/main.c (main): Init and deinit counterexample generation.
This commit is contained in:
Vincent Imbimbo
2020-05-12 22:01:08 -04:00
committed by Akim Demaille
parent bbb63b1ca9
commit af0441cfd2
7 changed files with 91 additions and 1 deletions

View File

@@ -33,6 +33,7 @@
#include "complain.h"
#include "conflicts.h"
#include "counterexample.h"
#include "derives.h"
#include "files.h"
#include "fixits.h"
@@ -144,6 +145,8 @@ main (int argc, char *argv[])
conflicts_update_state_numbers (old_to_new, nstates_old);
free (old_to_new);
}
if (warning_is_enabled (Wcounterexample))
counterexample_init ();
conflicts_print ();
timevar_pop (tv_conflicts);
@@ -217,6 +220,7 @@ main (int argc, char *argv[])
reduce_free ();
conflicts_free ();
grammar_free ();
counterexample_free ();
output_file_names_free ();
/* The scanner memory cannot be released right after parsing, as it