1 //===-- Support/hash_map - "Portable" wrapper around hash_map ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
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
15 //===----------------------------------------------------------------------===//
17 #ifndef SUPPORT_HASH_MAP
18 #define SUPPORT_HASH_MAP
20 // Compiler Support Matrix
22 // Version Namespace Header File
24 // 3.0.4 std ext/hash_map
25 // 3.1 __gnu_cxx ext/hash_map
28 #include "Config/config.h"
30 #ifdef HAVE_GNU_EXT_HASH_MAP
31 // This is for GCC-3.1+ which puts hash in ext/hash_map
32 #include <ext/hash_map>
33 #define HASH_NAMESPACE __gnu_cxx
37 // This is for GCC-3.0.x which puts hashmap in the `ext' directory.
38 #ifdef HAVE_STD_EXT_HASH_MAP
39 #include <ext/hash_map>
40 #define HASH_NAMESPACE std
43 // This handles older, pre-3.0 GCC which do not have the extentions in the `ext'
44 // directory, and ignore the `std' namespace.
46 #define HASH_NAMESPACE std
51 using HASH_NAMESPACE::hash_map;
52 using HASH_NAMESPACE::hash_multimap;
53 using HASH_NAMESPACE::hash;
55 // Include vector because ext/hash_map includes stl_vector.h and leaves
56 // out specializations like stl_bvector.h, causing link conflicts.
59 #include <Support/HashExtras.h>