From 77b655c1c9b155441e34813223f172fa5a57891b Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 5 Feb 2014 21:41:42 +0000 Subject: [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200881 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/IR/PassManagerTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'unittests') diff --git a/unittests/IR/PassManagerTest.cpp b/unittests/IR/PassManagerTest.cpp index 7b2b46a934..ee1deff8df 100644 --- a/unittests/IR/PassManagerTest.cpp +++ b/unittests/IR/PassManagerTest.cpp @@ -126,18 +126,18 @@ struct TestFunctionPass { const ModuleAnalysisManager &MAM = AM->getResult(F).getManager(); - if (const TestModuleAnalysis::Result *TMA = + if (TestModuleAnalysis::Result *TMA = MAM.getCachedResult(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(F)) AnalyzedInstrCount += AR->InstructionCount; } else { // Typical path just runs the analysis as needed. - const TestFunctionAnalysis::Result &AR = AM->getResult(F); + TestFunctionAnalysis::Result &AR = AM->getResult(F); AnalyzedInstrCount += AR.InstructionCount; } -- cgit v1.2.3