llvm.org GIT mirror llvm / 6b834bb
[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. =[ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291661 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 2 years ago
1 changed file(s) with 10 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
7474 }
7575
7676 protected:
77 // FIXME: MSVC seems unable to handle a lambda argument to Invoke from within
78 // the template, so we use a boring static function.
79 static bool invalidateCallback(IRUnitT &IR, const PreservedAnalyses &PA,
80 typename AnalysisManagerT::Invalidator &Inv) {
81 auto PAC = PA.template getChecker();
82 return !PAC.preserved() &&
83 !PAC.template preservedSet>();
84 }
85
7786 /// Derived classes should call this in their constructor to set up default
7887 /// mock actions. (We can't do this in our constructor because this has to
7988 /// run after the DerivedT is constructed.)
8190 ON_CALL(static_cast(*this),
8291 run(_, _, testing::Matcher(_)...))
8392 .WillByDefault(Return(this->getResult()));
84 auto InvalidateLambda = [](IRUnitT &IR, const PreservedAnalyses &PA,
85 typename AnalysisManagerT::Invalidator &Inv) {
86 auto PAC = PA.template getChecker();
87 return !PAC.preserved() &&
88 !PAC.template preservedSet>();
89 };
9093 ON_CALL(static_cast(*this), invalidate(_, _, _))
91 .WillByDefault(Invoke(InvalidateLambda));
94 .WillByDefault(Invoke(&invalidateCallback));
9295 }
9396 };
9497