diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-11-22 12:11:02 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-11-22 12:11:02 +0000 |
commit | f2edc07571ae376ea97ae963b6ac0fb8e762ec2e (patch) | |
tree | 671314151099af98f983cba02f2940585316e615 /llvm/lib/IR/PassManager.cpp | |
parent | 71ec5a64ddb3a37ac3347f1f3b9e93e8bd22d1ef (diff) | |
download | llvm-f2edc07571ae376ea97ae963b6ac0fb8e762ec2e.zip llvm-f2edc07571ae376ea97ae963b6ac0fb8e762ec2e.tar.gz llvm-f2edc07571ae376ea97ae963b6ac0fb8e762ec2e.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/IR/PassManager.cpp')
-rw-r--r-- | llvm/lib/IR/PassManager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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()); } |