OSDN Git Service

[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)
commit73ba9bfc2ec2bc109b171a54e94dc032626de2b5
tree50dd1caab787882b405eb86214410b64e6d29b92
parent4a5938727aa605903dc1daffb661e5cd0deb9bc5
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261594 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/CGSCCPassManager.h
include/llvm/IR/PassManager.h
lib/Analysis/CGSCCPassManager.cpp
lib/IR/PassManager.cpp