[llvm-commits] [llvm] r60215 - in /llvm/trunk: include/llvm/Analysis/MemoryDependenceAnalysis.h lib/Analysis/MemoryDependenceAnalysis.cpp

Chris Lattner sabre at nondot.org
Fri Nov 28 13:42:10 PST 2008


Author: lattner
Date: Fri Nov 28 15:42:09 2008
New Revision: 60215

URL: http://llvm.org/viewvc/llvm-project?rev=60215&view=rev
Log:
rename "ping" to "verifyRemoved".  I don't know why 'ping' what chosen,
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.

Modified:
    llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
    llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp

Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=60215&r1=60214&r2=60215&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Fri Nov 28 15:42:09 2008
@@ -51,8 +51,6 @@
     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 @@
     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,

Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=60215&r1=60214&r2=60215&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Fri Nov 28 15:42:09 2008
@@ -48,31 +48,32 @@
 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);
 }
 





More information about the llvm-commits mailing list