mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Internals: Detab and fix spacing style issues. No functional change.
When diff, recommend using "git diff --ignore-all-space" When merging, recommend using "git merge -Xignore-all-space"
This commit is contained in:
+61
-60
@@ -57,9 +57,9 @@ V3ErrorCode::V3ErrorCode(const char* msgp) {
|
||||
// Return error encoding for given string, or ERROR, which is a bad code
|
||||
for (int codei=V3ErrorCode::EC_MIN; codei<V3ErrorCode::_ENUM_MAX; codei++) {
|
||||
V3ErrorCode code = V3ErrorCode(codei);
|
||||
if (0==strcasecmp(msgp,code.ascii())) {
|
||||
m_e = code; return;
|
||||
}
|
||||
if (0==strcasecmp(msgp, code.ascii())) {
|
||||
m_e = code; return;
|
||||
}
|
||||
}
|
||||
m_e = V3ErrorCode::EC_ERROR;
|
||||
}
|
||||
@@ -69,12 +69,12 @@ V3ErrorCode::V3ErrorCode(const char* msgp) {
|
||||
|
||||
void V3Error::init() {
|
||||
for (int i=0; i<V3ErrorCode::_ENUM_MAX; i++) {
|
||||
s_describedEachWarn[i] = false;
|
||||
s_pretendError[i] = V3ErrorCode(i).pretendError();
|
||||
s_describedEachWarn[i] = false;
|
||||
s_pretendError[i] = V3ErrorCode(i).pretendError();
|
||||
}
|
||||
|
||||
if (string(V3ErrorCode(V3ErrorCode::_ENUM_MAX).ascii()) != " MAX") {
|
||||
v3fatalSrc("Enum table in V3ErrorCode::EC_ascii() is munged");
|
||||
v3fatalSrc("Enum table in V3ErrorCode::EC_ascii() is munged");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,8 @@ void V3Error::incErrors() {
|
||||
void V3Error::abortIfWarnings() {
|
||||
bool exwarn = warnFatal() && warnCount();
|
||||
if (errorCount() && exwarn) {
|
||||
v3fatal("Exiting due to "<<std::dec<<errorCount()<<" error(s), "<<warnCount()<<" warning(s)\n");
|
||||
v3fatal("Exiting due to "<<std::dec<<errorCount()<<" error(s), "
|
||||
<<warnCount()<<" warning(s)\n");
|
||||
} else if (errorCount()) {
|
||||
v3fatal("Exiting due to "<<std::dec<<errorCount()<<" error(s)\n");
|
||||
} else if (exwarn) {
|
||||
@@ -115,13 +116,13 @@ bool V3Error::isError(V3ErrorCode code, bool supp) {
|
||||
else if (code==V3ErrorCode::EC_FATALSRC) return true;
|
||||
else if (code==V3ErrorCode::EC_ERROR) return true;
|
||||
else if (code<V3ErrorCode::EC_FIRST_WARN
|
||||
|| s_pretendError[code]) return true;
|
||||
|| s_pretendError[code]) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
string V3Error::msgPrefix() {
|
||||
V3ErrorCode code=s_errorCode;
|
||||
bool supp=s_errorSuppressed;
|
||||
V3ErrorCode code = s_errorCode;
|
||||
bool supp = s_errorSuppressed;
|
||||
if (supp) return "-arning-suppressed: ";
|
||||
else if (code==V3ErrorCode::USERINFO) return "-Info: ";
|
||||
else if (code==V3ErrorCode::EC_INFO) return "-Info: ";
|
||||
@@ -138,9 +139,9 @@ string V3Error::msgPrefix() {
|
||||
void V3Error::vlAbort() {
|
||||
if (V3Error::debugDefault()) {
|
||||
std::cerr<<msgPrefix()<<"Aborting since under --debug"<<endl;
|
||||
abort();
|
||||
abort();
|
||||
} else {
|
||||
exit(10);
|
||||
exit(10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,9 +151,9 @@ void V3Error::vlAbort() {
|
||||
void V3Error::suppressThisWarning() {
|
||||
if (s_errorCode>=V3ErrorCode::EC_MIN) {
|
||||
#ifndef _V3ERROR_NO_GLOBAL_
|
||||
V3Stats::addStatSum(string("Warnings, Suppressed ")+s_errorCode.ascii(), 1);
|
||||
V3Stats::addStatSum(string("Warnings, Suppressed ")+s_errorCode.ascii(), 1);
|
||||
#endif
|
||||
s_errorSuppressed = true;
|
||||
s_errorSuppressed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,8 +167,8 @@ void V3Error::v3errorEnd(std::ostringstream& sstr) {
|
||||
#endif
|
||||
// Skip suppressed messages
|
||||
if (s_errorSuppressed
|
||||
// On debug, show only non default-off warning to prevent pages of warnings
|
||||
&& (!debug() || s_errorCode.defaultsOff())) return;
|
||||
// On debug, show only non default-off warning to prevent pages of warnings
|
||||
&& (!debug() || s_errorCode.defaultsOff())) return;
|
||||
string msg = msgPrefix()+sstr.str();
|
||||
if (msg[msg.length()-1] != '\n') msg += '\n';
|
||||
// Suppress duplicates
|
||||
@@ -176,57 +177,57 @@ void V3Error::v3errorEnd(std::ostringstream& sstr) {
|
||||
// Output
|
||||
std::cerr<<msg;
|
||||
if (!s_errorSuppressed && !(s_errorCode==V3ErrorCode::EC_INFO
|
||||
|| s_errorCode==V3ErrorCode::USERINFO)) {
|
||||
if (!s_describedEachWarn[s_errorCode]
|
||||
&& !s_pretendError[s_errorCode]) {
|
||||
s_describedEachWarn[s_errorCode] = true;
|
||||
if (s_errorCode>=V3ErrorCode::EC_FIRST_WARN && !s_describedWarnings) {
|
||||
|| s_errorCode==V3ErrorCode::USERINFO)) {
|
||||
if (!s_describedEachWarn[s_errorCode]
|
||||
&& !s_pretendError[s_errorCode]) {
|
||||
s_describedEachWarn[s_errorCode] = true;
|
||||
if (s_errorCode>=V3ErrorCode::EC_FIRST_WARN && !s_describedWarnings) {
|
||||
std::cerr<<msgPrefix()<<"Use \"/* verilator lint_off "<<s_errorCode.ascii()
|
||||
<<" */\" and lint_on around source to disable this message."<<endl;
|
||||
s_describedWarnings = true;
|
||||
}
|
||||
if (s_errorCode.dangerous()) {
|
||||
s_describedWarnings = true;
|
||||
}
|
||||
if (s_errorCode.dangerous()) {
|
||||
std::cerr<<msgPrefix()<<"*** See the manual before disabling this,"<<endl;
|
||||
std::cerr<<msgPrefix()<<"else you may end up with different sim results."<<endl;
|
||||
}
|
||||
}
|
||||
// If first warning is not the user's fault (internal/unsupported) then give the website
|
||||
// Not later warnings, as a internal may be caused by an earlier problem
|
||||
if (s_tellManual == 0) {
|
||||
if (s_errorCode.mentionManual()
|
||||
|| sstr.str().find("Unsupported") != string::npos) {
|
||||
s_tellManual = 1;
|
||||
} else {
|
||||
s_tellManual = 2;
|
||||
}
|
||||
}
|
||||
if (isError(s_errorCode, s_errorSuppressed)) incErrors();
|
||||
else incWarnings();
|
||||
if (s_errorCode==V3ErrorCode::EC_FATAL
|
||||
|| s_errorCode==V3ErrorCode::EC_FATALSRC) {
|
||||
static bool inFatal = false;
|
||||
if (!inFatal) {
|
||||
inFatal = true;
|
||||
if (s_tellManual==1) {
|
||||
}
|
||||
}
|
||||
// If first warning is not the user's fault (internal/unsupported) then give the website
|
||||
// Not later warnings, as a internal may be caused by an earlier problem
|
||||
if (s_tellManual == 0) {
|
||||
if (s_errorCode.mentionManual()
|
||||
|| sstr.str().find("Unsupported") != string::npos) {
|
||||
s_tellManual = 1;
|
||||
} else {
|
||||
s_tellManual = 2;
|
||||
}
|
||||
}
|
||||
if (isError(s_errorCode, s_errorSuppressed)) incErrors();
|
||||
else incWarnings();
|
||||
if (s_errorCode==V3ErrorCode::EC_FATAL
|
||||
|| s_errorCode==V3ErrorCode::EC_FATALSRC) {
|
||||
static bool inFatal = false;
|
||||
if (!inFatal) {
|
||||
inFatal = true;
|
||||
if (s_tellManual==1) {
|
||||
std::cerr<<msgPrefix()<<"See the manual and http://www.veripool.org/verilator for more assistance."<<endl;
|
||||
s_tellManual = 2;
|
||||
}
|
||||
s_tellManual = 2;
|
||||
}
|
||||
#ifndef _V3ERROR_NO_GLOBAL_
|
||||
if (debug()) {
|
||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree",990));
|
||||
if (s_errorExitCb) s_errorExitCb();
|
||||
V3Stats::statsFinalAll(v3Global.rootp());
|
||||
V3Stats::statsReport();
|
||||
}
|
||||
if (debug()) {
|
||||
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree", 990));
|
||||
if (s_errorExitCb) s_errorExitCb();
|
||||
V3Stats::statsFinalAll(v3Global.rootp());
|
||||
V3Stats::statsReport();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
vlAbort();
|
||||
}
|
||||
else if (isError(s_errorCode, s_errorSuppressed)) {
|
||||
// We don't dump tree on any error because a Visitor may be in middle of
|
||||
// a tree cleanup and cause a false broken problem.
|
||||
if (s_errorExitCb) s_errorExitCb();
|
||||
}
|
||||
vlAbort();
|
||||
}
|
||||
else if (isError(s_errorCode, s_errorSuppressed)) {
|
||||
// We don't dump tree on any error because a Visitor may be in middle of
|
||||
// a tree cleanup and cause a false broken problem.
|
||||
if (s_errorExitCb) s_errorExitCb();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user