Internals: Renames for interfaces. No functional change.

This commit is contained in:
Wilson Snyder 2013-05-18 19:45:40 -04:00
parent 2c9dcc3913
commit 6a69813326
6 changed files with 25 additions and 23 deletions

View File

@ -35,8 +35,10 @@
// Special methods // Special methods
// We need these here, because the classes they point to aren't defined when we declare the class // We need these here, because the classes they point to aren't defined when we declare the class
bool AstNodeVarRef::broken() const { return ((m_varScopep && !m_varScopep->brokeExists()) bool AstNodeVarRef::broken() const {
|| (m_varp && !m_varp->brokeExists())); } return ((m_varScopep && !m_varScopep->brokeExists())
|| (m_varp && !m_varp->brokeExists()));
}
void AstNodeVarRef::cloneRelink() { void AstNodeVarRef::cloneRelink() {
if (m_varp && m_varp->clonep()) { m_varp = m_varp->clonep()->castVar(); } if (m_varp && m_varp->clonep()) { m_varp = m_varp->clonep()->castVar(); }

View File

@ -124,10 +124,10 @@ private:
AstVar* varp; AstVar* varp;
AstNodeModule* addmodp = oldvarscp->scopep()->modp(); AstNodeModule* addmodp = oldvarscp->scopep()->modp();
// We need a new AstVar, but only one for all scopes, to match the new AstVarScope // We need a new AstVar, but only one for all scopes, to match the new AstVarScope
VarMap::iterator iter = m_modVarMap.find(make_pair(addmodp,name)); VarMap::iterator it = m_modVarMap.find(make_pair(addmodp,name));
if (iter != m_modVarMap.end()) { if (it != m_modVarMap.end()) {
// Created module's AstVar earlier under some other scope // Created module's AstVar earlier under some other scope
varp = iter->second; varp = it->second;
} else { } else {
if (width==0) { if (width==0) {
varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, oldvarscp->varp()); varp = new AstVar (oldvarscp->fileline(), AstVarType::BLOCKTEMP, name, oldvarscp->varp());

View File

@ -89,8 +89,8 @@ const string FileLineSingleton::filenameLetters(int no) {
//! We associate a language with each source file, so we also set the default //! We associate a language with each source file, so we also set the default
//! for this. //! for this.
int FileLineSingleton::nameToNumber(const string& filename) { int FileLineSingleton::nameToNumber(const string& filename) {
FileNameNumMap::const_iterator iter = m_namemap.find(filename); FileNameNumMap::const_iterator it = m_namemap.find(filename);
if (VL_LIKELY(iter != m_namemap.end())) return iter->second; if (VL_LIKELY(it != m_namemap.end())) return it->second;
int num = m_names.size(); int num = m_names.size();
m_names.push_back(filename); m_names.push_back(filename);
m_languages.push_back(V3LangCode::mostRecent()); m_languages.push_back(V3LangCode::mostRecent());

View File

@ -37,9 +37,9 @@ class V3LanguageWords {
} }
public: public:
string isKeyword(const string& kwd) { string isKeyword(const string& kwd) {
map<string,string>::iterator iter = m_kwdMap.find(kwd); map<string,string>::iterator it = m_kwdMap.find(kwd);
if (iter == m_kwdMap.end()) return ""; if (it == m_kwdMap.end()) return "";
return iter->second; return it->second;
} }
public: public:

View File

@ -77,13 +77,13 @@ private:
AstUser4InUse m_inuser4; AstUser4InUse m_inuser4;
// TYPES // TYPES
typedef std::multimap<string,VSymEnt*> NameScopeMap; typedef std::multimap<string,VSymEnt*> NameScopeSymMap;
typedef set <pair<AstNodeModule*,string> > ImplicitNameSet; typedef set <pair<AstNodeModule*,string> > ImplicitNameSet;
// MEMBERS // MEMBERS
VSymGraph m_syms; // Symbol table VSymGraph m_syms; // Symbol table
VSymEnt* m_dunitEntp; // $unit entry VSymEnt* m_dunitEntp; // $unit entry
NameScopeMap m_nameScopeMap; // Hash of scope referenced by non-pretty textual name NameScopeSymMap m_nameScopeSymMap; // Map of scope referenced by non-pretty textual name
ImplicitNameSet m_implicitNameSet; // For [module][signalname] if we can implicitly create it ImplicitNameSet m_implicitNameSet; // For [module][signalname] if we can implicitly create it
bool m_forPrimary; // First link bool m_forPrimary; // First link
bool m_forPrearray; // Compress cell__[array] refs bool m_forPrearray; // Compress cell__[array] refs
@ -195,7 +195,7 @@ public:
nodep->user1p(symp); nodep->user1p(symp);
checkDuplicate(rootEntp(), nodep, nodep->origName()); checkDuplicate(rootEntp(), nodep, nodep->origName());
rootEntp()->insert(nodep->origName(),symp); rootEntp()->insert(nodep->origName(),symp);
if (forScopeCreation()) m_nameScopeMap.insert(make_pair(scopename, symp)); if (forScopeCreation()) m_nameScopeSymMap.insert(make_pair(scopename, symp));
return symp; return symp;
} }
VSymEnt* insertCell(VSymEnt* abovep, VSymEnt* modSymp, VSymEnt* insertCell(VSymEnt* abovep, VSymEnt* modSymp,
@ -214,7 +214,7 @@ public:
// Duplicates are possible, as until resolve generates might have 2 same cells under an if // Duplicates are possible, as until resolve generates might have 2 same cells under an if
modSymp->reinsert(nodep->name(), symp); modSymp->reinsert(nodep->name(), symp);
} }
if (forScopeCreation()) m_nameScopeMap.insert(make_pair(scopename, symp)); if (forScopeCreation()) m_nameScopeSymMap.insert(make_pair(scopename, symp));
return symp; return symp;
} }
VSymEnt* insertInline(VSymEnt* abovep, VSymEnt* modSymp, VSymEnt* insertInline(VSymEnt* abovep, VSymEnt* modSymp,
@ -278,17 +278,17 @@ public:
return symp; return symp;
} }
VSymEnt* getScopeSym(AstScope* nodep) { VSymEnt* getScopeSym(AstScope* nodep) {
NameScopeMap::iterator iter = m_nameScopeMap.find(nodep->name()); NameScopeSymMap::iterator it = m_nameScopeSymMap.find(nodep->name());
if (iter == m_nameScopeMap.end()) { if (it == m_nameScopeSymMap.end()) {
nodep->v3fatalSrc("Scope never assigned a symbol entry?"); nodep->v3fatalSrc("Scope never assigned a symbol entry?");
} }
return iter->second; return it->second;
} }
void implicitOkAdd(AstNodeModule* nodep, const string& varname) { void implicitOkAdd(AstNodeModule* nodep, const string& varname) {
// Mark the given variable name as being allowed to be implicitly declared // Mark the given variable name as being allowed to be implicitly declared
if (nodep) { if (nodep) {
ImplicitNameSet::iterator iter = m_implicitNameSet.find(make_pair(nodep,varname)); ImplicitNameSet::iterator it = m_implicitNameSet.find(make_pair(nodep,varname));
if (iter == m_implicitNameSet.end()) { if (it == m_implicitNameSet.end()) {
m_implicitNameSet.insert(make_pair(nodep,varname)); m_implicitNameSet.insert(make_pair(nodep,varname));
} }
} }

View File

@ -137,11 +137,11 @@ public:
VSymEnt* findIdFlat(const string& name) const { VSymEnt* findIdFlat(const string& name) const {
// Find identifier without looking upward through symbol hierarchy // Find identifier without looking upward through symbol hierarchy
// First, scan this begin/end block or module for the name // First, scan this begin/end block or module for the name
IdNameMap::const_iterator iter = m_idNameMap.find(name); IdNameMap::const_iterator it = m_idNameMap.find(name);
UINFO(9, " SymFind se"<<(void*)this<<" '"<<name UINFO(9, " SymFind se"<<(void*)this<<" '"<<name
<<"' -> "<<(iter == m_idNameMap.end() ? "NONE" <<"' -> "<<(it == m_idNameMap.end() ? "NONE"
: "se"+cvtToStr((void*)(iter->second))+" n="+cvtToStr((void*)(iter->second->nodep())))<<endl); : "se"+cvtToStr((void*)(it->second))+" n="+cvtToStr((void*)(it->second->nodep())))<<endl);
if (iter != m_idNameMap.end()) return (iter->second); if (it != m_idNameMap.end()) return (it->second);
return NULL; return NULL;
} }
VSymEnt* findIdFallback(const string& name) const { VSymEnt* findIdFallback(const string& name) const {