Apply 'make format'
This commit is contained in:
parent
46c5764383
commit
c057847760
|
|
@ -332,11 +332,9 @@ public:
|
|||
}
|
||||
bool waive(V3ErrorCode code, const string& match) {
|
||||
for (const auto& itr : m_waivers) {
|
||||
if ( ( (itr.first == code)
|
||||
|| (itr.first == V3ErrorCode::I_LINT)
|
||||
|| (code.unusedError() && itr.first == V3ErrorCode::I_UNUSED)
|
||||
)
|
||||
&& VString::wildmatch(match, itr.second)) {
|
||||
if (((itr.first == code) || (itr.first == V3ErrorCode::I_LINT)
|
||||
|| (code.unusedError() && itr.first == V3ErrorCode::I_UNUSED))
|
||||
&& VString::wildmatch(match, itr.second)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,9 +235,7 @@ public:
|
|||
bool unusedError() const {
|
||||
return (m_e == UNUSEDGENVAR || m_e == UNUSEDPARAM || m_e == UNUSEDSIGNAL);
|
||||
}
|
||||
static bool unusedMsg(const char* msgp) {
|
||||
return 0 == VL_STRCASECMP(msgp, "UNUSED");
|
||||
}
|
||||
static bool unusedMsg(const char* msgp) { return 0 == VL_STRCASECMP(msgp, "UNUSED"); }
|
||||
};
|
||||
constexpr bool operator==(const V3ErrorCode& lhs, const V3ErrorCode& rhs) {
|
||||
return lhs.m_e == rhs.m_e;
|
||||
|
|
|
|||
|
|
@ -332,11 +332,11 @@ std::ostream& operator<<(std::ostream& os, FileLine* fileline) {
|
|||
}
|
||||
|
||||
bool FileLine::warnOff(const string& msg, bool flag) {
|
||||
const char *cmsg = msg.c_str();
|
||||
const char* cmsg = msg.c_str();
|
||||
// Backward compatibility with msg="UNUSED"
|
||||
if (V3ErrorCode::unusedMsg(cmsg)) {
|
||||
warnOff(V3ErrorCode::UNUSEDGENVAR, flag);
|
||||
warnOff(V3ErrorCode::UNUSEDPARAM , flag);
|
||||
warnOff(V3ErrorCode::UNUSEDPARAM, flag);
|
||||
warnOff(V3ErrorCode::UNUSEDSIGNAL, flag);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -375,9 +375,7 @@ bool FileLine::warnIsOff(V3ErrorCode code) const {
|
|||
if ((code.lintError() || code.styleError()) && !msgEn().test(V3ErrorCode::I_LINT)) {
|
||||
return true;
|
||||
}
|
||||
if ((code.unusedError()) && !msgEn().test(V3ErrorCode::I_UNUSED)) {
|
||||
return true;
|
||||
}
|
||||
if ((code.unusedError()) && !msgEn().test(V3ErrorCode::I_UNUSED)) { return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -152,17 +152,19 @@ public:
|
|||
// Combine bits into overall state
|
||||
AstVar* const nodep = m_varp;
|
||||
|
||||
if (nodep->isGenVar()) { // Genvar
|
||||
if (nodep->isGenVar()) { // Genvar
|
||||
if (!nodep->isIfaceRef() && !nodep->isUsedParam() && !unusedMatch(nodep)) {
|
||||
nodep->v3warn(UNUSEDGENVAR, "Genvar is not used: " << nodep->prettyNameQ());
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDGENVAR, true); // Warn only once
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDGENVAR,
|
||||
true); // Warn only once
|
||||
}
|
||||
} else if(nodep->isParam()) { // Parameter
|
||||
} else if (nodep->isParam()) { // Parameter
|
||||
if (!nodep->isIfaceRef() && !nodep->isUsedParam() && !unusedMatch(nodep)) {
|
||||
nodep->v3warn(UNUSEDPARAM, "Parameter is not used: " << nodep->prettyNameQ());
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDPARAM, true); // Warn only once
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDPARAM,
|
||||
true); // Warn only once
|
||||
}
|
||||
} else { // Signal
|
||||
} else { // Signal
|
||||
bool allU = true;
|
||||
bool allD = true;
|
||||
bool anyU = m_wholeFlags[FLAG_USED];
|
||||
|
|
@ -194,19 +196,19 @@ public:
|
|||
// UNDRIVEN is considered more serious - as is more likely a bug,
|
||||
// thus undriven+unused bits get UNUSED warnings, as they're not as buggy.
|
||||
if (!unusedMatch(nodep)) {
|
||||
nodep->v3warn(UNUSEDSIGNAL, "Signal is not driven, nor used: "
|
||||
<< nodep->prettyNameQ());
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDSIGNAL, true); // Warn only once
|
||||
nodep->v3warn(UNUSEDSIGNAL,
|
||||
"Signal is not driven, nor used: " << nodep->prettyNameQ());
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDSIGNAL,
|
||||
true); // Warn only once
|
||||
}
|
||||
} else if (allD && !anyU) {
|
||||
if (!unusedMatch(nodep)) {
|
||||
nodep->v3warn(UNUSEDSIGNAL, "Signal is not used: "
|
||||
<< nodep->prettyNameQ());
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDSIGNAL, true); // Warn only once
|
||||
nodep->v3warn(UNUSEDSIGNAL, "Signal is not used: " << nodep->prettyNameQ());
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSEDSIGNAL,
|
||||
true); // Warn only once
|
||||
}
|
||||
} else if (!anyD && allU) {
|
||||
nodep->v3warn(UNDRIVEN, "Signal is not driven: "
|
||||
<< nodep->prettyNameQ());
|
||||
nodep->v3warn(UNDRIVEN, "Signal is not driven: " << nodep->prettyNameQ());
|
||||
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNDRIVEN, true); // Warn only once
|
||||
} else {
|
||||
// Bits have different dispositions
|
||||
|
|
@ -214,17 +216,18 @@ public:
|
|||
bool setD = false;
|
||||
if (anynotDU && !unusedMatch(nodep)) {
|
||||
nodep->v3warn(UNUSEDSIGNAL, "Bits of signal are not driven, nor used: "
|
||||
<< nodep->prettyNameQ() << bitNames(BN_BOTH));
|
||||
<< nodep->prettyNameQ() << bitNames(BN_BOTH));
|
||||
setU = true;
|
||||
}
|
||||
if (anyDnotU && !unusedMatch(nodep)) {
|
||||
nodep->v3warn(UNUSEDSIGNAL, "Bits of signal are not used: "
|
||||
<< nodep->prettyNameQ() << bitNames(BN_UNUSED));
|
||||
nodep->v3warn(UNUSEDSIGNAL,
|
||||
"Bits of signal are not used: " << nodep->prettyNameQ()
|
||||
<< bitNames(BN_UNUSED));
|
||||
setU = true;
|
||||
}
|
||||
if (anyUnotD) {
|
||||
nodep->v3warn(UNDRIVEN, "Bits of signal are not driven: "
|
||||
<< nodep->prettyNameQ() << bitNames(BN_UNDRIVEN));
|
||||
<< nodep->prettyNameQ() << bitNames(BN_UNDRIVEN));
|
||||
setD = true;
|
||||
}
|
||||
if (setU) { // Warn only once
|
||||
|
|
|
|||
Loading…
Reference in New Issue