Internals: Refactor V3Error, and handle UNDRIVEN/UNSUPPORTED/WIDTH consistently (#6874)

This commit is contained in:
Wilson Snyder
2025-12-30 07:08:25 -05:00
committed by GitHub
parent aa94219531
commit 2025b81614
12 changed files with 120 additions and 134 deletions
-27
View File
@@ -1863,12 +1863,6 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc,
FileLine::globalWarnLintOff(false);
FileLine::globalWarnStyleOff(false);
});
DECL_OPTION("-Werror-UNUSED", CbCall, []() {
V3Error::pretendError(V3ErrorCode::UNUSEDGENVAR, true);
V3Error::pretendError(V3ErrorCode::UNUSEDLOOP, true);
V3Error::pretendError(V3ErrorCode::UNUSEDPARAM, true);
V3Error::pretendError(V3ErrorCode::UNUSEDSIGNAL, true);
});
DECL_OPTION("-Werror-", CbPartialMatch, [this, fl](const char* optp) {
const V3ErrorCode code{optp};
if (code == V3ErrorCode::EC_ERROR) {
@@ -1901,8 +1895,6 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc,
FileLine::globalWarnStyleOff(true);
});
DECL_OPTION("-Wno-style", CbCall, []() { FileLine::globalWarnStyleOff(true); });
DECL_OPTION("-Wno-UNUSED", CbCall, []() { FileLine::globalWarnUnusedOff(true); });
DECL_OPTION("-Wno-WIDTH", CbCall, []() { FileLine::globalWarnOff(V3ErrorCode::WIDTH, true); });
DECL_OPTION("-work", Set, &m_work);
DECL_OPTION("-Wpedantic", CbCall, [this]() {
m_pedantic = true;
@@ -1923,25 +1915,6 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc,
});
DECL_OPTION("-Wwarn-lint", CbCall, []() { FileLine::globalWarnLintOff(false); });
DECL_OPTION("-Wwarn-style", CbCall, []() { FileLine::globalWarnStyleOff(false); });
DECL_OPTION("-Wwarn-UNUSED", CbCall, []() {
FileLine::globalWarnUnusedOff(false);
V3Error::pretendError(V3ErrorCode::UNUSEDGENVAR, false);
V3Error::pretendError(V3ErrorCode::UNUSEDLOOP, false);
V3Error::pretendError(V3ErrorCode::UNUSEDSIGNAL, false);
V3Error::pretendError(V3ErrorCode::UNUSEDPARAM, false);
});
DECL_OPTION("-Wwarn-UNSUPPORTED", CbCall, []() {
FileLine::globalWarnOff(V3ErrorCode::E_UNSUPPORTED, false);
FileLine::globalWarnOff(V3ErrorCode::COVERIGN, false);
FileLine::globalWarnOff(V3ErrorCode::SPECIFYIGN, false);
V3Error::pretendError(V3ErrorCode::E_UNSUPPORTED, false);
V3Error::pretendError(V3ErrorCode::COVERIGN, false);
V3Error::pretendError(V3ErrorCode::SPECIFYIGN, false);
});
DECL_OPTION("-Wwarn-WIDTH", CbCall, []() {
FileLine::globalWarnOff(V3ErrorCode::WIDTH, false);
V3Error::pretendError(V3ErrorCode::WIDTH, false);
});
DECL_OPTION("-waiver-multiline", OnOff, &m_waiverMultiline);
DECL_OPTION("-waiver-output", Set, &m_waiverOutput);