[llvm] r241490 - Swap operands instead of using !.

Rafael Espindola rafael.espindola at gmail.com
Mon Jul 6 12:24:40 PDT 2015


Author: rafael
Date: Mon Jul  6 14:24:40 2015
New Revision: 241490

URL: http://llvm.org/viewvc/llvm-project?rev=241490&view=rev
Log:
Swap operands instead of using !.

This avoids returning true for A == B.

Thanks to Benjamin Kramer for noticing it.

Modified:
    llvm/trunk/tools/llvm-nm/llvm-nm.cpp

Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=241490&r1=241489&r2=241490&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Mon Jul  6 14:24:40 2015
@@ -510,7 +510,7 @@ static void sortAndPrintSymbolList(Symbo
       Cmp = compareSymbolName;
 
     if (ReverseSort)
-      Cmp = [=](const NMSymbol &A, const NMSymbol &B) { return !Cmp(A, B); };
+      Cmp = [=](const NMSymbol &A, const NMSymbol &B) { return Cmp(B, A); };
     std::sort(SymbolList.begin(), SymbolList.end(), Cmp);
   }
 





More information about the llvm-commits mailing list