Removed two lines of code in the EFHNBest() routine that prefer a

name with a trailing exclamation point over any other name.  The
handling of global names might be properly implementable, but this
is not it, as it will favor a non-port default name or a subcircuit
name over a port.
This commit is contained in:
R. Timothy Edwards 2026-01-31 10:40:29 -05:00
parent 4b120eb417
commit feb5d61294
2 changed files with 11 additions and 5 deletions

View File

@ -1 +1 @@
8.3.598
8.3.599

View File

@ -100,9 +100,6 @@ EFHNIsGlob(hierName)
retstr = (char *)Tcl_GetVar2(magicinterp, "globals", hierName->hn_name,
TCL_GLOBAL_ONLY);
if (retstr != NULL) return TRUE;
// retstr = (char *)Tcl_GetVar(magicinterp, hierName->hn_name, TCL_GLOBAL_ONLY);
// if (retstr != NULL) return TRUE;
#endif
return hierName->hn_name[strlen(hierName->hn_name) - 1] == '!';
}
@ -520,13 +517,22 @@ EFHNBest(hierName1, hierName2)
last1 = hierName1->hn_name[strlen(hierName1->hn_name) - 1];
last2 = hierName2->hn_name[strlen(hierName2->hn_name) - 1];
if (last1 != '!' || last2 != '!')
{
#if 0
/* NOTE (Jan. 31, 2026): The handling of trailing "!" as a global
* is at best incorrect; the node output should not consider the
* ancestor hierarchy, but it does. I am disabling the check here,
* and treating all names as local. It could be reinstated, but
* I think global names are just a bad idea altogether.
*/
/* Prefer global over local names */
if (last1 == '!') return TRUE;
if (last2 == '!') return FALSE;
#endif
/* Neither name is global, so chose label over generated name */
/* Neither name is global, so choose label over generated name */
if (last1 != '#' && last2 == '#') return TRUE;
if (last1 == '#' && last2 != '#') return FALSE;
}