Index: lib/AST/ASTContext.cpp =================================================================== --- lib/AST/ASTContext.cpp +++ lib/AST/ASTContext.cpp @@ -1954,9 +1954,7 @@ return true; // Unfortunately, __null has type 'int'. - if (isa(E)) return true; - - return false; + return isa(E); } /// \brief Get the implementation of ObjCInterfaceDecl,or NULL if none exists. @@ -4837,9 +4835,7 @@ const VarDecl *D) { if (const CXXRecordDecl *record = Ty->getAsCXXRecordDecl()) { const Expr *copyExpr = getBlockVarCopyInits(D); - if (!copyExpr && record->hasTrivialDestructor()) return false; - - return true; + return copyExpr || !record->hasTrivialDestructor(); } if (!Ty->isObjCRetainableType()) return false; @@ -6540,15 +6536,12 @@ // equivalent GCC vector types. const VectorType *First = FirstVec->getAs(); const VectorType *Second = SecondVec->getAs(); - if (First->getNumElements() == Second->getNumElements() && - hasSameType(First->getElementType(), Second->getElementType()) && - First->getVectorKind() != VectorType::AltiVecPixel && - First->getVectorKind() != VectorType::AltiVecBool && - Second->getVectorKind() != VectorType::AltiVecPixel && - Second->getVectorKind() != VectorType::AltiVecBool) - return true; - - return false; + return First->getNumElements() == Second->getNumElements() && + hasSameType(First->getElementType(), Second->getElementType()) && + First->getVectorKind() != VectorType::AltiVecPixel && + First->getVectorKind() != VectorType::AltiVecBool && + Second->getVectorKind() != VectorType::AltiVecPixel && + Second->getVectorKind() != VectorType::AltiVecBool; } //===----------------------------------------------------------------------===// @@ -8081,10 +8074,8 @@ // static, static inline, always_inline, and extern inline functions can // always be deferred. Normal inline functions can be deferred in C99/C++. // Implicit template instantiations can also be deferred in C++. - if (Linkage == GVA_Internal || Linkage == GVA_AvailableExternally || - Linkage == GVA_DiscardableODR) - return false; - return true; + return Linkage != GVA_Internal && Linkage != GVA_AvailableExternally && + Linkage != GVA_DiscardableODR; } const VarDecl *VD = cast(D); @@ -8105,10 +8096,7 @@ return true; // Variables that have initialization with side-effects are required. - if (VD->getInit() && VD->getInit()->HasSideEffects(*this)) - return true; - - return false; + return VD->getInit() && VD->getInit()->HasSideEffects(*this); } CallingConv ASTContext::getDefaultCallingConvention(bool IsVariadic, Index: lib/AST/ASTDiagnostic.cpp =================================================================== --- lib/AST/ASTDiagnostic.cpp +++ lib/AST/ASTDiagnostic.cpp @@ -970,11 +970,7 @@ return false; } - if (!Default->getType()->isReferenceType()) { - return true; - } - - return false; + return !Default->getType()->isReferenceType(); } /// DiffNonTypes - Handles any template parameters not handled by DiffTypes Index: lib/AST/ASTImporter.cpp =================================================================== --- lib/AST/ASTImporter.cpp +++ lib/AST/ASTImporter.cpp @@ -398,10 +398,7 @@ return false; if (Array1->getSizeModifier() != Array2->getSizeModifier()) return false; - if (Array1->getIndexTypeQualifiers() != Array2->getIndexTypeQualifiers()) - return false; - - return true; + return Array1->getIndexTypeQualifiers() == Array2->getIndexTypeQualifiers(); } /// \brief Determine structural equivalence of two types. Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -2381,9 +2381,7 @@ return false; } - if (isa(S) && cast(S)->body_empty()) - return true; - return false; + return isa(S) && cast(S)->body_empty(); } bool FunctionDecl::isDefined(const FunctionDecl *&Definition) const { Index: lib/AST/DeclBase.cpp =================================================================== --- lib/AST/DeclBase.cpp +++ lib/AST/DeclBase.cpp @@ -302,10 +302,7 @@ return true; // Check for used attribute. - if (CheckUsedAttr && hasAttr()) - return true; - - return false; + return CheckUsedAttr && hasAttr(); } void Decl::markUsed(ASTContext &C) { Index: lib/AST/DeclCXX.cpp =================================================================== --- lib/AST/DeclCXX.cpp +++ lib/AST/DeclCXX.cpp @@ -410,9 +410,7 @@ // -- has no non-trivial move assignment operators, and if (hasNonTrivialMoveAssignment()) return false; // -- has a trivial destructor. - if (!hasTrivialDestructor()) return false; - - return true; + return hasTrivialDestructor(); } void CXXRecordDecl::markedVirtualFunctionPure() { @@ -1845,10 +1843,7 @@ // Is it the same as our our class type? CanQualType ClassTy = Context.getCanonicalType(Context.getTagDeclType(getParent())); - if (ParamType.getUnqualifiedType() != ClassTy) - return false; - - return true; + return ParamType.getUnqualifiedType() == ClassTy; } const CXXConstructorDecl *CXXConstructorDecl::getInheritedConstructor() const { Index: lib/AST/Expr.cpp =================================================================== --- lib/AST/Expr.cpp +++ lib/AST/Expr.cpp @@ -2666,10 +2666,7 @@ return false; // - opaque values (all) - if (isa(E)) - return false; - - return true; + return !isa(E); } bool Expr::isImplicitCXXThis() const { @@ -3387,10 +3384,7 @@ if (const ArraySubscriptExpr *ASE = dyn_cast(E)) return ASE->getBase()->getType()->isVectorType(); - if (isa(E)) - return true; - - return false; + return isa(E); } /// isArrow - Return true if the base expression is a pointer to vector, Index: lib/AST/ExprConstant.cpp =================================================================== --- lib/AST/ExprConstant.cpp +++ lib/AST/ExprConstant.cpp @@ -204,10 +204,9 @@ assert(!Invalid); if (IsOnePastTheEnd) return true; - if (MostDerivedArraySize && - Entries[MostDerivedPathLength - 1].ArrayIndex == MostDerivedArraySize) - return true; - return false; + return MostDerivedArraySize && + Entries[MostDerivedPathLength - 1].ArrayIndex == + MostDerivedArraySize; } /// Check that this refers to a valid subobject. @@ -2218,12 +2217,9 @@ return false; // If we modified a bit-field, truncate it to the right width. - if (handler.AccessKind != AK_Read && - LastField && LastField->isBitField() && - !truncateBitfieldValue(Info, E, *O, LastField)) - return false; - - return true; + return handler.AccessKind == AK_Read || !LastField || + !LastField->isBitField() || + truncateBitfieldValue(Info, E, *O, LastField); } LastField = nullptr; Index: lib/AST/ItaniumMangle.cpp =================================================================== --- lib/AST/ItaniumMangle.cpp +++ lib/AST/ItaniumMangle.cpp @@ -1866,10 +1866,7 @@ return true; if (Ty->isOpenCLSpecificType()) return true; - if (Ty->isBuiltinType()) - return false; - - return true; + return !Ty->isBuiltinType(); } void CXXNameMangler::mangleType(QualType T) { @@ -3728,10 +3725,7 @@ if (!isCharType(TemplateArgs[0].getAsType())) return false; - if (!isCharSpecialization(TemplateArgs[1].getAsType(), "char_traits")) - return false; - - return true; + return isCharSpecialization(TemplateArgs[1].getAsType(), "char_traits"); } bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) { Index: lib/AST/Type.cpp =================================================================== --- lib/AST/Type.cpp +++ lib/AST/Type.cpp @@ -1197,10 +1197,7 @@ // If this type hasn't been deduced yet, then conservatively assume that // it'll work out to be a literal type. - if (isa(BaseTy->getCanonicalTypeInternal())) - return true; - - return false; + return isa(BaseTy->getCanonicalTypeInternal()); } bool Type::isStandardLayoutType() const { @@ -1324,11 +1321,9 @@ // Enumerated types are promotable to their compatible integer types // (C99 6.3.1.1) a.k.a. its underlying type (C++ [conv.prom]p2). if (const EnumType *ET = getAs()){ - if (this->isDependentType() || ET->getDecl()->getPromotionType().isNull() - || ET->getDecl()->isScoped()) - return false; - - return true; + return !this->isDependentType() && + !ET->getDecl()->getPromotionType().isNull() && + !ET->getDecl()->isScoped(); } return false;