Modified hash_map and hash_set configuration so that they are not
[oota-llvm.git] / include / llvm / ADT / hash_map.in
1 //===-- llvm/ADT/hash_map - "Portable" wrapper around hash_map --*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 // 
10 // This file provides a wrapper around the mysterious <hash_map> 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_map to be available in the
13 // global namespace.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef LLVM_ADT_HASH_MAP
18 #define LLVM_ADT_HASH_MAP
19
20 // Compiler Support Matrix
21 //
22 // Version   Namespace   Header File
23 //  2.95.x       ::        hash_map
24 //  3.0.4       std      ext/hash_map
25 //  3.1      __gnu_cxx   ext/hash_map
26 //
27
28 #undef HAVE_GNU_EXT_HASH_MAP
29 #undef HAVE_STD_EXT_HASH_MAP
30 #undef HAVE_GLOBAL_HASH_MAP
31
32 #if HAVE_GNU_EXT_HASH_MAP
33 // This is for GCC-3.1+ which puts hash in ext/hash_map
34 # include <ext/hash_map>
35 # ifndef HASH_NAMESPACE
36 #  define HASH_NAMESPACE __gnu_cxx
37 # endif
38
39 // GCC 3.0.x puts hash_map in <ext/hash_map> and in the std namespace.
40 #elif HAVE_STD_EXT_HASH_MAP
41 # include <ext/hash_map>
42 # ifndef HASH_NAMESPACE
43 #  define HASH_NAMESPACE std
44 # endif
45
46 // Older compilers such as GCC before version 3.0 do not keep
47 // extensions in the `ext' directory, and ignore the `std' namespace.
48 #elif HAVE_GLOBAL_HASH_MAP
49 # include <hash_map>
50 # ifndef HASH_NAMESPACE
51 #  define HASH_NAMESPACE std
52 # endif
53
54 // Give a warning if we couldn't find it, instead of (or in addition to)
55 // randomly doing something dumb.
56 #else
57 # warning "Autoconfiguration failed to find the hash_map header file."
58 #endif
59
60 using HASH_NAMESPACE::hash_map;
61 using HASH_NAMESPACE::hash_multimap;
62 using HASH_NAMESPACE::hash;
63
64 // Include vector because ext/hash_map includes stl_vector.h and leaves
65 // out specializations like stl_bvector.h, causing link conflicts.
66 #include <vector>
67
68 #include <llvm/ADT/HashExtras.h>
69
70 #endif