Scope: remove uses of PDict

This commit is contained in:
Tim Wojtulewicz 2019-07-26 13:04:29 -07:00 committed by Jon Siwek
parent bbf49406c1
commit a3deb0446c
7 changed files with 51 additions and 41 deletions

View file

@ -51,14 +51,16 @@ void lookup_global_symbols_regex(const string& orig_regex, vector<ID*>& matches,
}
Scope* global = global_scope();
PDict<ID>* syms = global->Vars();
auto syms = global->Vars();
ID* nextid;
IterCookie* cookie = syms->InitForIteration();
while ( (nextid = syms->NextEntry( cookie )) )
for ( const auto& sym : syms )
{
ID* nextid = sym.second;
if ( ! func_only || nextid->Type()->Tag() == TYPE_FUNC )
if ( ! regexec (&re, nextid->Name(), 0, 0, 0) )
matches.push_back(nextid);
}
}
void choose_global_symbols_regex(const string& regex, vector<ID*>& choices,