[llvm-commits] CVS: llvm/include/llvm/ADT/ilist
Nate Begeman
natebegeman at mac.com
Wed Jun 15 11:28:55 PDT 2005
Changes in directory llvm/include/llvm/ADT:
ilist updated: 1.25 -> 1.26
---
Log message:
Add some operators the PowerPC backend needs to efficiently and correctly
generate conditional branches.
---
Diffs of the changes: (+20 -0)
ilist | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+)
Index: llvm/include/llvm/ADT/ilist
diff -u llvm/include/llvm/ADT/ilist:1.25 llvm/include/llvm/ADT/ilist:1.26
--- llvm/include/llvm/ADT/ilist:1.25 Wed Mar 16 16:42:45 2005
+++ llvm/include/llvm/ADT/ilist Wed Jun 15 13:28:44 2005
@@ -169,6 +169,26 @@
template<typename T>
void operator+(ilist_iterator<T>,int);
+// operator!=/operator== - Allow mixed comparisons without dereferencing
+// the iterator, which could very likely be pointing to end().
+template<typename T>
+bool operator!=(const T* LHS, const ilist_iterator<const T> &RHS) {
+ return LHS != RHS.getNodePtrUnchecked();
+}
+template<typename T>
+bool operator==(const T* LHS, const ilist_iterator<const T> &RHS) {
+ return LHS == RHS.getNodePtrUnchecked();
+}
+template<typename T>
+bool operator!=(T* LHS, const ilist_iterator<T> &RHS) {
+ return LHS != RHS.getNodePtrUnchecked();
+}
+template<typename T>
+bool operator==(T* LHS, const ilist_iterator<T> &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...
More information about the llvm-commits
mailing list