[lld] r205642 - useNew is set to false in all branches, so set it to false outside the if-else.
Rui Ueyama
ruiu at google.com
Fri Apr 4 11:21:53 PDT 2014
Author: ruiu
Date: Fri Apr 4 13:21:53 2014
New Revision: 205642
URL: http://llvm.org/viewvc/llvm-project?rev=205642&view=rev
Log:
useNew is set to false in all branches, so set it to false outside the if-else.
Modified:
lld/trunk/lib/Core/SymbolTable.cpp
Modified: lld/trunk/lib/Core/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/SymbolTable.cpp?rev=205642&r1=205641&r2=205642&view=diff
==============================================================================
--- lld/trunk/lib/Core/SymbolTable.cpp (original)
+++ lld/trunk/lib/Core/SymbolTable.cpp Fri Apr 4 13:21:53 2014
@@ -265,28 +265,22 @@ void SymbolTable::addByName(const Atom &
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:
More information about the llvm-commits
mailing list