Make SCEVUnknown a CallbackVH, so that it can be notified directly

of Value deletions and RAUWs, instead of relying on ScalarEvolution's
Scalars map being notified, as that's complicated at best, and
insufficient in general.

This means SCEVUnknown needs a non-trivial destructor, so introduce
a mechanism to allow ScalarEvolution to locate all the SCEVUnknowns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110086 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-08-02 23:49:30 +00:00
parent 8eab2c2f54
commit ab37f50838
6 changed files with 167 additions and 56 deletions

View File

@@ -661,6 +661,11 @@ namespace llvm {
private:
FoldingSet<SCEV> UniqueSCEVs;
BumpPtrAllocator SCEVAllocator;
/// FirstUnknown - The head of a linked list of all SCEVUnknown
/// values that have been allocated. This is used by releaseMemory
/// to locate them all and call their destructors.
SCEVUnknown *FirstUnknown;
};
}