remove attribution from a variety of miscellaneous files.
[oota-llvm.git] / include / llvm / ADT / hash_set.in
1 //===-- llvm/ADT/hash_set - "Portable" wrapper around hash_set --*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 // vim:ft=cpp
10 //
11 // This file provides a wrapper around the mysterious <hash_set> header file
12 // that seems to move around between GCC releases into and out of namespaces at
13 // will.  #including this header will cause hash_set to be available in the
14 // global namespace.
15 //
16 //===----------------------------------------------------------------------===//
17
18 #ifndef LLVM_ADT_HASH_SET
19 #define LLVM_ADT_HASH_SET
20
21 // Compiler Support Matrix
22 //
23 // Version   Namespace   Header File
24 //  2.95.x       ::        hash_set
25 //  3.0.4       std      ext/hash_set
26 //  3.1      __gnu_cxx   ext/hash_set
27 //  HP aCC6     std      stdex/rw/hashset.h
28 //  MS VC++    stdext      hash_set
29
30 #undef HAVE_GNU_EXT_HASH_SET
31 #undef HAVE_STD_EXT_HASH_SET
32 #undef HAVE_GLOBAL_HASH_SET
33 #undef HAVE_RW_STDEX_HASH_SET_H
34
35 // GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
36 // the __gnu_cxx namespace.
37 #if HAVE_GNU_EXT_HASH_SET
38 # include <ext/hash_set>
39 # ifndef HASH_NAMESPACE
40 #  define HASH_NAMESPACE __gnu_cxx
41 # endif
42
43 // GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
44 #elif HAVE_STD_EXT_HASH_SET
45 # include <ext/hash_set>
46 # ifndef HASH_NAMESPACE
47 #  define HASH_NAMESPACE std
48 # endif
49
50 // Older compilers such as GCC before version 3.0 do not keep
51 // extensions in the `ext' directory, and ignore the `std' namespace.
52 #elif HAVE_GLOBAL_HASH_SET
53 # include <hash_set>
54 # ifndef HASH_NAMESPACE
55 #  define HASH_NAMESPACE std
56 # endif
57
58 // HP aCC doesn't include an SGI-like hash_set. For this platform (or
59 // any others using Rogue Wave Software's Tools.h++ library), we wrap
60 // around them in std::
61 #elif HAVE_RW_STDEX_HASH_SET_H
62 # include <rw/stdex/hashset.h>
63 # ifndef HASH_NAMESPACE
64 #  define HASH_NAMESPACE std
65 # endif
66
67 // Support Microsoft VC++.
68 #elif defined(_MSC_VER)
69 # include <hash_set>
70 # ifndef HASH_NAMESPACE
71 #  define HASH_NAMESPACE stdext
72 # endif
73
74 // Give a warning if we couldn't find it, instead of (or in addition to)
75 // randomly doing something dumb.
76 #else
77 # warning "Autoconfiguration failed to find the hash_set header file."
78 #endif
79
80 // we wrap Rogue Wave Tools.h++ rw_hashset into something SGI-looking, here:
81 #ifdef HAVE_RW_STDEX_HASH_SET_H
82 namespace HASH_NAMESPACE {
83
84 /*
85 template <class DataType> struct hash {
86     unsigned int operator()(const unsigned int& x) const {
87       return x;
88     }
89 };
90 */
91
92 template <typename ValueType,
93   class _HashFcn = hash<ValueType>,
94   class _EqualKey = equal_to<ValueType>,
95   class _A = allocator <ValueType> >
96 class hash_set : 
97   public rw_hashset<ValueType, class _HashFcn, class _EqualKey, class _A> {
98 };
99
100 } // end HASH_NAMESPACE;
101 #endif
102
103 using HASH_NAMESPACE::hash_set;
104
105 // Include vector because ext/hash_set includes stl_vector.h and leaves
106 // out specializations like stl_bvector.h, causing link conflicts.
107 #include <vector>
108
109 #include "llvm/ADT/HashExtras.h"
110
111 #endif