Ignore DECLFILENAME on library files

This commit is contained in:
Wilson Snyder
2010-12-29 19:34:33 -05:00
parent dce245da5a
commit 809e5fda8a
4 changed files with 17 additions and 4 deletions
+10 -3
View File
@@ -33,6 +33,7 @@
#include <cctype>
#include <unistd.h>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
@@ -79,6 +80,7 @@ private:
bool m_inGenerate; // Inside a generate
AstNodeModule* m_valueModp; // If set, move AstVar->valuep() initial values to this module
vector<V3SymTable*> m_delSymps; // Symbol tables to delete
set<string> m_declfnWarned; // Files we issued DECLFILENAME on
static int debug() {
static int level = -1;
@@ -228,9 +230,14 @@ private:
// Module: Create sim table for entire module and iterate
UINFO(2,"Link Module: "<<nodep<<endl);
if (m_idState == ID_FIND) {
if (nodep->fileline()->filebasenameNoExt() != nodep->prettyName()) {
nodep->v3warn(DECLFILENAME, "Filename '"<<nodep->fileline()->filebasenameNoExt()
<<"' does not match "<<nodep->typeName()<<" name: "<<nodep->prettyName());
if (nodep->fileline()->filebasenameNoExt() != nodep->prettyName()
&& !v3Global.opt.isLibraryFile(nodep->fileline()->filename())) {
// We only complain once per file, otherwise library-like files have a huge mess of warnings
if (m_declfnWarned.find(nodep->fileline()->filename()) == m_declfnWarned.end()) {
m_declfnWarned.insert(nodep->fileline()->filename());
nodep->v3warn(DECLFILENAME, "Filename '"<<nodep->fileline()->filebasenameNoExt()
<<"' does not match "<<nodep->typeName()<<" name: "<<nodep->prettyName());
}
}
}
AstCell* upperCellp = m_cellp;