From a090a00e45bb35ce46e9c665b7f9b84b1b070bc1 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Fri, 5 Feb 2016 21:10:48 +0000 Subject: [PATCH] [llvm-nm] Simplify code logic. NFCI. llvm-svn: 259917 --- llvm/tools/llvm-nm/llvm-nm.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 01f82cf..0c2c339 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -817,9 +817,7 @@ static char getNMTypeChar(SymbolicFile &Obj, basic_symbol_iterator I) { uint32_t Symflags = I->getFlags(); if ((Symflags & object::SymbolRef::SF_Weak) && !isa(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 &Obj, basic_symbol_iterator I) { else if (IRObjectFile *IR = dyn_cast(&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(&Obj)) Ret = getSymbolNMTypeChar(*COFF, I); -- 2.7.4