Add a hook to allow the datastructure to keep naturally up to date, even
authorChris Lattner <sabre@nondot.org>
Fri, 29 Mar 2002 21:23:29 +0000 (21:23 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 29 Mar 2002 21:23:29 +0000 (21:23 +0000)
though it's not entirely fleshed out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2051 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DataStructure.h
include/llvm/Analysis/DataStructure/DataStructure.h

index 1d5500d6a525324f16edd93407093f328c343bc5..ae7b3571da692b8b348362d45338b9a67ac0cc1a 100644 (file)
@@ -437,6 +437,19 @@ public:
     return *N.second;
   }
 
+  // invalidateFunction - Inform this analysis that you changed the specified
+  // function, so the graphs that depend on it are out of date.
+  //
+  void invalidateFunction(Function *F) const {
+    // FIXME: THis should invalidate all functions who have inlined the
+    // specified graph!
+    //
+    std::pair<FunctionDSGraph*, FunctionDSGraph*> &N = DSInfo[F];
+    delete N.first;
+    delete N.second;
+    N.first = N.second = 0;
+  }
+
   // print - Print out the analysis results...
   void print(std::ostream &O, Module *M) const;
 
index 1d5500d6a525324f16edd93407093f328c343bc5..ae7b3571da692b8b348362d45338b9a67ac0cc1a 100644 (file)
@@ -437,6 +437,19 @@ public:
     return *N.second;
   }
 
+  // invalidateFunction - Inform this analysis that you changed the specified
+  // function, so the graphs that depend on it are out of date.
+  //
+  void invalidateFunction(Function *F) const {
+    // FIXME: THis should invalidate all functions who have inlined the
+    // specified graph!
+    //
+    std::pair<FunctionDSGraph*, FunctionDSGraph*> &N = DSInfo[F];
+    delete N.first;
+    delete N.second;
+    N.first = N.second = 0;
+  }
+
   // print - Print out the analysis results...
   void print(std::ostream &O, Module *M) const;