1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Make SCEVCallbackVH a private nested class inside ScalarEvolution, as

it's an implementation detail.

llvm-svn: 72122
This commit is contained in:
Dan Gohman 2009-05-19 19:22:47 +00:00
parent f61ddb4c06
commit be817680b8
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) {}
//===----------------------------------------------------------------------===//