mirror of
https://github.com/verilator/verilator.git
synced 2026-09-07 01:11:01 +02:00
Add error message when modules have duplicate names.
git-svn-id: file://localhost/svn/verilator/trunk/verilator@1025 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
+5
-1
@@ -210,7 +210,11 @@ private:
|
||||
void readModNames() {
|
||||
// Look at all modules, and store pointers to all module names
|
||||
for (AstModule* nodep = v3Global.rootp()->modulesp(); nodep; nodep=nodep->nextp()->castModule()) {
|
||||
if (!m_mods.findIdName(nodep->name())) {
|
||||
AstNode* foundp = m_mods.findIdName(nodep->name());
|
||||
if (foundp && foundp != nodep) {
|
||||
nodep->v3error("Duplicate declaration of module: "<<nodep->prettyName());
|
||||
foundp->v3error("... Location of original declaration");
|
||||
} else if (!foundp) {
|
||||
m_mods.insert(nodep->name(), nodep);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user