[PM] Sink the reference vs. value decision for IR units out of the
authorChandler Carruth <chandlerc@gmail.com>
Mon, 12 Jan 2015 22:53:31 +0000 (22:53 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 12 Jan 2015 22:53:31 +0000 (22:53 +0000)
commit2482fe0b52c97d145605d3e614718da81b76c858
tree4c68baa5d10bb474c9428c6ae3956deca93920db
parent3f0ad4a80e470a360042a08b821e65b84f2021e0
[PM] Sink the reference vs. value decision for IR units out of the
templated interface.

So far, every single IR unit I can come up with has address-identity.
That is, when two units of IR are both active in LLVM, their addresses
will be distinct of the IR is distinct. This is clearly true for
Modules, Functions, BasicBlocks, and Instructions. It turns out that the
only practical way to make the CGSCC stuff work the way we want is to
make it true for SCCs as well. I expect this pattern to continue.

When first designing the pass manager code, I kept this dimension of
freedom in the type parameters, essentially allowing for a wrapper-type
whose address did not form identity. But that really no longer makes
sense and is making the code more complex or subtle for no gain. If we
ever have an actual use case for this, we can figure out what makes
sense then and there. It will be better because then we will have the
actual example in hand.

While the simplifications afforded in this patch are fairly small
(mostly sinking the '&' out of many type parameters onto a few
interfaces), it would have become much more pronounced with subsequent
changes. I have a sequence of changes that will completely remove the
code duplication that currently exists between all of the pass managers
and analysis managers. =] Should make things much cleaner and avoid bug
fixing N times for the N pass managers.

llvm-svn: 225723
llvm/include/llvm/Analysis/CGSCCPassManager.h
llvm/include/llvm/IR/PassManager.h
llvm/include/llvm/IR/PassManagerInternal.h
llvm/lib/IR/PassManager.cpp