[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
This commit is contained in:
Chandler Carruth
2016-03-11 11:05:24 +00:00
parent f4cc1fc7e9
commit b47f8010a9
59 changed files with 186 additions and 199 deletions

View File

@@ -1608,12 +1608,12 @@ bool BasicAAResult::constantOffsetHeuristic(
char BasicAA::PassID;
BasicAAResult BasicAA::run(Function &F, AnalysisManager<Function> *AM) {
BasicAAResult BasicAA::run(Function &F, AnalysisManager<Function> &AM) {
return BasicAAResult(F.getParent()->getDataLayout(),
AM->getResult<TargetLibraryAnalysis>(F),
AM->getResult<AssumptionAnalysis>(F),
AM->getCachedResult<DominatorTreeAnalysis>(F),
AM->getCachedResult<LoopAnalysis>(F));
AM.getResult<TargetLibraryAnalysis>(F),
AM.getResult<AssumptionAnalysis>(F),
AM.getCachedResult<DominatorTreeAnalysis>(F),
AM.getCachedResult<LoopAnalysis>(F));
}
BasicAAWrapperPass::BasicAAWrapperPass() : FunctionPass(ID) {