From: Mikhail Glushenkov Date: Sat, 7 Mar 2009 20:18:46 +0000 (+0000) Subject: Remove some duplication. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=0acf6b00f3f5728952a257f98fd45e84a0ece23c;p=oota-llvm.git Remove some duplication. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66347 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CompilerDriver/CompilationGraph.h b/include/llvm/CompilerDriver/CompilationGraph.h index b03f144f1bc..6bb649b99c3 100644 --- a/include/llvm/CompilerDriver/CompilationGraph.h +++ b/include/llvm/CompilerDriver/CompilationGraph.h @@ -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