diff options
Diffstat (limited to 'lib/Core/SymbolTable.cpp')
-rw-r--r-- | lib/Core/SymbolTable.cpp | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/lib/Core/SymbolTable.cpp b/lib/Core/SymbolTable.cpp index 44631a5d40dc..cacea5f30847 100644 --- a/lib/Core/SymbolTable.cpp +++ b/lib/Core/SymbolTable.cpp @@ -223,13 +223,9 @@ bool SymbolTable::AtomMappingInfo::isEqual(const DefinedAtom * const l, const DefinedAtom * const r) { if (l == r) return true; - if (l == getEmptyKey()) + if (l == getEmptyKey() || r == getEmptyKey()) return false; - if (r == getEmptyKey()) - return false; - if (l == getTombstoneKey()) - return false; - if (r == getTombstoneKey()) + if (l == getTombstoneKey() || r == getTombstoneKey()) return false; if (l->contentType() != r->contentType()) return false; @@ -265,17 +261,6 @@ const Atom *SymbolTable::findByName(StringRef sym) { return pos->second; } -bool SymbolTable::isDefined(StringRef sym) { - if (const Atom *atom = findByName(sym)) - return !isa<UndefinedAtom>(atom); - return false; -} - -void SymbolTable::addReplacement(const Atom *replaced, - const Atom *replacement) { - _replacedAtoms[replaced] = replacement; -} - 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. @@ -303,17 +288,4 @@ std::vector<const UndefinedAtom *> SymbolTable::undefines() { return ret; } -std::vector<StringRef> SymbolTable::tentativeDefinitions() { - std::vector<StringRef> ret; - for (auto entry : _nameTable) { - const Atom *atom = entry.second; - StringRef name = entry.first; - assert(atom != nullptr); - if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom)) - if (defAtom->merge() == DefinedAtom::mergeAsTentative) - ret.push_back(name); - } - return ret; -} - } // namespace lld |