[SCEV] Fix GCC 4.8.0 ICE in lambda function

Rewrite some code to not use a lambda function. The non-lambda code is just
about as clean as the original, and not any longer. The lambda function causes
an internal compiler error in GCC 4.8.0, and it is not worth breaking support
for that compiler over this. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245466 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Hal Finkel 2015-08-19 17:26:07 +00:00
parent fc5268df60
commit 25faeeb8fe

View File

@ -7351,13 +7351,9 @@ static bool IsKnownPredicateViaAddRecStart(ScalarEvolution &SE,
if (LAR->getStepRecurrence(SE) != RAR->getStepRecurrence(SE))
return false;
auto CheckWrap = [Pred](const SCEVAddRecExpr *AR) -> bool {
if (ICmpInst::isSigned(Pred))
return AR->getNoWrapFlags(SCEV::FlagNSW);
return AR->getNoWrapFlags(SCEV::FlagNUW);
};
if (!CheckWrap(LAR) || !CheckWrap(RAR))
SCEV::NoWrapFlags NW = ICmpInst::isSigned(Pred) ?
SCEV::FlagNSW : SCEV::FlagNUW;
if (!LAR->getNoWrapFlags(NW) || !RAR->getNoWrapFlags(NW))
return false;
return SE.isKnownPredicate(Pred, LAR->getStart(), RAR->getStart());