OSDN Git Service

Remove some duplication.
authorMikhail Glushenkov <foldr@codedgers.com>
Sat, 7 Mar 2009 20:18:46 +0000 (20:18 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Sat, 7 Mar 2009 20:18:46 +0000 (20:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66347 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CompilerDriver/CompilationGraph.h

index b03f144..6bb649b 100644 (file)
@@ -261,16 +261,19 @@ namespace llvmc {
       return *this;
     }
 
-    inline bool operator==(const ThisType& I) const
-    { return EdgeIter == I.EdgeIter; }
-    inline bool operator!=(const ThisType& I) const
-    { return EdgeIter != I.EdgeIter; }
+    inline bool operator==(const ThisType& I) const {
+      assert(OwningGraph == I.OwningGraph);
+      return EdgeIter == I.EdgeIter;
+    }
+    inline bool operator!=(const ThisType& I) const {
+      return !this->operator==(I);
+    }
 
     inline pointer operator*() const {
       return &OwningGraph->getNode((*EdgeIter)->ToolName());
     }
     inline pointer operator->() const {
-      return &OwningGraph->getNode((*EdgeIter)->ToolName());
+      return this->operator*();
     }
 
     ThisType& operator++() { ++EdgeIter; return *this; } // Preincrement