[PM] Improve the API and comments around the analysis manager proxies.
authorChandler Carruth <chandlerc@gmail.com>
Tue, 23 Feb 2016 00:05:00 +0000 (00:05 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 23 Feb 2016 00:05:00 +0000 (00:05 +0000)
commit77b6e47f74279c4d42b00002450bd42743045f3b
treea60b7e2e8b964c41905f3c05b5911bf15bf286a7
parent6e3d8e7f0685203d0e578a9a0f88e6c8324e76dd
[PM] Improve the API and comments around the analysis manager proxies.

These are really handles that ensure the analyses get cleared at
appropriate places, and as such copying doesn't really make sense.
Instead, they should look more like unique ownership objects. Make that
the case.

Relatedly, if you create a temporary of one and move out of it
its destructor shouldn't actually clear anything. I don't think there is
any code that can trigger this currently, but it seems like a more
robust implementation.

If folks want, I can add a unittest that forces this to be exercised,
but that seems somewhat pointless -- whether a temporary is ever created
in the innards of AnalysisManager is not really something we should be
adding a reliance on, but I didn't want to leave a timebomb in the code
here.

If anyone has a cleaner way to represent this, I'm all ears, but
I wanted to assure myself that this wasn't in fact responsible for
another bug I'm chasing down (it wasn't) and figured I'd commit that.

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