Author: rafael Date: Sat Oct 24 18:15:31 2015 New Revision: 251214 URL: http://llvm.org/viewvc/llvm-project?rev=251214&view=rev Log: Simplify boolean conditional return statements in lib/Basic.
Patch by Richard. Modified: cfe/trunk/lib/Basic/Targets.cpp Modified: cfe/trunk/lib/Basic/Targets.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=251214&r1=251213&r2=251214&view=diff ============================================================================== --- cfe/trunk/lib/Basic/Targets.cpp (original) +++ cfe/trunk/lib/Basic/Targets.cpp Sat Oct 24 18:15:31 2015 @@ -2704,14 +2704,14 @@ bool X86TargetInfo::initFeatureMap( // Enable popcnt if sse4.2 is enabled and popcnt is not explicitly disabled. auto I = Features.find("sse4.2"); - if (I != Features.end() && I->getValue() == true && + if (I != Features.end() && I->getValue() && std::find(FeaturesVec.begin(), FeaturesVec.end(), "-popcnt") == FeaturesVec.end()) Features["popcnt"] = true; // Enable prfchw if 3DNow! is enabled and prfchw is not explicitly disabled. I = Features.find("3dnow"); - if (I != Features.end() && I->getValue() == true && + if (I != Features.end() && I->getValue() && std::find(FeaturesVec.begin(), FeaturesVec.end(), "-prfchw") == FeaturesVec.end()) Features["prfchw"] = true; @@ -2719,7 +2719,7 @@ bool X86TargetInfo::initFeatureMap( // Additionally, if SSE is enabled and mmx is not explicitly disabled, // then enable MMX. I = Features.find("sse"); - if (I != Features.end() && I->getValue() == true && + if (I != Features.end() && I->getValue() && std::find(FeaturesVec.begin(), FeaturesVec.end(), "-mmx") == FeaturesVec.end()) Features["mmx"] = true; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits