Make DETECTARRAY so can turn off for lint

This commit is contained in:
Wilson Snyder 2011-11-30 16:20:43 -05:00
parent da13ba6c67
commit fce158b8ad
3 changed files with 9 additions and 8 deletions

View File

@ -73,7 +73,7 @@ private:
AstVar* varp = vscp->varp(); AstVar* varp = vscp->varp();
vscp->v3warn(IMPERFECTSCH,"Imperfect scheduling of variable: "<<vscp); vscp->v3warn(IMPERFECTSCH,"Imperfect scheduling of variable: "<<vscp);
if (!varp->dtypeSkipRefp()->castBasicDType()) { if (!varp->dtypeSkipRefp()->castBasicDType()) {
vscp->v3error("Unsupported: Can't detect changes on arrayed variable (probably with UNOPTFLAT warning suppressed): "<<varp->prettyName()); vscp->v3warn(E_DETECTARRAY, "Unsupported: Can't detect changes on arrayed variable (probably with UNOPTFLAT warning suppressed): "<<varp->prettyName());
} else { } else {
string newvarname = "__Vchglast__"+vscp->scopep()->nameDotless()+"__"+varp->shortName(); string newvarname = "__Vchglast__"+vscp->scopep()->nameDotless()+"__"+varp->shortName();
// Create: VARREF(_last) // Create: VARREF(_last)

View File

@ -55,7 +55,7 @@ v3errorIniter v3errorInit;
V3ErrorCode::V3ErrorCode(const char* msgp) { V3ErrorCode::V3ErrorCode(const char* msgp) {
// Return error encoding for given string, or ERROR, which is a bad code // Return error encoding for given string, or ERROR, which is a bad code
for (int codei=V3ErrorCode::EC_FIRST_WARN; codei<V3ErrorCode::_ENUM_MAX; codei++) { for (int codei=V3ErrorCode::EC_MIN; codei<V3ErrorCode::_ENUM_MAX; codei++) {
V3ErrorCode code = (V3ErrorCode)codei; V3ErrorCode code = (V3ErrorCode)codei;
if (0==strcasecmp(msgp,code.ascii())) { if (0==strcasecmp(msgp,code.ascii())) {
m_e = code; return; m_e = code; return;
@ -202,7 +202,7 @@ ostream& operator<<(ostream& os, FileLine* fileline) {
bool FileLine::warnOff(const string& msg, bool flag) { bool FileLine::warnOff(const string& msg, bool flag) {
V3ErrorCode code (msg.c_str()); V3ErrorCode code (msg.c_str());
if (code < V3ErrorCode::EC_FIRST_WARN) { if (code < V3ErrorCode::EC_MIN) {
return false; return false;
} else { } else {
warnOff(code, flag); warnOff(code, flag);
@ -211,14 +211,14 @@ bool FileLine::warnOff(const string& msg, bool flag) {
} }
void FileLine::warnLintOff(bool flag) { void FileLine::warnLintOff(bool flag) {
for (int codei=V3ErrorCode::EC_FIRST_WARN; codei<V3ErrorCode::_ENUM_MAX; codei++) { for (int codei=V3ErrorCode::EC_MIN; codei<V3ErrorCode::_ENUM_MAX; codei++) {
V3ErrorCode code = (V3ErrorCode)codei; V3ErrorCode code = (V3ErrorCode)codei;
if (code.lintError()) warnOff(code, flag); if (code.lintError()) warnOff(code, flag);
} }
} }
void FileLine::warnStyleOff(bool flag) { void FileLine::warnStyleOff(bool flag) {
for (int codei=V3ErrorCode::EC_FIRST_WARN; codei<V3ErrorCode::_ENUM_MAX; codei++) { for (int codei=V3ErrorCode::EC_MIN; codei<V3ErrorCode::_ENUM_MAX; codei++) {
V3ErrorCode code = (V3ErrorCode)codei; V3ErrorCode code = (V3ErrorCode)codei;
if (code.styleError()) warnOff(code, flag); if (code.styleError()) warnOff(code, flag);
} }
@ -234,7 +234,7 @@ bool FileLine::warnIsOff(V3ErrorCode code) const {
void FileLine::modifyStateInherit(const FileLine* fromp) { void FileLine::modifyStateInherit(const FileLine* fromp) {
// Any warnings that are off in "from", become off in "this". // Any warnings that are off in "from", become off in "this".
for (int codei=V3ErrorCode::EC_FIRST_WARN; codei<V3ErrorCode::_ENUM_MAX; codei++) { for (int codei=V3ErrorCode::EC_MIN; codei<V3ErrorCode::_ENUM_MAX; codei++) {
V3ErrorCode code = (V3ErrorCode)codei; V3ErrorCode code = (V3ErrorCode)codei;
if (fromp->warnIsOff(code)) { if (fromp->warnIsOff(code)) {
this->warnOff(code, true); this->warnOff(code, true);
@ -396,7 +396,7 @@ string V3Error::v3sform (const char* format, ...) {
} }
void V3Error::suppressThisWarning() { void V3Error::suppressThisWarning() {
if (s_errorCode>=V3ErrorCode::EC_FIRST_WARN) { if (s_errorCode>=V3ErrorCode::EC_MIN) {
V3Stats::addStatSum(string("Warnings, Suppressed ")+s_errorCode.ascii(), 1); V3Stats::addStatSum(string("Warnings, Suppressed ")+s_errorCode.ascii(), 1);
s_errorSuppressed = true; s_errorSuppressed = true;
} }

View File

@ -49,6 +49,7 @@ public:
I_DEF_NETTYPE_WIRE, // `default_nettype is WIRE (false=NONE) I_DEF_NETTYPE_WIRE, // `default_nettype is WIRE (false=NONE)
// Error codes: // Error codes:
E_BLKLOOPINIT, // Error: Delayed assignment to array inside for loops E_BLKLOOPINIT, // Error: Delayed assignment to array inside for loops
E_DETECTARRAY, // Error: Unsupported: Can't detect changes on arrayed variable
E_MULTITOP, // Error: Multiple top level modules E_MULTITOP, // Error: Multiple top level modules
E_TASKNSVAR, // Error: Task I/O not simple E_TASKNSVAR, // Error: Task I/O not simple
// //
@ -106,7 +107,7 @@ public:
// Boolean // Boolean
" I_COVERAGE", " I_TRACING", " I_LINT", " I_DEF_NETTYPE_WIRE", " I_COVERAGE", " I_TRACING", " I_LINT", " I_DEF_NETTYPE_WIRE",
// Errors // Errors
"BLKLOOPINIT", "MULTITOP", "TASKNSVAR", "BLKLOOPINIT", "DETECTARRAY", "MULTITOP", "TASKNSVAR",
// Warnings // Warnings
" EC_FIRST_WARN", " EC_FIRST_WARN",
"ASSIGNDLY", "ASSIGNIN", "ASSIGNDLY", "ASSIGNIN",