diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2016-03-11 11:05:24 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2016-03-11 11:05:24 +0000 |
commit | b47f8010a95f461f995e30dc2b77391093183605 (patch) | |
tree | 49902b63ea6fa976481a52ca24f1797e3f60ed67 /llvm/lib/Analysis/LoopInfo.cpp | |
parent | f4cc1fc7e9d7df18176fc139b30f78c24ac0cc31 (diff) | |
download | llvm-b47f8010a95f461f995e30dc2b77391093183605.zip llvm-b47f8010a95f461f995e30dc2b77391093183605.tar.gz llvm-b47f8010a95f461f995e30dc2b77391093183605.tar.bz2 |
[PM] Make the AnalysisManager parameter to run methods a reference.
This was originally a pointer to support pass managers which didn't use
AnalysisManagers. However, that doesn't realistically come up much and
the complexity of supporting it doesn't really make sense.
In fact, *many* parts of the pass manager were just assuming the pointer
was never null already. This at least makes it much more explicit and
clear.
llvm-svn: 263219
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopInfo.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 14ca91d..47a313a 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -643,7 +643,7 @@ void LoopInfo::markAsRemoved(Loop *Unloop) { char LoopAnalysis::PassID; -LoopInfo LoopAnalysis::run(Function &F, AnalysisManager<Function> *AM) { +LoopInfo LoopAnalysis::run(Function &F, AnalysisManager<Function> &AM) { // FIXME: Currently we create a LoopInfo from scratch for every function. // This may prove to be too wasteful due to deallocating and re-allocating // memory each time for the underlying map and vector datastructures. At some @@ -651,13 +651,13 @@ LoopInfo LoopAnalysis::run(Function &F, AnalysisManager<Function> *AM) { // objects. I don't want to add that kind of complexity until the scope of // the problem is better understood. LoopInfo LI; - LI.analyze(AM->getResult<DominatorTreeAnalysis>(F)); + LI.analyze(AM.getResult<DominatorTreeAnalysis>(F)); return LI; } PreservedAnalyses LoopPrinterPass::run(Function &F, - AnalysisManager<Function> *AM) { - AM->getResult<LoopAnalysis>(F).print(OS); + AnalysisManager<Function> &AM) { + AM.getResult<LoopAnalysis>(F).print(OS); return PreservedAnalyses::all(); } |