[PM/AA] Hoist the value handle definition for CFLAA into the header to
[oota-llvm.git] / lib / Analysis / CFLAliasAnalysis.cpp
index 958ba95..ea624ae 100644 (file)
@@ -38,7 +38,6 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/InstVisitor.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/InstVisitor.h"
 #include "llvm/IR/Instructions.h"
-#include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Compiler.h"
@@ -74,27 +73,6 @@ struct CFLAliasAnalysis::FunctionInfo {
       : Sets(std::move(S)), ReturnedValues(std::move(RV)) {}
 };
 
       : Sets(std::move(S)), ReturnedValues(std::move(RV)) {}
 };
 
-struct CFLAliasAnalysis::FunctionHandle final : public CallbackVH {
-  FunctionHandle(Function *Fn, CFLAliasAnalysis *CFLAA)
-      : CallbackVH(Fn), CFLAA(CFLAA) {
-    assert(Fn != nullptr);
-    assert(CFLAA != nullptr);
-  }
-
-  void deleted() override { removeSelfFromCache(); }
-  void allUsesReplacedWith(Value *) override { removeSelfFromCache(); }
-
-private:
-  CFLAliasAnalysis *CFLAA;
-
-  void removeSelfFromCache() {
-    assert(CFLAA != nullptr);
-    auto *Val = getValPtr();
-    CFLAA->evict(cast<Function>(Val));
-    setValPtr(nullptr);
-  }
-};
-
 CFLAliasAnalysis::CFLAliasAnalysis() : ImmutablePass(ID) {
   initializeCFLAliasAnalysisPass(*PassRegistry::getPassRegistry());
 }
 CFLAliasAnalysis::CFLAliasAnalysis() : ImmutablePass(ID) {
   initializeCFLAliasAnalysisPass(*PassRegistry::getPassRegistry());
 }