diff options
author | Claire Wolf <clifford@clifford.at> | 2020-01-28 17:51:50 +0100 |
---|---|---|
committer | Claire Wolf <clifford@clifford.at> | 2020-01-28 17:51:50 +0100 |
commit | 5c2508cef82d86cebff3d008962fde6a0e49d10e (patch) | |
tree | 2fd10b32730d68f6c8de19ffde1f59d21a1cee2c /kernel | |
parent | cef607c8b77803aa1236d250da4ca6841f78a4ea (diff) | |
download | yosys-5c2508cef82d86cebff3d008962fde6a0e49d10e.tar.gz yosys-5c2508cef82d86cebff3d008962fde6a0e49d10e.tar.bz2 yosys-5c2508cef82d86cebff3d008962fde6a0e49d10e.zip |
Improve logging use of experimental features
Signed-off-by: Claire Wolf <clifford@clifford.at>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/driver.cc | 6 | ||||
-rw-r--r-- | kernel/log.cc | 4 | ||||
-rw-r--r-- | kernel/log.h | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc index acbf6b55d..9040408bc 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -459,7 +459,7 @@ int main(int argc, char **argv) depsfile = optarg; break; case 'x': - log_experimentals.insert(optarg); + log_experimentals_ignored.insert(optarg); break; default: fprintf(stderr, "Run '%s -h' for help.\n", argv[0]); @@ -573,6 +573,10 @@ int main(int argc, char **argv) if (log_warnings_count) log("Warnings: %d unique messages, %d total\n", GetSize(log_warnings), log_warnings_count); + + if (!log_experimentals.empty()) + log("Warnings: %d experimental features used (not excluded with -x).\n", GetSize(log_experimentals)); + #ifdef _WIN32 log("End of script. Logfile hash: %s\n", hash.c_str()); #else diff --git a/kernel/log.cc b/kernel/log.cc index 0ecf59c33..f5d6c488e 100644 --- a/kernel/log.cc +++ b/kernel/log.cc @@ -42,7 +42,7 @@ std::vector<FILE*> log_files; std::vector<std::ostream*> log_streams; std::map<std::string, std::set<std::string>> log_hdump; std::vector<std::regex> log_warn_regexes, log_nowarn_regexes, log_werror_regexes; -std::set<std::string> log_warnings, log_experimentals; +std::set<std::string> log_warnings, log_experimentals, log_experimentals_ignored; int log_warnings_count = 0; bool log_hdump_all = false; FILE *log_errfile = NULL; @@ -384,7 +384,7 @@ void log_experimental(const char *format, ...) string s = vstringf(format, ap); va_end(ap); - if (log_experimentals.count(s) == 0) { + if (log_experimentals_ignored.count(s) == 0 && log_experimentals.count(s) == 0) { log_warning("Feature '%s' is experimental.\n", s.c_str()); log_experimentals.insert(s); } diff --git a/kernel/log.h b/kernel/log.h index be70f4d9d..9db8efaa5 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -50,7 +50,7 @@ extern std::vector<FILE*> log_files; extern std::vector<std::ostream*> log_streams; extern std::map<std::string, std::set<std::string>> log_hdump; extern std::vector<std::regex> log_warn_regexes, log_nowarn_regexes, log_werror_regexes; -extern std::set<std::string> log_warnings, log_experimentals; +extern std::set<std::string> log_warnings, log_experimentals, log_experimentals_ignored; extern int log_warnings_count; extern bool log_hdump_all; extern FILE *log_errfile; |