Add lint_off --contents in configuration files. (#5606)

This commit is contained in:
Wilson Snyder
2024-11-12 20:21:16 -05:00
parent a5b2cb6ddf
commit 0bf413b260
13 changed files with 226 additions and 33 deletions
+15
View File
@@ -824,6 +824,21 @@ void V3PreProcImp::openFile(FileLine*, VInFilter* filterp, const string& filenam
flsp->newContent();
for (const string& i : wholefile) flsp->contentp()->pushText(i);
// Save contents for V3Config --contents
if (filename != V3Options::getStdPackagePath()) {
bool containsVlt = false;
for (const string& i : wholefile) {
// TODO this is overly sensitive, might be in a comment
if (i.find("`verilator_config") != string::npos) {
containsVlt = true;
break;
}
}
if (!containsVlt) {
for (const string& i : wholefile) V3Config::contentsPushText(i);
}
}
// Create new stream structure
m_lexp->scanNewFile(flsp);
addLineComment(1); // Enter