forked from OSchip/llvm-project
Resolver: Reduce number of SymbolTable::isDefined function calls.
If an undefined symbol is added to the symbol table by the previous call of SymbolTable::add, SymbolTable::isDefined will always return false for the same symbol. llvm-svn: 231551
This commit is contained in:
parent
b3237de6e4
commit
abd39f0549
|
@ -125,7 +125,7 @@ bool Resolver::doUndefinedAtom(const UndefinedAtom &atom) {
|
||||||
// If the undefined symbol has an alternative name, try to resolve the
|
// 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
|
// symbol with the name to give it a second chance. This feature is used
|
||||||
// for COFF "weak external" symbol.
|
// for COFF "weak external" symbol.
|
||||||
if (!_symbolTable.isDefined(atom.name())) {
|
if (newUndefAdded || !_symbolTable.isDefined(atom.name())) {
|
||||||
if (const UndefinedAtom *fallbackAtom = atom.fallback()) {
|
if (const UndefinedAtom *fallbackAtom = atom.fallback()) {
|
||||||
doUndefinedAtom(*fallbackAtom);
|
doUndefinedAtom(*fallbackAtom);
|
||||||
_symbolTable.addReplacement(&atom, fallbackAtom);
|
_symbolTable.addReplacement(&atom, fallbackAtom);
|
||||||
|
|
Loading…
Reference in New Issue