diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-02-05 21:41:42 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-02-05 21:41:42 +0000 |
commit | eedf9fca28c050e9e15d990657c24e2292e01175 (patch) | |
tree | 43166834c8da381dba798f4a1a317229e99d5735 /llvm/unittests/IR/PassManagerTest.cpp | |
parent | 215893317b73ec20b83c7c590ec3f3662e2007cb (diff) | |
download | bcm5719-llvm-eedf9fca28c050e9e15d990657c24e2292e01175.tar.gz bcm5719-llvm-eedf9fca28c050e9e15d990657c24e2292e01175.zip |
[PM] Don't require analysis results to be const in the new pass manager.
I think this was just over-eagerness on my part. The analysis results
need to often be non-const because they need to (in some cases at least)
be updated by the transformation pass in order to remain correct. It
also makes lazy analyses (a common case) needlessly annoying to write in
order to make their entire state mutable.
llvm-svn: 200881
Diffstat (limited to 'llvm/unittests/IR/PassManagerTest.cpp')
-rw-r--r-- | llvm/unittests/IR/PassManagerTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/IR/PassManagerTest.cpp b/llvm/unittests/IR/PassManagerTest.cpp index 7b2b46a934e..ee1deff8df6 100644 --- a/llvm/unittests/IR/PassManagerTest.cpp +++ b/llvm/unittests/IR/PassManagerTest.cpp @@ -126,18 +126,18 @@ struct TestFunctionPass { const ModuleAnalysisManager &MAM = AM->getResult<ModuleAnalysisManagerFunctionProxy>(F).getManager(); - if (const TestModuleAnalysis::Result *TMA = + if (TestModuleAnalysis::Result *TMA = MAM.getCachedResult<TestModuleAnalysis>(F->getParent())) AnalyzedFunctionCount += TMA->FunctionCount; if (OnlyUseCachedResults) { // Hack to force the use of the cached interface. - if (const TestFunctionAnalysis::Result *AR = + if (TestFunctionAnalysis::Result *AR = AM->getCachedResult<TestFunctionAnalysis>(F)) AnalyzedInstrCount += AR->InstructionCount; } else { // Typical path just runs the analysis as needed. - const TestFunctionAnalysis::Result &AR = AM->getResult<TestFunctionAnalysis>(F); + TestFunctionAnalysis::Result &AR = AM->getResult<TestFunctionAnalysis>(F); AnalyzedInstrCount += AR.InstructionCount; } |