When showing an error, show the instance location

This commit is contained in:
Todd Strader
2019-07-26 12:52:38 -04:00
parent 5560da2934
commit 4a14788c9b
88 changed files with 488 additions and 29 deletions
+7 -2
View File
@@ -34,6 +34,7 @@
#include <algorithm>
#include <cstdarg>
#include <iomanip>
#include VL_INCLUDE_UNORDERED_SET
//######################################################################
@@ -320,14 +321,18 @@ void FileLine::modifyStateInherit(const FileLine* fromp) {
}
}
void FileLine::v3errorEnd(std::ostringstream& str) {
void FileLine::v3errorEnd(std::ostringstream& str, const string& locationStr) {
std::ostringstream nsstr;
if (lastLineno()) nsstr<<this;
nsstr<<str.str();
nsstr<<endl;
std::ostringstream lstr;
if (!locationStr.empty()) {
lstr<<std::setw(ascii().length())<<" "<<": "<<locationStr;
}
if (warnIsOff(V3Error::errorCode())) V3Error::suppressThisWarning();
else if (!V3Error::errorContexted()) nsstr<<warnContextPrimary();
V3Error::v3errorEnd(nsstr);
V3Error::v3errorEnd(nsstr, lstr.str());
}
string FileLine::warnMore() const {