Indicate 'exiting due to errors' if errors, not warnings.

This commit is contained in:
Wilson Snyder 2011-10-31 21:39:15 -04:00
parent 85a37ea53f
commit 7654add5e5
3 changed files with 12 additions and 5 deletions

View File

@ -10,6 +10,8 @@ indicates the contributor was also the author of the fix; Thanks!
**** Search for user -y paths before default current directory. [Ruben Diez]
**** Indicate 'exiting due to errors' if errors, not warnings. [Ruben Diez]
**** Fix reporting not found modules if generate-off, bug403. [Jeremy Bennett]

View File

@ -973,8 +973,8 @@ is an alias for GCC compatibility.
Verilator defaults to the current directory ("-y .") and any specified
--Mdir, though these default paths are used after any user specified
directories. This allows "-y `pwd`" to be used if absolute filenames are
desired for error messages instead of relative filenames.
directories. This allows '-y "$(pwd)"' to be used if absolute filenames
are desired for error messages instead of relative filenames.
=back

View File

@ -332,13 +332,18 @@ void V3Error::incErrors() {
void V3Error::abortIfErrors() {
if (errorCount()) {
v3fatal ("Exiting due to "<<dec<<errorOrWarnCount()<<" warning(s)\n");
abortIfWarnings();
}
}
void V3Error::abortIfWarnings() {
if (v3Global.opt.warnFatal() ? errorOrWarnCount() : errorCount()) {
v3fatal ("Exiting due to "<<dec<<errorOrWarnCount()<<" warning(s)\n");
bool exwarn = v3Global.opt.warnFatal() && warnCount();
if (errorCount() && exwarn) {
v3fatal ("Exiting due to "<<dec<<errorCount()<<" error(s), "<<warnCount()<<" warning(s)\n");
} else if (errorCount()) {
v3fatal ("Exiting due to "<<dec<<errorCount()<<" error(s)\n");
} else if (exwarn) {
v3fatal ("Exiting due to "<<dec<<warnCount()<<" warning(s)\n");
}
}