mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
[PM] Rename TestAnalysisPass to TestFunctionAnalysis to clear the way
for a TestModuleAnalysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a3507d4883
commit
2ea1151162
@ -19,7 +19,7 @@ using namespace llvm;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class TestAnalysisPass {
|
class TestFunctionAnalysis {
|
||||||
public:
|
public:
|
||||||
struct Result {
|
struct Result {
|
||||||
Result(int Count) : InstructionCount(Count) {}
|
Result(int Count) : InstructionCount(Count) {}
|
||||||
@ -29,7 +29,7 @@ public:
|
|||||||
/// \brief Returns an opaque, unique ID for this pass type.
|
/// \brief Returns an opaque, unique ID for this pass type.
|
||||||
static void *ID() { return (void *)&PassID; }
|
static void *ID() { return (void *)&PassID; }
|
||||||
|
|
||||||
TestAnalysisPass(int &Runs) : Runs(Runs) {}
|
TestFunctionAnalysis(int &Runs) : Runs(Runs) {}
|
||||||
|
|
||||||
/// \brief Run the analysis pass over the function and return a result.
|
/// \brief Run the analysis pass over the function and return a result.
|
||||||
Result run(Function *F, FunctionAnalysisManager *AM) {
|
Result run(Function *F, FunctionAnalysisManager *AM) {
|
||||||
@ -49,7 +49,7 @@ private:
|
|||||||
int &Runs;
|
int &Runs;
|
||||||
};
|
};
|
||||||
|
|
||||||
char TestAnalysisPass::PassID;
|
char TestFunctionAnalysis::PassID;
|
||||||
|
|
||||||
struct TestModulePass {
|
struct TestModulePass {
|
||||||
TestModulePass(int &RunCount) : RunCount(RunCount) {}
|
TestModulePass(int &RunCount) : RunCount(RunCount) {}
|
||||||
@ -94,12 +94,12 @@ struct TestFunctionPass {
|
|||||||
|
|
||||||
if (OnlyUseCachedResults) {
|
if (OnlyUseCachedResults) {
|
||||||
// Hack to force the use of the cached interface.
|
// Hack to force the use of the cached interface.
|
||||||
if (const TestAnalysisPass::Result *AR =
|
if (const TestFunctionAnalysis::Result *AR =
|
||||||
AM->getCachedResult<TestAnalysisPass>(F))
|
AM->getCachedResult<TestFunctionAnalysis>(F))
|
||||||
AnalyzedInstrCount += AR->InstructionCount;
|
AnalyzedInstrCount += AR->InstructionCount;
|
||||||
} else {
|
} else {
|
||||||
// Typical path just runs the analysis as needed.
|
// Typical path just runs the analysis as needed.
|
||||||
const TestAnalysisPass::Result &AR = AM->getResult<TestAnalysisPass>(F);
|
const TestFunctionAnalysis::Result &AR = AM->getResult<TestFunctionAnalysis>(F);
|
||||||
AnalyzedInstrCount += AR.InstructionCount;
|
AnalyzedInstrCount += AR.InstructionCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ public:
|
|||||||
TEST_F(PassManagerTest, Basic) {
|
TEST_F(PassManagerTest, Basic) {
|
||||||
FunctionAnalysisManager FAM;
|
FunctionAnalysisManager FAM;
|
||||||
int AnalysisRuns = 0;
|
int AnalysisRuns = 0;
|
||||||
FAM.registerPass(TestAnalysisPass(AnalysisRuns));
|
FAM.registerPass(TestFunctionAnalysis(AnalysisRuns));
|
||||||
|
|
||||||
ModuleAnalysisManager MAM;
|
ModuleAnalysisManager MAM;
|
||||||
MAM.registerPass(FunctionAnalysisManagerModuleProxy(FAM));
|
MAM.registerPass(FunctionAnalysisManagerModuleProxy(FAM));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user