From: Nate Begeman Date: Wed, 15 Jun 2005 18:28:44 +0000 (+0000) Subject: Add some operators the PowerPC backend needs to efficiently and correctly X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cb647519d34184fe41aa7e072076ae70634bc3d7;p=oota-llvm.git Add some operators the PowerPC backend needs to efficiently and correctly generate conditional branches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22214 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/ilist b/include/llvm/ADT/ilist index 877e1445f48..1d01b63fe73 100644 --- a/include/llvm/ADT/ilist +++ b/include/llvm/ADT/ilist @@ -169,6 +169,26 @@ void operator+(int, ilist_iterator); template void operator+(ilist_iterator,int); +// operator!=/operator== - Allow mixed comparisons without dereferencing +// the iterator, which could very likely be pointing to end(). +template +bool operator!=(const T* LHS, const ilist_iterator &RHS) { + return LHS != RHS.getNodePtrUnchecked(); +} +template +bool operator==(const T* LHS, const ilist_iterator &RHS) { + return LHS == RHS.getNodePtrUnchecked(); +} +template +bool operator!=(T* LHS, const ilist_iterator &RHS) { + return LHS != RHS.getNodePtrUnchecked(); +} +template +bool operator==(T* LHS, const ilist_iterator &RHS) { + return LHS == RHS.getNodePtrUnchecked(); +} + + // Allow ilist_iterators to convert into pointers to a node automatically when // used by the dyn_cast, cast, isa mechanisms...