Simplify and clarify reporting of enclosing instance

Rename AstNodeModule::hierName -> someInstanceName and explain that this
is only used for user messages.

Rename AstNode::locationStr -> instanceStr and simplify implementation.
In particular, do not report an instance if we can't find a reasonable
guess.
This commit is contained in:
Geza Lore
2022-04-22 23:38:23 +01:00
parent 880a9be3b1
commit 5f0e1fae7f
10 changed files with 46 additions and 61 deletions
+3 -3
View File
@@ -340,15 +340,15 @@ void FileLine::modifyStateInherit(const FileLine* fromp) {
}
}
void FileLine::v3errorEnd(std::ostringstream& sstr, const string& locationStr) {
void FileLine::v3errorEnd(std::ostringstream& sstr, const string& extra) {
std::ostringstream nsstr;
if (lastLineno()) nsstr << this;
nsstr << sstr.str();
nsstr << endl;
std::ostringstream lstr;
if (!locationStr.empty()) {
if (!extra.empty()) {
lstr << std::setw(ascii().length()) << " "
<< ": " << locationStr;
<< ": " << extra;
}
m_waive = V3Config::waive(this, V3Error::errorCode(), sstr.str());
if (warnIsOff(V3Error::errorCode()) || m_waive) {