llvm.org GIT mirror llvm / 59fad7d
Remove configurey-fu to autodetect hash_map and hash_set now that they are no longer used in LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66406 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 10 years ago
12 changed file(s) with 0 addition(s) and 772 deletion(s). Raw diff Collapse all Expand all
116116 dist-hook::
117117 $(Echo) Eliminating files constructed by configure
118118 $(Verb) $(RM) -f \
119 $(TopDistDir)/include/llvm/ADT/hash_map.h \
120 $(TopDistDir)/include/llvm/ADT/hash_set.h \
121119 $(TopDistDir)/include/llvm/ADT/iterator.h \
122120 $(TopDistDir)/include/llvm/Config/config.h \
123121 $(TopDistDir)/include/llvm/Support/DataTypes.h \
136134 FilesToConfig := \
137135 include/llvm/Config/config.h \
138136 include/llvm/Support/DataTypes.h \
139 include/llvm/ADT/hash_map.h \
140 include/llvm/ADT/hash_set.h \
141137 include/llvm/ADT/iterator.h
142138 FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
143139
841841
842842 dnl Check for variations in the Standard C++ library and STL. These macros are
843843 dnl provided by LLVM in the autoconf/m4 directory.
844 AC_CXX_HAVE_HASH_MAP
845 AC_CXX_HAVE_HASH_SET
846844 AC_CXX_HAVE_STD_ITERATOR
847845 AC_CXX_HAVE_BI_ITERATOR
848846 AC_CXX_HAVE_FWD_ITERATOR
10471045 dnl files can be updated automatically when their *.in sources change.
10481046 AC_CONFIG_HEADERS([include/llvm/Config/config.h])
10491047 AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
1050 AC_CONFIG_HEADERS([include/llvm/ADT/hash_map.h])
1051 AC_CONFIG_HEADERS([include/llvm/ADT/hash_set.h])
10521048 AC_CONFIG_HEADERS([include/llvm/ADT/iterator.h])
10531049
10541050 dnl Configure the makefile's configuration data
+0
-59
autoconf/m4/cxx_hash_map.m4 less more
None # Check for hash_map extension. This is from
1 # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_map.html
2 AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_MAP],
3 [AC_CACHE_CHECK([whether the compiler has defining template class std::hash_map],
4 ac_cv_cxx_have_std_ext_hash_map,
5 [AC_REQUIRE([AC_CXX_NAMESPACES])
6 AC_LANG_PUSH([C++])
7 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
8 #ifdef HAVE_NAMESPACES
9 using namespace std;
10 #endif]], [[hash_map t;]])],[ac_cv_cxx_have_std_ext_hash_map=yes],[ac_cv_cxx_have_std_ext_hash_map=no])
11 AC_LANG_POP([C++])])
12 if test "$ac_cv_cxx_have_std_ext_hash_map" = yes
13 then
14 AC_DEFINE(HAVE_STD_EXT_HASH_MAP,1,[Have ext/hash_map>])
15 else
16 AC_DEFINE(HAVE_STD_EXT_HASH_MAP,0,[Does not have ext/hash_map>])
17 fi
18 ])
19
20 AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_MAP],
21 [AC_CACHE_CHECK([whether the compiler has defining template class __gnu_cxx::hash_map],
22 ac_cv_cxx_have_gnu_ext_hash_map,
23 [AC_REQUIRE([AC_CXX_NAMESPACES])
24 AC_LANG_PUSH([C++])
25 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
26 #ifdef HAVE_NAMESPACES
27 using namespace __gnu_cxx;
28 #endif]], [[hash_map t; ]])],[ac_cv_cxx_have_gnu_ext_hash_map=yes],[ac_cv_cxx_have_gnu_ext_hash_map=no])
29 AC_LANG_POP([C++])])
30 if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes
31 then
32 AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,1,[Have ext/hash_map])
33 else
34 AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,0,[Does not have ext/hash_map])
35 fi
36 ])
37
38 AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP],
39 [AC_CACHE_CHECK([whether the compiler has defining template class ::hash_map],
40 ac_cv_cxx_have_global_hash_map,
41 [AC_REQUIRE([AC_CXX_NAMESPACES])
42 AC_LANG_PUSH([C++])
43 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[hash_map t; ]])],[ac_cv_cxx_have_global_hash_map=yes],[ac_cv_cxx_have_global_hash_map=no])
44 AC_LANG_POP([C++])])
45 if test "$ac_cv_cxx_have_global_hash_map" = yes
46 then
47 AC_DEFINE(HAVE_GLOBAL_HASH_MAP,1,[Have ])
48 else
49 AC_DEFINE(HAVE_GLOBAL_HASH_MAP,0,[Does not have ])
50 fi
51 ])
52
53 AC_DEFUN([AC_CXX_HAVE_HASH_MAP],
54 [AC_CXX_HAVE_STD_EXT_HASH_MAP
55 AC_CXX_HAVE_GNU_EXT_HASH_MAP
56 AC_CXX_HAVE_GLOBAL_HASH_MAP])
57
58
+0
-60
autoconf/m4/cxx_hash_set.m4 less more
None # Check for hash_set extension. This is modified from
1 # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
2 AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_SET],
3 [AC_CACHE_CHECK([whether the compiler has defining template class std::hash_set],
4 ac_cv_cxx_have_std_ext_hash_set,
5 [AC_REQUIRE([AC_CXX_NAMESPACES])
6 AC_LANG_PUSH([C++])
7 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
8 #ifdef HAVE_NAMESPACES
9 using namespace std;
10 #endif]], [[hash_set t; ]])],[ac_cv_cxx_have_std_ext_hash_set=yes],[ac_cv_cxx_have_std_ext_hash_set=no])
11 AC_LANG_POP([C++])])
12 if test "$ac_cv_cxx_have_std_ext_hash_set" = yes
13 then
14 AC_DEFINE(HAVE_STD_EXT_HASH_SET,1,[Have hash_set in std namespace])
15 else
16 AC_DEFINE(HAVE_STD_EXT_HASH_SET,0,[Does not have hash_set in std namespace])
17 fi
18 ])
19
20 AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_SET],
21 [AC_CACHE_CHECK(
22 [whether the compiler has defining template class __gnu_cxx::hash_set],
23 ac_cv_cxx_have_gnu_ext_hash_set,
24 [AC_REQUIRE([AC_CXX_NAMESPACES])
25 AC_LANG_PUSH([C++])
26 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
27 #ifdef HAVE_NAMESPACES
28 using namespace __gnu_cxx;
29 #endif]], [[hash_set t; ]])],[ac_cv_cxx_have_gnu_ext_hash_set=yes],[ac_cv_cxx_have_gnu_ext_hash_set=no])
30 AC_LANG_POP([C++])])
31 if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes
32 then
33 AC_DEFINE(HAVE_GNU_EXT_HASH_SET,1,[Have hash_set in gnu namespace])
34 else
35 AC_DEFINE(HAVE_GNU_EXT_HASH_SET,0,[Does not have hash_set in gnu namespace])
36 fi
37 ])
38
39 AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_SET],
40 [AC_CACHE_CHECK([whether the compiler has defining template class ::hash_set],
41 ac_cv_cxx_have_global_hash_set,
42 [AC_REQUIRE([AC_CXX_NAMESPACES])
43 AC_LANG_PUSH([C++])
44 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[hash_set t; return 0;]])],[ac_cv_cxx_have_global_hash_set=yes],[ac_cv_cxx_have_global_hash_set=no])
45 AC_LANG_POP([C++])])
46 if test "$ac_cv_cxx_have_global_hash_set" = yes
47 then
48 AC_DEFINE(HAVE_GLOBAL_HASH_SET,1,[Have hash_set in global namespace])
49 else
50 AC_DEFINE(HAVE_GLOBAL_HASH_SET,0,[Does not have hash_set in global namespace])
51 fi
52 ])
53
54 AC_DEFUN([AC_CXX_HAVE_HASH_SET],
55 [AC_CXX_HAVE_STD_EXT_HASH_SET
56 AC_CXX_HAVE_GNU_EXT_HASH_SET
57 AC_CXX_HAVE_GLOBAL_HASH_SET])
58
59
8585 set(LTDL_DLOPEN_DEPLIBS 0) # TODO
8686 endif( MSVC )
8787
88 if( NOT MSVC )
89 # hash_map.h.in and hash_set.h.in contain a special case for MSVC
90 include(CheckCxxHashmap)
91 include(CheckCxxHashset)
92 check_hashmap()
93 check_hashset()
94 endif( NOT MSVC )
95
9688 # FIXME: Signal handler return type, currently hardcoded to 'void'
9789 set(RETSIGTYPE void)
9890
123115 ${LLVM_BINARY_DIR}/include/llvm/Support/DataTypes.h
124116 )
125117
126 configure_file(
127 ${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT/hash_map.cmake
128 ${LLVM_BINARY_DIR}/include/llvm/ADT/hash_map.h
129 )
130
131 configure_file(
132 ${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT/hash_set.cmake
133 ${LLVM_BINARY_DIR}/include/llvm/ADT/hash_set.h
134 )
+0
-53
cmake/modules/CheckCxxHashmap.cmake less more
None # - Check if for hash_map.
1 # CHECK_HASHMAP ()
2 #
3
4 include(CheckCXXSourceCompiles)
5
6 macro(CHECK_HASHMAP)
7 message(STATUS "Checking for C++ hash_map implementation...")
8 check_cxx_source_compiles("
9 #include
10 int main() {
11 __gnu_cxx::hash_map t;
12 }
13 "
14 HAVE_GNU_EXT_HASH_MAP
15 )
16 if(HAVE_GNU_EXT_HASH_MAP)
17 message(STATUS "C++ hash_map found in 'ext' dir in namespace __gnu_cxx::")
18 endif(HAVE_GNU_EXT_HASH_MAP)
19
20 check_cxx_source_compiles("
21 #include
22 int main() {
23 std::hash_map t;
24 }
25 "
26 HAVE_STD_EXT_HASH_MAP
27 )
28 if(HAVE_STD_EXT_HASH_MAP)
29 message(STATUS "C++ hash_map found in 'ext' dir in namespace std::")
30 endif(HAVE_STD_EXT_HASH_MAP)
31
32 check_cxx_source_compiles("
33 #include
34 int main() {
35 hash_map t;
36 }
37 "
38 HAVE_GLOBAL_HASH_MAP
39 )
40 if(HAVE_GLOBAL_HASH_MAP)
41 message(STATUS "C++ hash_map found in global namespace")
42 endif(HAVE_GLOBAL_HASH_MAP)
43
44 if(NOT HAVE_GNU_EXT_HASH_MAP)
45 if(NOT HAVE_STD_EXT_HASH_MAP)
46 if(NOT HAVE_GLOBAL_HASH_MAP)
47 message(STATUS "C++ hash_map not found")
48 endif(NOT HAVE_GLOBAL_HASH_MAP)
49 endif(NOT HAVE_STD_EXT_HASH_MAP)
50 endif(NOT HAVE_GNU_EXT_HASH_MAP)
51
52 endmacro(CHECK_HASHMAP)
+0
-52
cmake/modules/CheckCxxHashset.cmake less more
None # - Check if for hash_set.
1 # CHECK_HASHSET ()
2 #
3
4 include(CheckCXXSourceCompiles)
5
6 macro(CHECK_HASHSET)
7 message(STATUS "Checking for C++ hash_set implementation...")
8 check_cxx_source_compiles("
9 #include
10 int main() {
11 __gnu_cxx::hash_set t;
12 }
13 "
14 HAVE_GNU_EXT_HASH_SET
15 )
16 if(HAVE_GNU_EXT_HASH_SET)
17 message(STATUS "C++ hash_set found in 'ext' dir in namespace __gnu_cxx::")
18 endif(HAVE_GNU_EXT_HASH_SET)
19
20 check_cxx_source_compiles("
21 #include
22 int main() {
23 std::hash_set t;
24 }
25 "
26 HAVE_STD_EXT_HASH_SET
27 )
28 if(HAVE_STD_EXT_HASH_SET)
29 message(STATUS "C++ hash_set found in 'ext' dir in namespace std::")
30 endif(HAVE_STD_EXT_HASH_SET)
31
32 check_cxx_source_compiles("
33 #include
34 int main() {
35 hash_set t;
36 }
37 "
38 HAVE_GLOBAL_HASH_SET
39 )
40 if(HAVE_GLOBAL_HASH_SET)
41 message(STATUS "C++ hash_set found in global namespace")
42 endif(HAVE_GLOBAL_HASH_SET)
43
44 if(NOT HAVE_GNU_EXT_HASH_SET)
45 if(NOT HAVE_STD_EXT_HASH_SET)
46 if(NOT HAVE_GLOBAL_HASH_SET)
47 message(STATUS "C++ hash_set not found")
48 endif(NOT HAVE_GLOBAL_HASH_SET)
49 endif(NOT HAVE_STD_EXT_HASH_SET)
50 endif(NOT HAVE_GNU_EXT_HASH_SET)
51 endmacro(CHECK_HASHSET)
1616 #ifndef LLVM_ADT_HASHEXTRAS_H
1717 #define LLVM_ADT_HASHEXTRAS_H
1818
19 #include "llvm/ADT/hash_map.h"
2019 #include
2120
2221 // Cannot specialize hash template from outside of the std namespace.
+0
-150
include/llvm/ADT/hash_map.cmake less more
None //===-- llvm/ADT/hash_map - "Portable" wrapper around hash_map --*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file was developed by the LLVM research group and is distributed under
5 // the University of Illinois Open Source License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides a wrapper around the mysterious header file
10 // that seems to move around between GCC releases into and out of namespaces at
11 // will. #including this header will cause hash_map to be available in the
12 // global namespace.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_ADT_HASH_MAP
17 #define LLVM_ADT_HASH_MAP
18
19 // Compiler Support Matrix
20 //
21 // Version Namespace Header File
22 // 2.95.x :: hash_map
23 // 3.0.4 std ext/hash_map
24 // 3.1 __gnu_cxx ext/hash_map
25 // HP aCC6 std stdex/rw/hashm*ap.h
26 // MS VC++ stdext hash_map
27
28 #cmakedefine HAVE_GNU_EXT_HASH_MAP
29 #cmakedefine HAVE_STD_EXT_HASH_MAP
30 #cmakedefine HAVE_GLOBAL_HASH_MAP
31 #cmakedefine HAVE_RW_STDEX_HASH_MAP_H
32
33 #if defined(HAVE_GNU_EXT_HASH_MAP)
34 // This is for GCC-3.1+ which puts hash in ext/hash_map
35 # include
36 # ifndef HASH_NAMESPACE
37 # define HASH_NAMESPACE __gnu_cxx
38 # endif
39
40 // GCC 3.0.x puts hash_map in and in the std namespace.
41 #elif defined(HAVE_STD_EXT_HASH_MAP)
42 # include
43 # ifndef HASH_NAMESPACE
44 # define HASH_NAMESPACE std
45 # endif
46
47 // Older compilers such as GCC before version 3.0 do not keep
48 // extensions in the `ext' directory, and ignore the `std' namespace.
49 #elif defined(HAVE_GLOBAL_HASH_MAP)
50 # include
51 # ifndef HASH_NAMESPACE
52 # define HASH_NAMESPACE std
53 # endif
54
55 // HP aCC doesn't include an SGI-like hash_map. For this platform (or
56 // any others using Rogue Wave Software's Tools.h++ library), we wrap
57 // around them in std::
58 #elif defined(HAVE_RW_STDEX_HASH_MAP_H)
59 # include
60 # include
61 # ifndef HASH_NAMESPACE
62 # define HASH_NAMESPACE std
63 # endif
64
65 // Support Microsoft VC++.
66 #elif defined(_MSC_VER)
67 # include
68 # ifndef HASH_NAMESPACE
69 # define HASH_NAMESPACE stdext
70 using std::_Distance;
71 # endif
72
73 // Give a warning if we couldn't find it, instead of (or in addition to)
74 // randomly doing something dumb.
75 #else
76 # warning "Autoconfiguration failed to find the hash_map header file."
77 #endif
78
79 // we wrap Rogue Wave Tools.h++ rw_hashmap into something SGI-looking, here:
80 #ifdef HAVE_RW_STDEX_HASH_MAP_H
81 namespace HASH_NAMESPACE {
82
83 template struct hash {
84 unsigned int operator()(const unsigned int& x) const {
85 return x;
86 }
87 };
88
89 template
90 typename ValueType,
91 class _HashFcn = hash,
92 class _EqualKey = equal_to,
93 class _A = allocator >
94 class hash_map : public rw_hashmap
95 class _EqualKey, class _A> {
96 };
97
98 template
99 typename ValueType,
100 class _HashFcn = hash,
101 class _EqualKey = equal_to,
102 class _A = allocator >
103 class hash_multimap : public rw_hashmultimap
104 class _EqualKey, class _A> {
105 };
106
107 } // end HASH_NAMESPACE;
108 #endif
109
110 // Include vector because ext/hash_map includes stl_vector.h and leaves
111 // out specializations like stl_bvector.h, causing link conflicts.
112 #include
113
114 #ifdef _MSC_VER
115
116 // GCC and VC++ have differing ways of implementing hash_maps. As it's not
117 // standardized, that's to be expected. This adapter class allows VC++
118 // hash_map to use GCC's hash classes.
119 namespace stdext {
120 template struct hash;
121
122 // Provide a hash function for unsigned ints...
123 template<> struct hash {
124 inline size_t operator()(unsigned int Val) const {
125 return Val;
126 }
127 };
128
129 template class hash_compare > {
130 std::less comp;
131 public:
132 enum { bucket_size = 4 };
133 enum { min_buckets = 8 };
134 hash_compare() {}
135 hash_compare(std::less pred) : comp(pred) {}
136 size_t operator()(const Key& key) const { return hash()(key); }
137 bool operator()(const Key& k1, const Key& k2) const { return comp(k1, k2); }
138 };
139 }
140
141 #endif
142
143 using HASH_NAMESPACE::hash_map;
144 using HASH_NAMESPACE::hash_multimap;
145 using HASH_NAMESPACE::hash;
146
147 #include "llvm/ADT/HashExtras.h"
148
149 #endif
+0
-150
include/llvm/ADT/hash_map.h.in less more
None //==-- llvm/ADT/hash_map.h - "Portable" wrapper around hash_map --*- C++ -*-==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides a wrapper around the mysterious header file
10 // that seems to move around between GCC releases into and out of namespaces at
11 // will. #including this header will cause hash_map to be available in the
12 // global namespace.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_ADT_HASH_MAP_H
17 #define LLVM_ADT_HASH_MAP_H
18
19 // Compiler Support Matrix
20 //
21 // Version Namespace Header File
22 // 2.95.x :: hash_map
23 // 3.0.4 std ext/hash_map
24 // 3.1 __gnu_cxx ext/hash_map
25 // HP aCC6 std stdex/rw/hashm*ap.h
26 // MS VC++ stdext hash_map
27
28 #undef HAVE_GNU_EXT_HASH_MAP
29 #undef HAVE_STD_EXT_HASH_MAP
30 #undef HAVE_GLOBAL_HASH_MAP
31 #undef HAVE_RW_STDEX_HASH_MAP_H
32
33 #if HAVE_GNU_EXT_HASH_MAP
34 // This is for GCC-3.1+ which puts hash in ext/hash_map
35 # include
36 # ifndef HASH_NAMESPACE
37 # define HASH_NAMESPACE __gnu_cxx
38 # endif
39
40 // GCC 3.0.x puts hash_map in and in the std namespace.
41 #elif HAVE_STD_EXT_HASH_MAP
42 # include
43 # ifndef HASH_NAMESPACE
44 # define HASH_NAMESPACE std
45 # endif
46
47 // Older compilers such as GCC before version 3.0 do not keep
48 // extensions in the `ext' directory, and ignore the `std' namespace.
49 #elif HAVE_GLOBAL_HASH_MAP
50 # include
51 # ifndef HASH_NAMESPACE
52 # define HASH_NAMESPACE std
53 # endif
54
55 // HP aCC doesn't include an SGI-like hash_map. For this platform (or
56 // any others using Rogue Wave Software's Tools.h++ library), we wrap
57 // around them in std::
58 #elif HAVE_RW_STDEX_HASH_MAP_H
59 # include
60 # include
61 # ifndef HASH_NAMESPACE
62 # define HASH_NAMESPACE std
63 # endif
64
65 // Support Microsoft VC++.
66 #elif defined(_MSC_VER)
67 # include
68 # ifndef HASH_NAMESPACE
69 # define HASH_NAMESPACE stdext
70 using std::_Distance;
71 # endif
72
73 // Give a warning if we couldn't find it, instead of (or in addition to)
74 // randomly doing something dumb.
75 #else
76 # warning "Autoconfiguration failed to find the hash_map header file."
77 #endif
78
79 // we wrap Rogue Wave Tools.h++ rw_hashmap into something SGI-looking, here:
80 #ifdef HAVE_RW_STDEX_HASH_MAP_H
81 namespace HASH_NAMESPACE {
82
83 template struct hash {
84 unsigned int operator()(const unsigned int& x) const {
85 return x;
86 }
87 };
88
89 template
90 typename ValueType,
91 class _HashFcn = hash,
92 class _EqualKey = equal_to,
93 class _A = allocator >
94 class hash_map : public rw_hashmap
95 class _EqualKey, class _A> {
96 };
97
98 template
99 typename ValueType,
100 class _HashFcn = hash,
101 class _EqualKey = equal_to,
102 class _A = allocator >
103 class hash_multimap : public rw_hashmultimap
104 class _EqualKey, class _A> {
105 };
106
107 } // end HASH_NAMESPACE;
108 #endif
109
110 // Include vector because ext/hash_map includes stl_vector.h and leaves
111 // out specializations like stl_bvector.h, causing link conflicts.
112 #include
113
114 #ifdef _MSC_VER
115
116 // GCC and VC++ have differing ways of implementing hash_maps. As it's not
117 // standardized, that's to be expected. This adapter class allows VC++
118 // hash_map to use GCC's hash classes.
119 namespace stdext {
120 template struct hash;
121
122 // Provide a hash function for unsigned ints...
123 template<> struct hash {
124 inline size_t operator()(unsigned int Val) const {
125 return Val;
126 }
127 };
128
129 template class hash_compare > {
130 std::less comp;
131 public:
132 enum { bucket_size = 4 };
133 enum { min_buckets = 8 };
134 hash_compare() {}
135 hash_compare(std::less pred) : comp(pred) {}
136 size_t operator()(const Key& key) const { return hash()(key); }
137 bool operator()(const Key& k1, const Key& k2) const { return comp(k1, k2); }
138 };
139 }
140
141 #endif
142
143 using HASH_NAMESPACE::hash_map;
144 using HASH_NAMESPACE::hash_multimap;
145 using HASH_NAMESPACE::hash;
146
147 #include "llvm/ADT/HashExtras.h"
148
149 #endif // LLVM_ADT_HASH_MAP_H
+0
-111
include/llvm/ADT/hash_set.cmake less more
None //===-- llvm/ADT/hash_set - "Portable" wrapper around hash_set --*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file was developed by the LLVM research group and is distributed under
5 // the University of Illinois Open Source License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 // vim:ft=cpp
9 //
10 // This file provides a wrapper around the mysterious header file
11 // that seems to move around between GCC releases into and out of namespaces at
12 // will. #including this header will cause hash_set to be available in the
13 // global namespace.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef LLVM_ADT_HASH_SET
18 #define LLVM_ADT_HASH_SET
19
20 // Compiler Support Matrix
21 //
22 // Version Namespace Header File
23 // 2.95.x :: hash_set
24 // 3.0.4 std ext/hash_set
25 // 3.1 __gnu_cxx ext/hash_set
26 // HP aCC6 std stdex/rw/hashset.h
27 // MS VC++ stdext hash_set
28
29 #cmakedefine HAVE_GNU_EXT_HASH_SET
30 #cmakedefine HAVE_STD_EXT_HASH_SET
31 #cmakedefine HAVE_GLOBAL_HASH_SET
32 #cmakedefine HAVE_RW_STDEX_HASH_SET_H
33
34 // GCC versions 3.1 and later put hash_set in and in
35 // the __gnu_cxx namespace.
36 #if defined(HAVE_GNU_EXT_HASH_SET)
37 # include
38 # ifndef HASH_NAMESPACE
39 # define HASH_NAMESPACE __gnu_cxx
40 # endif
41
42 // GCC 3.0.x puts hash_set in and in the std namespace.
43 #elif defined(HAVE_STD_EXT_HASH_SET)
44 # include
45 # ifndef HASH_NAMESPACE
46 # define HASH_NAMESPACE std
47 # endif
48
49 // Older compilers such as GCC before version 3.0 do not keep
50 // extensions in the `ext' directory, and ignore the `std' namespace.
51 #elif defined(HAVE_GLOBAL_HASH_SET)
52 # include
53 # ifndef HASH_NAMESPACE
54 # define HASH_NAMESPACE std
55 # endif
56
57 // HP aCC doesn't include an SGI-like hash_set. For this platform (or
58 // any others using Rogue Wave Software's Tools.h++ library), we wrap
59 // around them in std::
60 #elif defined(HAVE_RW_STDEX_HASH_SET_H)
61 # include
62 # ifndef HASH_NAMESPACE
63 # define HASH_NAMESPACE std
64 # endif
65
66 // Support Microsoft VC++.
67 #elif defined(_MSC_VER)
68 # include
69 # ifndef HASH_NAMESPACE
70 # define HASH_NAMESPACE stdext
71 # endif
72
73 // Give a warning if we couldn't find it, instead of (or in addition to)
74 // randomly doing something dumb.
75 #else
76 # warning "Autoconfiguration failed to find the hash_set header file."
77 #endif
78
79 // we wrap Rogue Wave Tools.h++ rw_hashset into something SGI-looking, here:
80 #ifdef HAVE_RW_STDEX_HASH_SET_H
81 namespace HASH_NAMESPACE {
82
83 /*
84 template struct hash {
85 unsigned int operator()(const unsigned int& x) const {
86 return x;
87 }
88 };
89 */
90
91 template
92 class _HashFcn = hash,
93 class _EqualKey = equal_to,
94 class _A = allocator >
95 class hash_set :
96 public rw_hashset {
97 };
98
99 } // end HASH_NAMESPACE;
100 #endif
101
102 using HASH_NAMESPACE::hash_set;
103
104 // Include vector because ext/hash_set includes stl_vector.h and leaves
105 // out specializations like stl_bvector.h, causing link conflicts.
106 #include
107
108 #include "llvm/ADT/HashExtras.h"
109
110 #endif
+0
-111
include/llvm/ADT/hash_set.h.in less more
None //==-- llvm/ADT/hash_set.h - "Portable" wrapper around hash_set --*- C++ -*-==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 // vim:ft=cpp
9 //
10 // This file provides a wrapper around the mysterious header file
11 // that seems to move around between GCC releases into and out of namespaces at
12 // will. #including this header will cause hash_set to be available in the
13 // global namespace.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef LLVM_ADT_HASH_SET_H
18 #define LLVM_ADT_HASH_SET_H
19
20 // Compiler Support Matrix
21 //
22 // Version Namespace Header File
23 // 2.95.x :: hash_set
24 // 3.0.4 std ext/hash_set
25 // 3.1 __gnu_cxx ext/hash_set
26 // HP aCC6 std stdex/rw/hashset.h
27 // MS VC++ stdext hash_set
28
29 #undef HAVE_GNU_EXT_HASH_SET
30 #undef HAVE_STD_EXT_HASH_SET
31 #undef HAVE_GLOBAL_HASH_SET
32 #undef HAVE_RW_STDEX_HASH_SET_H
33
34 // GCC versions 3.1 and later put hash_set in and in
35 // the __gnu_cxx namespace.
36 #if HAVE_GNU_EXT_HASH_SET
37 # include
38 # ifndef HASH_NAMESPACE
39 # define HASH_NAMESPACE __gnu_cxx
40 # endif
41
42 // GCC 3.0.x puts hash_set in and in the std namespace.
43 #elif HAVE_STD_EXT_HASH_SET
44 # include
45 # ifndef HASH_NAMESPACE
46 # define HASH_NAMESPACE std
47 # endif
48
49 // Older compilers such as GCC before version 3.0 do not keep
50 // extensions in the `ext' directory, and ignore the `std' namespace.
51 #elif HAVE_GLOBAL_HASH_SET
52 # include
53 # ifndef HASH_NAMESPACE
54 # define HASH_NAMESPACE std
55 # endif
56
57 // HP aCC doesn't include an SGI-like hash_set. For this platform (or
58 // any others using Rogue Wave Software's Tools.h++ library), we wrap
59 // around them in std::
60 #elif HAVE_RW_STDEX_HASH_SET_H
61 # include
62 # ifndef HASH_NAMESPACE
63 # define HASH_NAMESPACE std
64 # endif
65
66 // Support Microsoft VC++.
67 #elif defined(_MSC_VER)
68 # include
69 # ifndef HASH_NAMESPACE
70 # define HASH_NAMESPACE stdext
71 # endif
72
73 // Give a warning if we couldn't find it, instead of (or in addition to)
74 // randomly doing something dumb.
75 #else
76 # warning "Autoconfiguration failed to find the hash_set header file."
77 #endif
78
79 // we wrap Rogue Wave Tools.h++ rw_hashset into something SGI-looking, here:
80 #ifdef HAVE_RW_STDEX_HASH_SET_H
81 namespace HASH_NAMESPACE {
82
83 /*
84 template struct hash {
85 unsigned int operator()(const unsigned int& x) const {
86 return x;
87 }
88 };
89 */
90
91 template
92 class _HashFcn = hash,
93 class _EqualKey = equal_to,
94 class _A = allocator >
95 class hash_set :
96 public rw_hashset {
97 };
98
99 } // end HASH_NAMESPACE;
100 #endif
101
102 using HASH_NAMESPACE::hash_set;
103
104 // Include vector because ext/hash_set includes stl_vector.h and leaves
105 // out specializations like stl_bvector.h, causing link conflicts.
106 #include
107
108 #include "llvm/ADT/HashExtras.h"
109
110 #endif // LLVM_ADT_HASH_SET_H