forked from OSchip/llvm-project
parent
71c0202dd0
commit
1c3486a312
|
|
@ -378,11 +378,12 @@ void SymbolTable::addReplacement(const Atom *replaced,
|
|||
}
|
||||
|
||||
const Atom *SymbolTable::replacement(const Atom *atom) {
|
||||
// Find the replacement for a given atom. Atoms in _replacedAtoms
|
||||
// may be chained, so find the last one.
|
||||
for (;;) {
|
||||
AtomToAtom::iterator pos = _replacedAtoms.find(atom);
|
||||
if (pos == _replacedAtoms.end())
|
||||
return atom;
|
||||
// might be chain, recurse to end
|
||||
atom = pos->second;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue