[llvm] r259391 - [llvm-nm] Simplify the code a bit. NFCI.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 11:22:16 PST 2016


Author: davide
Date: Mon Feb  1 13:22:16 2016
New Revision: 259391

URL: http://llvm.org/viewvc/llvm-project?rev=259391&view=rev
Log:
[llvm-nm] Simplify the code a bit. NFCI.

Fix a style violation while I'm here.

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=259391&r1=259390&r2=259391&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Mon Feb  1 13:22:16 2016
@@ -260,15 +260,11 @@ static void darwinPrintSymbol(SymbolicFi
       // use 1, 2 and 3 for section numbers.  See below where they are used to
       // print out fake section names.
       NType |= MachO::N_SECT;
-      if(SymFlags & SymbolRef::SF_Const)
+      if (SymFlags & SymbolRef::SF_Const)
         NSect = 3;
       else {
         IRObjectFile *IRobj = dyn_cast<IRObjectFile>(&Obj);
-        char c = getSymbolNMTypeChar(*IRobj, I->Sym);
-        if (c == 't')
-          NSect = 1;
-        else
-          NSect = 2;
+        NSect = (getSymbolNMTypeChar(*IRobj, I->Sym) == 't') ? 1 : 2;
       }
     }
     if (SymFlags & SymbolRef::SF_Weak)




More information about the llvm-commits mailing list