diff options
Diffstat (limited to 'lld/lib/Core/SymbolTable.cpp')
| -rw-r--r-- | lld/lib/Core/SymbolTable.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lld/lib/Core/SymbolTable.cpp b/lld/lib/Core/SymbolTable.cpp index 3b43c2effa8..8fee4bb41e3 100644 --- a/lld/lib/Core/SymbolTable.cpp +++ b/lld/lib/Core/SymbolTable.cpp @@ -311,6 +311,11 @@ bool SymbolTable::isDefined(StringRef sym) { return true; } +void SymbolTable::addReplacement(const Atom *replaced, + const Atom *replacement) { + _replacedAtoms[replaced] = replacement; +} + const Atom *SymbolTable::replacement(const Atom *atom) { AtomToAtom::iterator pos = _replacedAtoms.find(atom); if (pos == _replacedAtoms.end()) @@ -328,8 +333,12 @@ void SymbolTable::undefines(std::vector<const UndefinedAtom *> &undefs) { end = _nameTable.end(); it != end; ++it) { const Atom *atom = it->second; assert(atom != nullptr); - if (const auto undef = dyn_cast<const UndefinedAtom>(atom)) + if (const auto undef = dyn_cast<const UndefinedAtom>(atom)) { + AtomToAtom::iterator pos = _replacedAtoms.find(undef); + if (pos != _replacedAtoms.end()) + continue; undefs.push_back(undef); + } } } |

