From e8af3e48fd5dffc710a9148282e26e5ab6d65e1d Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 4 Apr 2014 18:21:53 +0000 Subject: [PATCH] useNew is set to false in all branches, so set it to false outside the if-else. llvm-svn: 205642 --- lld/lib/Core/SymbolTable.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/lld/lib/Core/SymbolTable.cpp b/lld/lib/Core/SymbolTable.cpp index aa35c15..cb0ff75 100644 --- a/lld/lib/Core/SymbolTable.cpp +++ b/lld/lib/Core/SymbolTable.cpp @@ -265,28 +265,22 @@ void SymbolTable::addByName(const Atom &newAtom) { bool sameNullness = (curShLib->canBeNullAtRuntime() == newShLib->canBeNullAtRuntime()); bool sameName = curShLib->loadName().equals(newShLib->loadName()); - if (!sameName) { - useNew = false; - if (_context.warnIfCoalesableAtomsHaveDifferentLoadName()) { - // FIXME: need diagonstics interface for writing warning messages - llvm::errs() << "lld warning: shared library symbol " - << curShLib->name() << " has different load path in " - << curShLib->file().path() << " and in " - << newShLib->file().path(); - } - } else if (!sameNullness) { - useNew = false; - if (_context.warnIfCoalesableAtomsHaveDifferentCanBeNull()) { - // FIXME: need diagonstics interface for writing warning messages - llvm::errs() << "lld warning: shared library symbol " - << curShLib->name() << " has different weakness in " - << curShLib->file().path() << " and in " - << newShLib->file().path(); - } - } else { - // Both shlib atoms are identical and can be coalesced. - useNew = false; + if (sameName && !sameNullness && + _context.warnIfCoalesableAtomsHaveDifferentCanBeNull()) { + // FIXME: need diagonstics interface for writing warning messages + llvm::errs() << "lld warning: shared library symbol " + << curShLib->name() << " has different weakness in " + << curShLib->file().path() << " and in " + << newShLib->file().path(); } + if (!sameName && _context.warnIfCoalesableAtomsHaveDifferentLoadName()) { + // FIXME: need diagonstics interface for writing warning messages + llvm::errs() << "lld warning: shared library symbol " + << curShLib->name() << " has different load path in " + << curShLib->file().path() << " and in " + << newShLib->file().path(); + } + useNew = false; break; } case NCR_Error: -- 2.7.4