[llvm] r259917 - [llvm-nm] Simplify code logic. NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 5 13:10:48 PST 2016
Author: davide
Date: Fri Feb 5 15:10:48 2016
New Revision: 259917
URL: http://llvm.org/viewvc/llvm-project?rev=259917&view=rev
Log:
[llvm-nm] Simplify code logic. 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=259917&r1=259916&r2=259917&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Fri Feb 5 15:10:48 2016
@@ -817,9 +817,7 @@ static char getNMTypeChar(SymbolicFile &
uint32_t Symflags = I->getFlags();
if ((Symflags & object::SymbolRef::SF_Weak) && !isa<MachOObjectFile>(Obj)) {
char Ret = isObject(Obj, I) ? 'v' : 'w';
- if (!(Symflags & object::SymbolRef::SF_Undefined))
- Ret = toupper(Ret);
- return Ret;
+ return (!(Symflags & object::SymbolRef::SF_Undefined)) ? toupper(Ret) : Ret;
}
if (Symflags & object::SymbolRef::SF_Undefined)
@@ -834,10 +832,8 @@ static char getNMTypeChar(SymbolicFile &
else if (IRObjectFile *IR = dyn_cast<IRObjectFile>(&Obj)) {
Ret = getSymbolNMTypeChar(*IR, I);
Triple Host(sys::getDefaultTargetTriple());
- if (Ret == 'd' && Host.isOSDarwin()) {
- if(Symflags & SymbolRef::SF_Const)
- Ret = 's';
- }
+ if (Ret == 'd' && Host.isOSDarwin() && Symflags & SymbolRef::SF_Const)
+ Ret = 's';
}
else if (COFFObjectFile *COFF = dyn_cast<COFFObjectFile>(&Obj))
Ret = getSymbolNMTypeChar(*COFF, I);
More information about the llvm-commits
mailing list