]> granicus.if.org Git - llvm/commitdiff
[PM] Pull a lambda out of an argument into a named variable to try and
authorChandler Carruth <chandlerc@gmail.com>
Wed, 11 Jan 2017 08:23:29 +0000 (08:23 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 11 Jan 2017 08:23:29 +0000 (08:23 +0000)
get a little more clarity about the nature of the issue MSVC is having
with this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291656 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Analysis/LoopPassManagerTest.cpp

index 97c279879094841c25f48323aed17c8bcafde3ac..6288dc993e4b81bcfd18bb365d4b9860a17233b0 100644 (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));
   }
 };