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

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 00:23:30 PST 2017


Author: chandlerc
Date: Wed Jan 11 02:23:29 2017
New Revision: 291656

URL: http://llvm.org/viewvc/llvm-project?rev=291656&view=rev
Log:
[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.

Modified:
    llvm/trunk/unittests/Analysis/LoopPassManagerTest.cpp

Modified: llvm/trunk/unittests/Analysis/LoopPassManagerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Analysis/LoopPassManagerTest.cpp?rev=291656&r1=291655&r2=291656&view=diff
==============================================================================
--- llvm/trunk/unittests/Analysis/LoopPassManagerTest.cpp (original)
+++ llvm/trunk/unittests/Analysis/LoopPassManagerTest.cpp Wed Jan 11 02:23:29 2017
@@ -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));
   }
 };
 




More information about the llvm-commits mailing list