Skip to content

Commit

Permalink
[PM] Rename TestAnalysisPass to TestFunctionAnalysis to clear the way
Browse files Browse the repository at this point in the history
for a TestModuleAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195537 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chandlerc committed Nov 23, 2013
1 parent a3507d4 commit 2ea1151
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions unittests/IR/PassManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ using namespace llvm;

namespace {

class TestAnalysisPass {
class TestFunctionAnalysis {
public:
struct Result {
Result(int Count) : InstructionCount(Count) {}
Expand All @@ -29,7 +29,7 @@ class TestAnalysisPass {
/// \brief Returns an opaque, unique ID for this pass type.
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.
Result run(Function *F, FunctionAnalysisManager *AM) {
Expand All @@ -49,7 +49,7 @@ class TestAnalysisPass {
int &Runs;
};

char TestAnalysisPass::PassID;
char TestFunctionAnalysis::PassID;

struct TestModulePass {
TestModulePass(int &RunCount) : RunCount(RunCount) {}
Expand Down Expand Up @@ -94,12 +94,12 @@ struct TestFunctionPass {

if (OnlyUseCachedResults) {
// Hack to force the use of the cached interface.
if (const TestAnalysisPass::Result *AR =
AM->getCachedResult<TestAnalysisPass>(F))
if (const TestFunctionAnalysis::Result *AR =
AM->getCachedResult<TestFunctionAnalysis>(F))
AnalyzedInstrCount += AR->InstructionCount;
} else {
// 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;
}

Expand Down Expand Up @@ -153,7 +153,7 @@ class PassManagerTest : public ::testing::Test {
TEST_F(PassManagerTest, Basic) {
FunctionAnalysisManager FAM;
int AnalysisRuns = 0;
FAM.registerPass(TestAnalysisPass(AnalysisRuns));
FAM.registerPass(TestFunctionAnalysis(AnalysisRuns));

ModuleAnalysisManager MAM;
MAM.registerPass(FunctionAnalysisManagerModuleProxy(FAM));
Expand Down

0 comments on commit 2ea1151

Please sign in to comment.