Make SCEVCallbackVH a private nested class inside ScalarEvolution, as

it's an implementation detail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72122 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2009-05-19 19:22:47 +00:00
parent 278b49af8a
commit 1959b7562e
2 changed files with 13 additions and 13 deletions

View File

@ -145,16 +145,6 @@ namespace llvm {
static bool classof(const SCEV *S);
};
/// SCEVCallbackVH - A CallbackVH to arrange for ScalarEvolution to be
/// notified whenever a Value is deleted.
class SCEVCallbackVH : public CallbackVH {
ScalarEvolution *SE;
virtual void deleted();
virtual void allUsesReplacedWith(Value *New);
public:
SCEVCallbackVH(Value *V, ScalarEvolution *SE = 0);
};
/// SCEVHandle - This class is used to maintain the SCEV object's refcounts,
/// freeing the objects when the last reference is dropped.
class SCEVHandle {
@ -212,6 +202,16 @@ namespace llvm {
/// they must ask this class for services.
///
class ScalarEvolution : public FunctionPass {
/// SCEVCallbackVH - A CallbackVH to arrange for ScalarEvolution to be
/// notified whenever a Value is deleted.
class SCEVCallbackVH : public CallbackVH {
ScalarEvolution *SE;
virtual void deleted();
virtual void allUsesReplacedWith(Value *New);
public:
SCEVCallbackVH(Value *V, ScalarEvolution *SE = 0);
};
friend class SCEVCallbackVH;
friend class SCEVExpander;

View File

@ -3674,7 +3674,7 @@ SCEVHandle SCEVAddRecExpr::getNumIterationsInRange(ConstantRange Range,
// SCEVCallbackVH Class Implementation
//===----------------------------------------------------------------------===//
void SCEVCallbackVH::deleted() {
void ScalarEvolution::SCEVCallbackVH::deleted() {
assert(SE && "SCEVCallbackVH called with a non-null ScalarEvolution!");
if (PHINode *PN = dyn_cast<PHINode>(getValPtr()))
SE->ConstantEvolutionLoopExitValue.erase(PN);
@ -3684,7 +3684,7 @@ void SCEVCallbackVH::deleted() {
// this now dangles!
}
void SCEVCallbackVH::allUsesReplacedWith(Value *) {
void ScalarEvolution::SCEVCallbackVH::allUsesReplacedWith(Value *) {
assert(SE && "SCEVCallbackVH called with a non-null ScalarEvolution!");
// Forget all the expressions associated with users of the old value,
@ -3724,7 +3724,7 @@ void SCEVCallbackVH::allUsesReplacedWith(Value *) {
// this may dangle!
}
SCEVCallbackVH::SCEVCallbackVH(Value *V, ScalarEvolution *se)
ScalarEvolution::SCEVCallbackVH::SCEVCallbackVH(Value *V, ScalarEvolution *se)
: CallbackVH(V), SE(se) {}
//===----------------------------------------------------------------------===//