[PM] Stop playing fast and loose with rebinding of references. However

convenient it is to imagine a world where this works, that is not C++ as
was pointed out in review. The standard even goes to some lengths to
preclude any attempt at this, for better or worse. Maybe better. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203775 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth
2014-03-13 09:50:31 +00:00
parent 2d9f3bf9f9
commit 04239506f1
2 changed files with 19 additions and 19 deletions
+4 -4
View File
@@ -171,14 +171,14 @@ char FunctionAnalysisManagerModuleProxy::PassID;
FunctionAnalysisManagerModuleProxy::Result
FunctionAnalysisManagerModuleProxy::run(Module *M) {
assert(FAM.empty() && "Function analyses ran prior to the module proxy!");
return Result(FAM);
assert(FAM->empty() && "Function analyses ran prior to the module proxy!");
return Result(*FAM);
}
FunctionAnalysisManagerModuleProxy::Result::~Result() {
// Clear out the analysis manager if we're being destroyed -- it means we
// didn't even see an invalidate call when we got invalidated.
FAM.clear();
FAM->clear();
}
bool FunctionAnalysisManagerModuleProxy::Result::invalidate(
@@ -188,7 +188,7 @@ bool FunctionAnalysisManagerModuleProxy::Result::invalidate(
// objects in the cache making it impossible to incrementally preserve them.
// Just clear the entire manager.
if (!PA.preserved(ID()))
FAM.clear();
FAM->clear();
// Return false to indicate that this result is still a valid proxy.
return false;