diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2017-01-11 09:20:24 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2017-01-11 09:20:24 +0000 |
commit | 3410eb21b65bd2634945a31376bb08174436efc2 (patch) | |
tree | 54327dcb80ce4b8c9a09ba4cfd14b09ad864e335 /llvm | |
parent | 0c2601073e5d655817146296ba3f7740cfc97ce8 (diff) | |
download | bcm5719-llvm-3410eb21b65bd2634945a31376bb08174436efc2.tar.gz bcm5719-llvm-3410eb21b65bd2634945a31376bb08174436efc2.zip |
[PM] Take more drastic measures to work around MSVC's failure on this
code. If this doesn't work and I can't find someone to help who has MSVC
installed, I'll back everything out I guess. =[
llvm-svn: 291661
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/unittests/Analysis/LoopPassManagerTest.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/unittests/Analysis/LoopPassManagerTest.cpp b/llvm/unittests/Analysis/LoopPassManagerTest.cpp index 6288dc993e4..169af03e9db 100644 --- a/llvm/unittests/Analysis/LoopPassManagerTest.cpp +++ b/llvm/unittests/Analysis/LoopPassManagerTest.cpp @@ -75,6 +75,15 @@ public: } protected: + // FIXME: MSVC seems unable to handle a lambda argument to Invoke from within + // the template, so we use a boring static function. + static bool invalidateCallback(IRUnitT &IR, const PreservedAnalyses &PA, + typename AnalysisManagerT::Invalidator &Inv) { + auto PAC = PA.template getChecker<Analysis>(); + return !PAC.preserved() && + !PAC.template preservedSet<AllAnalysesOn<IRUnitT>>(); + } + /// Derived classes should call this in their constructor to set up default /// mock actions. (We can't do this in our constructor because this has to /// run after the DerivedT is constructed.) @@ -82,14 +91,8 @@ 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(InvalidateLambda)); + .WillByDefault(Invoke(&invalidateCallback)); } }; |