From f2edc07571ae376ea97ae963b6ac0fb8e762ec2e Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Fri, 22 Nov 2013 12:11:02 +0000 Subject: [PM] Teach the analysis managers to pass themselves as arguments to the run methods of the analysis passes. Also generalizes and re-uses the SFINAE for transformation passes so that users can write an analysis pass and only accept an analysis manager if that is useful to their pass. This completes the plumbing to make an analysis manager available through every pass's run method if desired so that passes no longer need to be constructed around them. llvm-svn: 195451 --- llvm/lib/IR/PassManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/IR/PassManager.cpp') diff --git a/llvm/lib/IR/PassManager.cpp b/llvm/lib/IR/PassManager.cpp index f2d0cd9..fe16adc 100644 --- a/llvm/lib/IR/PassManager.cpp +++ b/llvm/lib/IR/PassManager.cpp @@ -47,7 +47,7 @@ ModuleAnalysisManager::getResultImpl(void *PassID, Module *M) { ModuleAnalysisPasses.find(PassID); assert(PI != ModuleAnalysisPasses.end() && "Analysis passes must be registered prior to being queried!"); - RI->second = PI->second->run(M); + RI->second = PI->second->run(M, this); } return *RI->second; @@ -115,7 +115,7 @@ FunctionAnalysisManager::getResultImpl(void *PassID, Function *F) { assert(PI != FunctionAnalysisPasses.end() && "Analysis passes must be registered prior to being queried!"); FunctionAnalysisResultListT &ResultList = FunctionAnalysisResultLists[F]; - ResultList.push_back(std::make_pair(PassID, PI->second->run(F))); + ResultList.push_back(std::make_pair(PassID, PI->second->run(F, this))); RI->second = llvm::prior(ResultList.end()); } -- cgit v1.1