rename "ping" to "verifyRemoved". I don't know why 'ping' what chosen,
authorChris Lattner <sabre@nondot.org>
Fri, 28 Nov 2008 21:42:09 +0000 (21:42 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 28 Nov 2008 21:42:09 +0000 (21:42 +0000)
but it doesn't make any sense at all.

Also make the method const, private, and fit in 80 cols while we're at it.

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

include/llvm/Analysis/MemoryDependenceAnalysis.h
lib/Analysis/MemoryDependenceAnalysis.cpp

index 17e28fc560f881c2dbe1e5ddfc97a6a4a34e9d70..ffc675837aeb1d58b7469ec79f5c1d6af8d10933 100644 (file)
@@ -51,8 +51,6 @@ namespace llvm {
     reverseDepMapType reverseDepNonLocal;
     
   public:
-    void ping(Instruction* D);
-
     // Special marker indicating that the query has no dependency
     // in the specified block.
     static Instruction* const NonLocal;
@@ -104,6 +102,10 @@ namespace llvm {
     void dropInstruction(Instruction* drop);
     
   private:
+    /// verifyRemoved - Verify that the specified instruction does not occur
+    /// in our internal data structures.
+    void verifyRemoved(Instruction *Inst) const;
+    
     Instruction* getCallSiteDependency(CallSite C, Instruction* start,
                                        BasicBlock* block);
     void nonLocalHelper(Instruction* query, BasicBlock* block,
index f99f6afab5e02ad8aa3629daf57060aa8dc5e287..0dea0696e04578c3dd6aa16854bf250ba1aaba01 100644 (file)
@@ -48,31 +48,32 @@ Instruction* const MemoryDependenceAnalysis::Dirty = (Instruction*)-5;
 static RegisterPass<MemoryDependenceAnalysis> X("memdep",
                                                 "Memory Dependence Analysis", false, true);
 
-void MemoryDependenceAnalysis::ping(Instruction *D) {
-  for (depMapType::iterator I = depGraphLocal.begin(), E = depGraphLocal.end();
-       I != E; ++I) {
+void MemoryDependenceAnalysis::verifyRemoved(Instruction *D) const {
+  for (depMapType::const_iterator I = depGraphLocal.begin(),
+       E = depGraphLocal.end(); I != E; ++I) {
     assert(I->first != D);
     assert(I->second.first != D);
   }
 
-  for (nonLocalDepMapType::iterator I = depGraphNonLocal.begin(), E = depGraphNonLocal.end();
-       I != E; ++I) {
+  for (nonLocalDepMapType::const_iterator I = depGraphNonLocal.begin(),
+       E = depGraphNonLocal.end(); I != E; ++I) {
     assert(I->first != D);
     for (DenseMap<BasicBlock*, Value*>::iterator II = I->second.begin(),
          EE = I->second.end(); II  != EE; ++II)
       assert(II->second != D);
   }
 
-  for (reverseDepMapType::iterator I = reverseDep.begin(), E = reverseDep.end();
-       I != E; ++I)
-    for (SmallPtrSet<Instruction*, 4>::iterator II = I->second.begin(), EE = I->second.end();
-         II != EE; ++II)
+  for (reverseDepMapType::const_iterator I = reverseDep.begin(),
+       E = reverseDep.end(); I != E; ++I)
+    for (SmallPtrSet<Instruction*, 4>::const_iterator II = I->second.begin(),
+         EE = I->second.end(); II != EE; ++II)
       assert(*II != D);
 
-  for (reverseDepMapType::iterator I = reverseDepNonLocal.begin(), E = reverseDepNonLocal.end();
+  for (reverseDepMapType::const_iterator I = reverseDepNonLocal.begin(),
+       E = reverseDepNonLocal.end();
        I != E; ++I)
-    for (SmallPtrSet<Instruction*, 4>::iterator II = I->second.begin(), EE = I->second.end();
-         II != EE; ++II)
+    for (SmallPtrSet<Instruction*, 4>::const_iterator II = I->second.begin(),
+         EE = I->second.end(); II != EE; ++II)
       assert(*II != D);
 }