Add support for -march=c
[oota-llvm.git] / include / Support / iterator
index d0c7b511f04db713b90af3319d64a9a81f0ee18f..b26790f4f2fc226f498530c371368b6d69f6a392 100644 (file)
@@ -1,4 +1,11 @@
 //===-- Support/iterator - "Portable" wrapper around <iterator> -*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This file provides a wrapper around the mysterious <iterator> header file.
 // In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
 
 #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 +43,34 @@ struct bidirectional_iterator
   : 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