[llvm] r258846 - [llvm-nm] Roll several conditions into a single if. NFCI.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 11:57:42 PST 2016


Author: davide
Date: Tue Jan 26 13:57:42 2016
New Revision: 258846

URL: http://llvm.org/viewvc/llvm-project?rev=258846&view=rev
Log:
[llvm-nm] Roll several conditions into a single if.  NFCI.

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=258846&r1=258845&r2=258846&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Tue Jan 26 13:57:42 2016
@@ -587,14 +587,9 @@ static void sortAndPrintSymbolList(Symbo
        I != E; ++I) {
     uint32_t SymFlags = I->Sym.getFlags();
     bool Undefined = SymFlags & SymbolRef::SF_Undefined;
-    if (!Undefined && UndefinedOnly)
-      continue;
-    if (Undefined && DefinedOnly)
-      continue;
     bool Global = SymFlags & SymbolRef::SF_Global;
-    if (!Global && ExternalOnly)
-      continue;
-    if (SizeSort && !PrintAddress)
+    if ((!Undefined && UndefinedOnly) || (Undefined && DefinedOnly) ||
+        (!Global && ExternalOnly) || (SizeSort && !PrintAddress))
       continue;
     if (PrintFileName) {
       if (!ArchitectureName.empty())




More information about the llvm-commits mailing list