Generate file with waivers (#2354)

This adds the flag --generate-waivefile <filename>. This will generate
a verilator config file with the proper lint_off statemens to turn off
warnings emitted during this particular run.

This feature can be used to start with using Verilator as linter and
systematically capture all known lint warning for further
elimination. It hopefully helps people turning of -Wno-fatal or
-Wno-lint and gradually improve their code base.

Signed-off-by: Stefan Wallentowitz <[email protected]>
This commit is contained in:
Stefan Wallentowitz
2020-05-26 20:38:14 +02:00
committed by GitHub
parent 68a2ed6776
commit dc90e6c3c3
16 changed files with 233 additions and 1 deletions
+2
View File
@@ -28,6 +28,7 @@
# include "V3Config.h"
# include "V3File.h"
#endif
#include "V3Waiver.h"
// clang-format on
#include <algorithm>
@@ -366,6 +367,7 @@ void FileLine::v3errorEnd(std::ostringstream& sstr, const string& locationStr) {
} else if (!V3Error::errorContexted()) {
nsstr << warnContextPrimary();
}
if (!m_waive) { V3Waiver::addEntry(V3Error::errorCode(), filename(), sstr.str()); }
V3Error::v3errorEnd(nsstr, lstr.str());
}