[PM] Pull a lambda out of an argument into a named variable to try and

get a little more clarity about the nature of the issue MSVC is having
with this code.

llvm-svn: 291656
This commit is contained in:
Chandler Carruth 2017-01-11 08:23:29 +00:00
parent 80813b157e
commit babd4476b2
1 changed files with 7 additions and 6 deletions

View File

@ -82,13 +82,14 @@ protected:
ON_CALL(static_cast<DerivedT &>(*this),
run(_, _, testing::Matcher<ExtraArgTs>(_)...))
.WillByDefault(Return(this->getResult()));
auto InvalidateLambda = [](IRUnitT &IR, const PreservedAnalyses &PA,
typename AnalysisManagerT::Invalidator &Inv) {
auto PAC = PA.template getChecker<Analysis>();
return !PAC.preserved() &&
!PAC.template preservedSet<AllAnalysesOn<IRUnitT>>();
};
ON_CALL(static_cast<DerivedT &>(*this), invalidate(_, _, _))
.WillByDefault(Invoke([](IRUnitT &IR, const PreservedAnalyses &PA,
typename AnalysisManagerT::Invalidator &Inv) {
auto PAC = PA.template getChecker<Analysis>();
return !PAC.preserved() &&
!PAC.template preservedSet<AllAnalysesOn<IRUnitT>>();
}));
.WillByDefault(Invoke(InvalidateLambda));
}
};