[PM] Provide two templates for the two directionalities of analysis
authorChandler Carruth <chandlerc@gmail.com>
Sat, 27 Feb 2016 10:38:10 +0000 (10:38 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 27 Feb 2016 10:38:10 +0000 (10:38 +0000)
commit2a54094d40349e283f8398bc453d7c976af63892
tree6762721f2cb1056c9efc135dbf56727c49269823
parent39edcd0e1d0e700b65e98e48788d8ca391c004f6
[PM] Provide two templates for the two directionalities of analysis
manager proxies and use those rather than repeating their definition
four times.

There are real differences between the two directions: outer AMs are
const and don't need to have invalidation tracked. But every proxy in
a particular direction is identical except for the analysis manager type
and the IR unit they proxy into. This makes them prime candidates for
nice templates.

I've started introducing explicit template instantiation declarations
and definitions as well because we really shouldn't be emitting all this
everywhere. I'm going to go back and add the same for the other
templates like this in a follow-up patch.

I've left the analysis manager as an opaque type rather than using two
IR units and requiring it to be an AnalysisManager template
specialization. I think its important that users retain the ability to
provide their own custom analysis management layer and provided it has
the appropriate API everything should Just Work.

llvm-svn: 262127
llvm/include/llvm/Analysis/CGSCCPassManager.h
llvm/include/llvm/Analysis/LoopPassManager.h
llvm/include/llvm/IR/PassManager.h
llvm/lib/Analysis/CGSCCPassManager.cpp
llvm/lib/Analysis/LoopPassManager.cpp
llvm/lib/IR/PassManager.cpp
llvm/test/Other/new-pass-manager.ll