[llvm-commits] CVS: llvm/include/Support/iterator

John Criswell criswell at cs.uiuc.edu
Tue Jul 29 14:13:05 PDT 2003


Changes in directory llvm/include/Support:

iterator updated: 1.4 -> 1.5

---
Log message:

Enable JIT when the platform supports it.
Select /localhome/$USER when it exists.
Fix the checks for bidirectional and forward iterators so that they work with
version of GCC prior to 3.x.


---
Diffs of the changes:

Index: llvm/include/Support/iterator
diff -u llvm/include/Support/iterator:1.4 llvm/include/Support/iterator:1.5
--- llvm/include/Support/iterator:1.4	Mon Jun 30 16:58:24 2003
+++ llvm/include/Support/iterator	Tue Jul 29 14:11:58 2003
@@ -23,6 +23,11 @@
 
 #include <iterator>
 
+//////////////////////////////////////////////////////////////////////////////
+// If the bidirectional iterator is not defined, attempt to define it using
+// the C++ standard iterator.
+//////////////////////////////////////////////////////////////////////////////
+#ifndef HAVE_BI_ITERATOR
 #ifdef HAVE_STD_ITERATOR
 
 // Define stupid wrappers around std::iterator...
@@ -31,16 +36,34 @@
   : public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
 };
 
-template<class Ty, class PtrDiffTy>
-struct forward_iterator
-  : public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
-};
+#else
+#error "Need to have standard iterator to define bidirectional iterator!"
+#endif
 
 #else
 
 // Just use bidirectional_iterator directly.
 using std::bidirectional_iterator;
+
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+// If the forward iterator is not defined, attempt to define it using the
+// C++ standard iterator.
+//////////////////////////////////////////////////////////////////////////////
+#ifndef HAVE_FWD_ITERATOR
+#ifdef HAVE_STD_ITERATOR
+template<class Ty, class PtrDiffTy>
+struct forward_iterator
+  : public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
+};
+#else
+#error "Need to have standard iterator to define forward iterator!"
+#endif
+#else
+// Just use forward iterator directly.
 using std::forward_iterator;
 #endif
+
 
 #endif





More information about the llvm-commits mailing list