aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/driver.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-05-04 15:27:28 +0200
committerClifford Wolf <clifford@clifford.at>2018-05-04 15:27:28 +0200
commit5c03aeac60b8f8e88367d3bbf3b13b84a54ef11b (patch)
treed56b5370ec336ba4edd4171ae1f02cc367594fd3 /kernel/driver.cc
parent47eb150eec1530384c586971bcf8ec270e1d6acc (diff)
downloadyosys-5c03aeac60b8f8e88367d3bbf3b13b84a54ef11b.tar.gz
yosys-5c03aeac60b8f8e88367d3bbf3b13b84a54ef11b.tar.bz2
yosys-5c03aeac60b8f8e88367d3bbf3b13b84a54ef11b.zip
Add "yosys -e regex" for turning warnings into errors
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'kernel/driver.cc')
-rw-r--r--kernel/driver.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 3c16e5fd4..7a1dce497 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -255,9 +255,13 @@ int main(int argc, char **argv)
printf(" print a warning for all log messages matching the regex.\n");
printf("\n");
printf(" -w regex\n");
- printf(" if a warning message matches the regex, it is printes as regular\n");
+ printf(" if a warning message matches the regex, it is printed as regular\n");
printf(" message instead.\n");
printf("\n");
+ printf(" -e regex\n");
+ printf(" if a warning message matches the regex, it is printed as error\n");
+ printf(" message instead and the tool terminates with a nonzero return code.\n");
+ printf("\n");
printf(" -E <depsfile>\n");
printf(" write a Makefile dependencies file with in- and output file names\n");
printf("\n");
@@ -281,7 +285,7 @@ int main(int argc, char **argv)
}
int opt;
- while ((opt = getopt(argc, argv, "MXAQTVSm:f:Hh:b:o:p:l:L:qv:tds:c:W:w:D:E:")) != -1)
+ while ((opt = getopt(argc, argv, "MXAQTVSm:f:Hh:b:o:p:l:L:qv:tds:c:W:w:e:D:E:")) != -1)
{
switch (opt)
{
@@ -375,6 +379,12 @@ int main(int argc, char **argv)
std::regex_constants::optimize |
std::regex_constants::egrep));
break;
+ case 'e':
+ log_werror_regexes.push_back(std::regex(optarg,
+ std::regex_constants::nosubs |
+ std::regex_constants::optimize |
+ std::regex_constants::egrep));
+ break;
case 'D':
{
auto args = split_tokens(optarg, ":");