mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 22:58:50 +00:00
[UnitTests] Add invalidate methods.
This commit is contained in:
parent
c5959f21b3
commit
62ee34a755
@ -27,6 +27,13 @@ public:
|
||||
struct Result {
|
||||
Result(int Count) : FunctionCount(Count) {}
|
||||
int FunctionCount;
|
||||
bool invalidate(Module &, const PreservedAnalyses &PA,
|
||||
ModuleAnalysisManager::Invalidator &) {
|
||||
// Check whether the analysis or all analyses on modules have been
|
||||
// preserved.
|
||||
auto PAC = PA.getChecker<TestModuleAnalysis>();
|
||||
return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Module>>());
|
||||
}
|
||||
};
|
||||
|
||||
TestModuleAnalysis(int &Runs) : Runs(Runs) {}
|
||||
@ -50,6 +57,14 @@ public:
|
||||
struct Result {
|
||||
Result(int Count) : FunctionCount(Count) {}
|
||||
int FunctionCount;
|
||||
bool invalidate(LazyCallGraph::SCC &, const PreservedAnalyses &PA,
|
||||
CGSCCAnalysisManager::Invalidator &) {
|
||||
// Check whether the analysis or all analyses on SCCs have been
|
||||
// preserved.
|
||||
auto PAC = PA.getChecker<TestSCCAnalysis>();
|
||||
return !(PAC.preserved() ||
|
||||
PAC.preservedSet<AllAnalysesOn<LazyCallGraph::SCC>>());
|
||||
}
|
||||
};
|
||||
|
||||
TestSCCAnalysis(int &Runs) : Runs(Runs) {}
|
||||
@ -73,6 +88,13 @@ public:
|
||||
struct Result {
|
||||
Result(int Count) : InstructionCount(Count) {}
|
||||
int InstructionCount;
|
||||
bool invalidate(Function &, const PreservedAnalyses &PA,
|
||||
FunctionAnalysisManager::Invalidator &) {
|
||||
// Check whether the analysis or all analyses on functions have been
|
||||
// preserved.
|
||||
auto PAC = PA.getChecker<TestFunctionAnalysis>();
|
||||
return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>());
|
||||
}
|
||||
};
|
||||
|
||||
TestFunctionAnalysis(int &Runs) : Runs(Runs) {}
|
||||
|
@ -23,6 +23,13 @@ public:
|
||||
struct Result {
|
||||
Result(int Count) : InstructionCount(Count) {}
|
||||
int InstructionCount;
|
||||
bool invalidate(Function &, const PreservedAnalyses &PA,
|
||||
FunctionAnalysisManager::Invalidator &) {
|
||||
// Check whether the analysis or all analyses on functions have been
|
||||
// preserved.
|
||||
auto PAC = PA.getChecker<TestFunctionAnalysis>();
|
||||
return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>());
|
||||
}
|
||||
};
|
||||
|
||||
TestFunctionAnalysis(int &Runs) : Runs(Runs) {}
|
||||
@ -52,6 +59,13 @@ public:
|
||||
struct Result {
|
||||
Result(int Count) : FunctionCount(Count) {}
|
||||
int FunctionCount;
|
||||
bool invalidate(Module &, const PreservedAnalyses &PA,
|
||||
ModuleAnalysisManager::Invalidator &) {
|
||||
// Check whether the analysis or all analyses on modules have been
|
||||
// preserved.
|
||||
auto PAC = PA.getChecker<TestModuleAnalysis>();
|
||||
return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Module>>());
|
||||
}
|
||||
};
|
||||
|
||||
TestModuleAnalysis(int &Runs) : Runs(Runs) {}
|
||||
|
Loading…
Reference in New Issue
Block a user