preprocessor: little fixes for removing unused exos from symbol_table
parent
f76a6cb58b
commit
0a7172cb50
|
@ -482,12 +482,7 @@ SymbolTable::rmExo(set<int> &unused) throw (FrozenException)
|
||||||
|
|
||||||
list<int> idxs;
|
list<int> idxs;
|
||||||
for (set<int>::const_iterator it = unused.begin(); it != unused.end(); it++)
|
for (set<int>::const_iterator it = unused.begin(); it != unused.end(); it++)
|
||||||
{
|
idxs.push_back(getID(getName(*it)));
|
||||||
string name = getName(*it);
|
|
||||||
idxs.push_back(symbol_table[name]);
|
|
||||||
symbol_table.erase(name);
|
|
||||||
size--;
|
|
||||||
}
|
|
||||||
|
|
||||||
idxs.sort();
|
idxs.sort();
|
||||||
idxs.reverse();
|
idxs.reverse();
|
||||||
|
@ -500,10 +495,10 @@ SymbolTable::rmExo(set<int> &unused) throw (FrozenException)
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol_table.clear();
|
symbol_table.clear();
|
||||||
int i = 0;
|
size = 0;
|
||||||
for (vector<string>::const_iterator it=name_table.begin();
|
for (vector<string>::const_iterator it=name_table.begin();
|
||||||
it != name_table.end(); it++)
|
it != name_table.end(); it++)
|
||||||
symbol_table[*it] = i++;
|
symbol_table[*it] = size++;
|
||||||
|
|
||||||
assert(size == symbol_table.size());
|
assert(size == symbol_table.size());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue