[lld] r231611 - Revert r231552: Resolver: optimize fallback atoms.
Rui Ueyama
ruiu at google.com
Sun Mar 8 14:31:38 PDT 2015
Author: ruiu
Date: Sun Mar 8 16:31:38 2015
New Revision: 231611
URL: http://llvm.org/viewvc/llvm-project?rev=231611&view=rev
Log:
Revert r231552: Resolver: optimize fallback atoms.
This patch broke a buildbot.
Modified:
lld/trunk/lib/Core/Resolver.cpp
Modified: lld/trunk/lib/Core/Resolver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Resolver.cpp?rev=231611&r1=231610&r2=231611&view=diff
==============================================================================
--- lld/trunk/lib/Core/Resolver.cpp (original)
+++ lld/trunk/lib/Core/Resolver.cpp Sun Mar 8 16:31:38 2015
@@ -54,7 +54,8 @@ void Resolver::forEachUndefines(File &fi
StringRef undefName = _undefines[i];
if (undefName.empty())
continue;
- if (_symbolTable.isDefined(undefName)) {
+ const Atom *atom = _symbolTable.findByName(undefName);
+ if (!isa<UndefinedAtom>(atom) || _symbolTable.isCoalescedAway(atom)) {
// The symbol was resolved by some other file. Cache the result.
_undefines[i] = "";
continue;
@@ -118,18 +119,18 @@ bool Resolver::doUndefinedAtom(const Und
// tell symbol table
bool newUndefAdded = _symbolTable.add(atom);
+ if (newUndefAdded)
+ _undefines.push_back(atom.name());
// If the undefined symbol has an alternative name, try to resolve the
// symbol with the name to give it a second chance. This feature is used
// for COFF "weak external" symbol.
if (newUndefAdded || !_symbolTable.isDefined(atom.name())) {
if (const UndefinedAtom *fallbackAtom = atom.fallback()) {
+ doUndefinedAtom(*fallbackAtom);
_symbolTable.addReplacement(&atom, fallbackAtom);
- return doUndefinedAtom(*fallbackAtom);
}
}
- if (newUndefAdded)
- _undefines.push_back(atom.name());
return newUndefAdded;
}
More information about the llvm-commits
mailing list