Index: lib/MC/ELFObjectWriter.cpp =================================================================== --- lib/MC/ELFObjectWriter.cpp +++ lib/MC/ELFObjectWriter.cpp @@ -701,9 +701,7 @@ if (Asm.isThumbFunc(Sym)) return true; - if (TargetObjectWriter->needsRelocateWithSymbol(*SD, Type)) - return true; - return false; + return TargetObjectWriter->needsRelocateWithSymbol(*SD, Type); } static const MCSymbol *getWeakRef(const MCSymbolRefExpr &Ref) { @@ -884,10 +882,7 @@ if (!Symbol.isVariable() && Symbol.isUndefined() && !IsGlobal) return false; - if (Symbol.isTemporary()) - return false; - - return true; + return !Symbol.isTemporary(); } bool ELFObjectWriter::isLocal(const MCSymbol &Symbol, bool isUsedInReloc) { @@ -898,10 +893,7 @@ if (Symbol.isDefined()) return true; - if (isUsedInReloc) - return false; - - return true; + return !isUsedInReloc; } void ELFObjectWriter::computeSymbolTable( Index: lib/MC/MCAssembler.cpp =================================================================== --- lib/MC/MCAssembler.cpp +++ lib/MC/MCAssembler.cpp @@ -431,10 +431,7 @@ if (!Symbol.isInSection()) return false; - if (isLocalUsedInReloc(Symbol)) - return true; - - return false; + return isLocalUsedInReloc(Symbol); } const MCSymbol *MCAssembler::getAtom(const MCSymbol &S) const { Index: lib/MC/MCMachOStreamer.cpp =================================================================== --- lib/MC/MCMachOStreamer.cpp +++ lib/MC/MCMachOStreamer.cpp @@ -143,10 +143,7 @@ if (SegName == "__TEXT" && SecName == "__eh_frame") return true; - if (SegName == "__DATA" && SecName == "__nl_symbol_ptr") - return true; - - return false; + return SegName == "__DATA" && SecName == "__nl_symbol_ptr"; } void MCMachOStreamer::ChangeSection(MCSection *Section, Index: lib/MC/MCObjectFileInfo.cpp =================================================================== --- lib/MC/MCObjectFileInfo.cpp +++ lib/MC/MCObjectFileInfo.cpp @@ -32,11 +32,8 @@ return true; // And the iOS simulator. - if (T.isiOS() && - (T.getArch() == Triple::x86_64 || T.getArch() == Triple::x86)) - return true; - - return false; + return T.isiOS() && + (T.getArch() == Triple::x86_64 || T.getArch() == Triple::x86); } void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { Index: lib/MC/MCSectionCOFF.cpp =================================================================== --- lib/MC/MCSectionCOFF.cpp +++ lib/MC/MCSectionCOFF.cpp @@ -24,10 +24,7 @@ return false; // FIXME: Does .section .bss/.data/.text work everywhere?? - if (Name == ".text" || Name == ".data" || Name == ".bss") - return true; - - return false; + return Name == ".text" || Name == ".data" || Name == ".bss"; } void MCSectionCOFF::setSelection(int Selection) const { Index: lib/MC/MCSectionELF.cpp =================================================================== --- lib/MC/MCSectionELF.cpp +++ lib/MC/MCSectionELF.cpp @@ -28,11 +28,8 @@ return false; // FIXME: Does .section .bss/.data/.text work everywhere?? - if (Name == ".text" || Name == ".data" || - (Name == ".bss" && !MAI.usesELFSectionDirectiveForBSS())) - return true; - - return false; + return Name == ".text" || Name == ".data" || + (Name == ".bss" && !MAI.usesELFSectionDirectiveForBSS()); } static void printName(raw_ostream &OS, StringRef Name) { Index: lib/MC/MCSymbol.cpp =================================================================== --- lib/MC/MCSymbol.cpp +++ lib/MC/MCSymbol.cpp @@ -17,12 +17,10 @@ MCSection *MCSymbol::AbsolutePseudoSection = reinterpret_cast(1); static bool isAcceptableChar(char C) { - if ((C < 'a' || C > 'z') && + return !((C < 'a' || C > 'z') && (C < 'A' || C > 'Z') && (C < '0' || C > '9') && - C != '_' && C != '$' && C != '.' && C != '@') - return false; - return true; + C != '_' && C != '$' && C != '.' && C != '@'); } /// NameNeedsQuoting - Return true if the identifier \p Str needs quotes to be Index: lib/MC/MachObjectWriter.cpp =================================================================== --- lib/MC/MachObjectWriter.cpp +++ lib/MC/MachObjectWriter.cpp @@ -46,11 +46,7 @@ // References to weak definitions require external relocation entries; the // definition may not always be the one in the same object file. - if (S.getData().getFlags() & SF_WeakDefinition) - return true; - - // Otherwise, we can use an internal relocation. - return false; + return S.getData().getFlags() & SF_WeakDefinition; } bool MachObjectWriter:: @@ -696,12 +692,10 @@ bool hasReliableSymbolDifference = isX86_64(); if (!hasReliableSymbolDifference) { - if (!SA.isInSection() || &SecA != &SecB || + return !(!SA.isInSection() || &SecA != &SecB || (!SA.isTemporary() && FB.getAtom() != Asm.getSymbolData(SA).getFragment()->getAtom() && - Asm.getSubsectionsViaSymbols())) - return false; - return true; + Asm.getSubsectionsViaSymbols())); } // For Darwin x86_64, there is one special case when the reference IsPCRel. // If the fragment with the reference does not have a base symbol but meets @@ -729,11 +723,7 @@ return false; // If the atoms are the same, they are guaranteed to have the same address. - if (FA->getAtom() == FB.getAtom()) - return true; - - // Otherwise, we can't prove this is fully resolved. - return false; + return FA->getAtom() == FB.getAtom(); } void MachObjectWriter::WriteObject(MCAssembler &Asm, Index: lib/MC/WinCOFFObjectWriter.cpp =================================================================== --- lib/MC/WinCOFFObjectWriter.cpp +++ lib/MC/WinCOFFObjectWriter.cpp @@ -229,11 +229,7 @@ return true; // if its temporary, drop it - if (MC && MC->isTemporary()) - return false; - - // otherwise, keep it - return true; + return !(MC && MC->isTemporary()); } //------------------------------------------------------------------------------