forked from github/verilator
Internals: Framework for renaming warnings (#4010 partial)
This commit is contained in:
parent
13c9877099
commit
621cd0f008
@ -40,6 +40,7 @@ V3ErrorCode::V3ErrorCode(const char* msgp) {
|
||||
const V3ErrorCode code{codei};
|
||||
if (0 == VL_STRCASECMP(msgp, code.ascii())) {
|
||||
m_e = code;
|
||||
if (isRenamed()) m_e = renamedTo().m_e;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -248,6 +248,12 @@ public:
|
||||
return (m_e == UNUSEDGENVAR || m_e == UNUSEDPARAM || m_e == UNUSEDSIGNAL);
|
||||
}
|
||||
|
||||
V3ErrorCode renamedTo() const {
|
||||
// Return a new error this error has been renamed to
|
||||
// e.g. if (m_e == LITENDIAN) return V3ErrorCode{RANGEASC};
|
||||
return V3ErrorCode{EC_MIN}; // Not renamed; see isRenamed()
|
||||
}
|
||||
bool isRenamed() const { return renamedTo() != V3ErrorCode{EC_MIN}; }
|
||||
bool isUnder(V3ErrorCode other) {
|
||||
// backwards compatibility inheritance-like warnings
|
||||
if (m_e == other) { return true; }
|
||||
|
Loading…
Reference in New Issue
Block a user