From: Hal Finkel Date: Wed, 19 Aug 2015 17:26:07 +0000 (+0000) Subject: [SCEV] Fix GCC 4.8.0 ICE in lambda function X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=25faeeb8fe6eaaf3cc5729e375e52e8a7402a6f6;p=oota-llvm.git [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 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 363731a0b6c..37141c33009 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -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());