Clean up jitstd folder. (dotnet/coreclr#27542)
authorSergey Andreenko <seandree@microsoft.com>
Sat, 2 Nov 2019 00:44:52 +0000 (00:44 +0000)
committerJan Kotas <jkotas@microsoft.com>
Sat, 2 Nov 2019 00:44:52 +0000 (17:44 -0700)
* Delete solution files.

They were referencing unexisting files.

* Delete unused files with templates from jitstd.

Many of them have build errors when you instantiate them.

* fix ubuntu build breaks.

The header files did not include the necessary dependencies.

In the past it was ok because the compilation unit included jitstd.h that had #include "utility.h", #include "pair.h", and #include "type_traits.h" before #include "list.h".

Commit migrated from https://github.com/dotnet/coreclr/commit/14b650f35ebeed83e666039a1d3cb2eb7801c666

13 files changed:
src/coreclr/src/jit/jitstd.h
src/coreclr/src/jit/jitstd/hash.h [deleted file]
src/coreclr/src/jit/jitstd/hashtable.h [deleted file]
src/coreclr/src/jit/jitstd/jitstd.cpp [deleted file]
src/coreclr/src/jit/jitstd/jitstd.sln [deleted file]
src/coreclr/src/jit/jitstd/jitstd.vcxproj [deleted file]
src/coreclr/src/jit/jitstd/list.h
src/coreclr/src/jit/jitstd/stdafx.cpp [deleted file]
src/coreclr/src/jit/jitstd/stdafx.h [deleted file]
src/coreclr/src/jit/jitstd/targetver.h [deleted file]
src/coreclr/src/jit/jitstd/unordered_map.h [deleted file]
src/coreclr/src/jit/jitstd/unordered_set.h [deleted file]
src/coreclr/src/jit/jitstd/utility.h

index 6b42867..5d89694 100644 (file)
@@ -3,8 +3,9 @@
 // See the LICENSE file in the project root for more information.
 
 #include "allocator.h"
-#include "type_traits.h"
+#include "functional.h"
+#include "list.h"
 #include "pair.h"
+#include "type_traits.h"
 #include "utility.h"
-#include "unordered_map.h"
-#include "unordered_set.h"
+#include "vector.h"
diff --git a/src/coreclr/src/jit/jitstd/hash.h b/src/coreclr/src/jit/jitstd/hash.h
deleted file mode 100644 (file)
index 18db74f..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-
-#pragma once
-
-#include "type_traits.h"
-#include <stdio.h>
-
-namespace jitstd
-{
-template<typename Type>
-class hash
-{
-public:
-    size_t operator()(const Type& val) const
-    {
-        div_t qrem = ::div((int)(size_t) val, 127773);
-        qrem.rem = 16807 * qrem.rem - 2836 * qrem.quot;
-        if (qrem.rem < 0)
-        {
-            qrem.rem += 2147483647;
-        }
-        return ((size_t) qrem.rem);
-    }
-};
-
-template<>
-class hash<int>
-{
-public:
-    size_t operator()(const int& val) const
-    {
-        return val;
-    }
-};
-
-template<>
-class hash<unsigned __int64>
-{
-private:
-    typedef unsigned __int64 Type;
-
-public:
-    size_t operator()(const Type& val) const
-    {
-        return (hash<int>()((int)(val & 0xffffffffUL)) ^ hash<int>()((int)(val >> 32)));
-    }
-};
-
-template<>
-class hash<__int64>
-{
-private:
-    typedef __int64 Type;
-
-public:
-    size_t operator()(const Type& val) const
-    {
-        return (hash<unsigned __int64>()((unsigned __int64) val));
-    }
-};
-
-template<typename Type>
-class hash<Type*>
-{
-private:
-    typedef typename conditional<sizeof (Type*) <= sizeof (int), int, __int64>::type TInteger;
-public:
-    size_t operator()(const Type* val) const
-    {
-        return (hash<TInteger>()((TInteger) val));
-    }
-};
-
-template<>
-class hash<float>
-{
-private:
-    typedef float Type;
-public:
-    size_t operator()(const Type& val) const
-    {
-        unsigned long bits = *(unsigned long*) &val;
-        return (hash<unsigned long>()(bits == 0x80000000 ? 0 : bits));
-    }
-};
-
-template<>
-class hash<double>
-{
-public:
-    typedef double Type;
-    size_t operator()(const Type& val) const
-    {
-        unsigned __int64 bits = *(unsigned __int64*)&val;
-        return (hash<unsigned __int64>()((bits & (((unsigned __int64) -1) >> 1)) == 0 ? 0 : bits));
-    }
-};
-
-}
diff --git a/src/coreclr/src/jit/jitstd/hashtable.h b/src/coreclr/src/jit/jitstd/hashtable.h
deleted file mode 100644 (file)
index 3a6232a..0000000
+++ /dev/null
@@ -1,803 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// ==++==
-//
-
-//
-
-//
-// ==--==
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XX                                                                           XX
-XX                          hashtable<K,V,H,P,A,KO>                          XX
-XX                                                                           XX
-XX  Implemented using a vector of list iterators begin and end whose range   XX
-XX  is a single bucket. A chain of buckets is maintained in a linked list    XX
-XX  (doubly) for holding the key-value pairs.                                XX
-XX                                                                           XX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-*/
-
-#pragma once
-
-#include "hash.h"
-#include "functional.h"
-#include "allocator.h"
-#include "vector.h"
-#include "list.h"
-#include "pair.h"
-
-namespace jitstd
-{
-
-static const float kflDefaultLoadFactor = 3.0f;
-
-template <typename Key,
-          typename Value = Key,
-          typename Hash = jitstd::hash<Key>,
-          typename Pred = jitstd::equal_to<Key>,
-          typename Alloc = jitstd::allocator<Value>,
-          typename KeyOf = jitstd::identity<Value>>
-class hashtable
-{
-public:
-    typedef Key key_type;
-    typedef Value value_type;
-    typedef Hash hasher;
-    typedef Pred key_equal;
-    typedef Alloc allocator_type;
-    typedef typename allocator_type::pointer pointer;
-    typedef typename allocator_type::const_pointer const_pointer;
-    typedef typename allocator_type::reference reference;
-    typedef typename allocator_type::const_reference const_reference;
-    typedef size_t size_type;
-    typedef ptrdiff_t difference_type;
-    typedef typename list<Value, Alloc>::iterator iterator;
-    typedef typename list<Value, Alloc>::reverse_iterator reverse_iterator;
-    typedef typename list<Value, Alloc>::const_iterator const_iterator;
-    typedef typename list<Value, Alloc>::iterator local_iterator;
-
-protected:
-    hashtable();
-
-    typedef pair<iterator, iterator> BucketEntry;
-    typedef vector<BucketEntry, typename Alloc::template rebind<BucketEntry>::allocator> Buckets;
-    typedef list<Value, typename Alloc::template rebind<Value>::allocator> Elements;
-
-protected:
-    explicit hashtable(size_type,
-        const allocator_type& a,
-        const KeyOf& keyOf = KeyOf());
-
-    hashtable(size_type n,
-        const hasher& hf,
-        const key_equal& eq,
-        const allocator_type& a,
-        const KeyOf& keyOf = KeyOf());
-
-    template<typename InputIterator> 
-    hashtable(
-        InputIterator f, InputIterator l,
-        size_type n,
-        const hasher& hf,
-        const key_equal& eq, 
-        const allocator_type& a,
-        const KeyOf& keyOf = KeyOf());
-
-    explicit hashtable(const allocator_type& a, const KeyOf& keyOf = KeyOf());
-
-    hashtable(const hashtable& other);
-
-    ~hashtable();
-
-public:
-    hashtable& operator=(const hashtable& other);
-
-    allocator_type get_allocator() const;
-
-    bool empty() const;
-
-    size_type size() const;
-    size_type max_size() const;
-
-    iterator begin();
-    iterator end();
-
-    // Even though we have an unordered set and there is no concept of forward and
-    // reverse, rbegin will just return the first element inserted. This is not in STL.
-    reverse_iterator rbegin();
-    reverse_iterator rend();
-
-    const_iterator begin() const;
-    const_iterator end() const;
-    const_iterator cbegin() const;
-    const_iterator cend() const;
-    local_iterator begin(size_type size);
-    local_iterator end(size_type size);
-
-    pair<iterator, bool> insert(const value_type& value);
-    iterator insert(const_iterator, const value_type& value);
-    template<typename InputIterator>
-    void insert(InputIterator first, InputIterator last);
-
-    iterator erase(iterator position);
-    size_type erase(const key_type& key);
-    iterator erase(iterator first, iterator last);
-
-    void clear();
-    void swap(hashtable& table);
-
-    hasher hash_function() const;
-    key_equal key_eq() const;
-
-    const_iterator find(const key_type& key) const;
-    iterator find(const key_type& key);
-
-    size_type count(const key_type& key) const;
-
-    size_type bucket_count() const;
-    size_type max_bucket_count() const;
-
-    size_type bucket_size(size_type size) const;
-    size_type bucket(const key_type& key) const;
-
-    float load_factor() const;
-    float max_load_factor() const;
-    void max_load_factor(float);
-
-    void rehash(size_type);
-
-protected:
-    template <typename Compare>
-    iterator find(const key_type&, const Compare& comp);
-
-    // helpers
-    bool check_load();
-    void copy_helper(const hashtable& other);
-    size_type hash_helper(const key_type& value, size_type buckets) const;
-    pair<iterator, bool> insert_helper(const value_type& value, Buckets& buckets, Elements& elements, bool fRehashing);
-    iterator erase_helper(const_iterator position);
-    void debug_check();
-
-private:
-
-    // member objects
-    Hash m_hasher;
-    Alloc m_allocator;
-    Pred m_pred;
-
-    Buckets m_buckets;
-    Elements m_elements;
-    size_type m_nSize;
-    KeyOf m_keyOf;
-
-    // metadata
-    float m_flMaxLoadFactor;
-};
-
-} // end of namespace jitstd
-
-
-namespace jitstd
-{
-
-// We can't leave this permanently enabled -- it makes algorithms cubic, and causes tests to time out.
-// Enable when/if you have reason to believe there's a problem in hashtable.
-#define JITSTD_DO_HASHTABLE_DEBUGCHECK 0
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-void hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::debug_check()
-{
-#if JITSTD_DO_HASHTABLE_DEBUGCHECK
-    for (iterator iter = m_elements.begin(); iter != m_elements.end(); ++iter)
-    {
-        size_type nHash = hash_helper(m_keyOf(*iter), m_buckets.size());
-        BucketEntry& entry = m_buckets[nHash];
-        iterator iter2 = entry.first;
-        bool present = false;
-        while (iter2 != entry.second)
-        {
-            if (iter2 == iter)
-            {
-                present = true;
-            }
-            iter2++;
-        }
-        if (!present)
-        {
-            present = false;
-        }
-        assert(present);
-    }
-#endif
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-template <typename Compare>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::find(const key_type& key, const Compare& comp)
-{
-    if (empty())
-    {
-        return end();
-    }
-    size_type nHash = hash_helper(key, m_buckets.size());
-    BucketEntry& entry = m_buckets[nHash];
-    for (iterator i = entry.first; i != entry.second; ++i)
-    {
-        if (comp(m_keyOf(*i), key))
-        {
-            return i;
-        }
-    }
-    return end();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-bool hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::check_load()
-{
-    float flLoadFactor = load_factor();
-    if (flLoadFactor > m_flMaxLoadFactor)
-    {
-        rehash(m_buckets.size());
-        return true;
-    }
-    return false;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::erase_helper(const_iterator position)
-{
-    const Key& key = m_keyOf(*position);
-    size_type nHash = hash_helper(key, m_buckets.size());
-    BucketEntry& entry = m_buckets[nHash];
-    iterator eraseNext = end();
-    for (iterator first = entry.first; first != entry.second; ++first)
-    {
-        if (m_pred(m_keyOf(*first), key))       
-        {
-            if (first == entry.first)
-            {
-                if (first != m_elements.begin())
-                {
-                    iterator update = first;
-                    update--;
-                    size_type nUpdateHash = hash_helper(m_keyOf(*update), m_buckets.size());
-                    if (nUpdateHash != nHash)
-                    {
-                        BucketEntry& updateEntry = m_buckets[nUpdateHash];
-                        if (updateEntry.second == first)
-                        {
-                            updateEntry.second = first;
-                            updateEntry.second++;
-                        }
-                        if (updateEntry.first == first)
-                        {
-                            updateEntry.first = first;
-                            updateEntry.first++;
-                        }
-                    }
-                }
-                entry.first = m_elements.erase(first);
-                eraseNext = entry.first;
-            }
-            else
-            {
-                eraseNext = m_elements.erase(first);
-            }
-
-            --m_nSize;
-#ifdef DEBUG
-            debug_check();
-#endif
-            return eraseNext;
-        }
-    }
-    return end();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-pair<typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator, bool>
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::insert_helper(
-    const Value& value, Buckets& buckets, Elements& elements, bool fRehashing)
-{
-    const Key& key = m_keyOf(value);
-    size_t nHash = hash_helper(key, buckets.size());
-    BucketEntry& entry = buckets[nHash];
-
-    iterator ret;
-    if (entry.first == entry.second)
-    {
-        entry.first = elements.insert(elements.begin(), value);
-        entry.second = entry.first;
-        entry.second++; // end iterator is one past always.
-        ret = entry.first;
-    }
-    else
-    {
-        for (iterator first = entry.first; first != entry.second; ++first)
-        {
-            if (m_pred(m_keyOf(*first), key))
-            {
-                return pair<iterator, bool>(first, false);
-            }
-        }
-        iterator firstNext = entry.first;
-        firstNext++;
-        ret = elements.insert(firstNext, value);
-        if (entry.second == entry.first)
-        {
-            entry.second = firstNext;
-        }
-    }
-    bool fRehashed = false;
-    if (!fRehashing)
-    {
-        m_nSize += 1;
-        fRehashed = check_load();
-    }
-
-#ifdef DEBUG
-    debug_check();
-#endif
-
-    return pair<iterator, bool>(fRehashed ? find(key, m_pred) : ret, true);
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::hash_helper(
-    const key_type& key, size_type buckets) const
-{
-    return m_hasher(key) % buckets;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-void hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::rehash(size_type n)
-{
-    size_type nCurBuckets = m_buckets.size();
-    float flLoadFactor = load_factor();
-    if (nCurBuckets >= n && flLoadFactor <= m_flMaxLoadFactor)
-    {
-        return;
-    }
-
-    size_type nBuckets = max(nCurBuckets, 1);
-    if (flLoadFactor > m_flMaxLoadFactor)
-    {
-        nBuckets *= 2;
-    }
-
-    if (nBuckets < n)
-    {
-        nBuckets = n;
-    }
-
-    Buckets buckets(m_allocator);
-    Elements elements(m_allocator);
-
-    buckets.resize(nBuckets, BucketEntry(m_elements.end(), m_elements.end())); // both equal means empty.
-    for (typename Elements::iterator iter = m_elements.begin(); iter != m_elements.end(); ++iter)
-    {
-        (void) insert_helper(*iter, buckets, elements, true);
-    }
-    m_buckets.swap(buckets);
-    m_elements.swap(elements);
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::hashtable(
-    size_type n,
-    allocator_type const& allocator,
-    const KeyOf& keyOf)
-    : m_allocator(allocator)
-    , m_buckets(Alloc::template rebind<hashtable::BucketEntry>::allocator(allocator))
-    , m_elements(allocator)
-    , m_flMaxLoadFactor(kflDefaultLoadFactor)
-    , m_nSize(0)
-    , m_keyOf(keyOf)
-{
-    rehash(n);
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::hashtable(
-    size_type n,
-    hasher const& hf,
-    key_equal const& eq,
-    allocator_type const& allocator,
-    const KeyOf& keyOf)
-    : m_hasher(hf)
-    , m_pred(eq)
-    , m_allocator(allocator)
-    , m_buckets(Alloc::template rebind<BucketEntry>::allocator(allocator))
-    , m_elements(allocator)
-    , m_flMaxLoadFactor(kflDefaultLoadFactor)
-    , m_nSize(0)
-    , m_keyOf(keyOf)
-{
-    rehash(n);
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-template<typename InputIterator>
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::hashtable(
-    InputIterator f, InputIterator l,
-    size_type n,
-    const hasher& hf,
-    const key_equal& eq, 
-    const allocator_type& allocator,
-    const KeyOf& keyOf)
-    : m_hasher(hf)
-    , m_pred(eq)
-    , m_allocator(allocator)
-    , m_buckets(Alloc::template rebind<BucketEntry>::allocator(allocator))
-    , m_elements(allocator)
-    , m_flMaxLoadFactor(kflDefaultLoadFactor)
-    , m_nSize(0)
-    , m_keyOf(keyOf)
-{
-    rehash(n);
-    insert(this->first, this->last);
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::hashtable(const allocator_type& allocator, const KeyOf& keyOf)
-    : m_allocator(allocator)
-    , m_buckets(Alloc::template rebind<BucketEntry>::allocator(allocator))
-    , m_elements(allocator)
-    , m_flMaxLoadFactor(kflDefaultLoadFactor)
-    , m_nSize(0)
-    , m_keyOf(keyOf)
-{
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-void hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::copy_helper(const hashtable& other)
-{
-    m_buckets.clear();
-    m_elements.clear();
-    m_nSize = 0;
-
-    rehash(other.m_buckets.size());
-    for (const_iterator i = other.m_elements.begin(); i != other.m_elements.end(); ++i)
-    {
-        insert_helper(*i, m_buckets, m_elements, false);
-    }
-    m_nSize = other.m_nSize;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::hashtable(const hashtable& other)
-    : m_hasher(other.m_hasher)
-    , m_pred(other.m_pred)
-    , m_allocator(other.m_allocator)
-    , m_flMaxLoadFactor(other.m_flMaxLoadFactor)
-    , m_keyOf(other.m_keyOf)
-    , m_elements(other.m_allocator)
-    , m_buckets(other.m_allocator)
-{
-    copy_helper(other);
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::~hashtable()
-{
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>&
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::operator=(hashtable const& other)
-{
-    m_hasher = other.m_hasher;
-    m_pred = other.m_pred;
-    m_allocator = other.m_allocator;
-    m_flMaxLoadFactor = other.m_flMaxLoadFactor;
-    m_keyOf = other.m_keyOf;
-    copy_helper(other);
-    return *this;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::allocator_type
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::get_allocator() const
-{
-    return m_allocator;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-bool hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::empty() const
-{
-    return m_nSize == 0;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size() const
-{
-    return m_nSize;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::max_size() const
-{
-    return ((size_type)(-1)) >> 1;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::begin()
-{
-    return m_elements.begin();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::reverse_iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::rbegin()
-{
-    return m_elements.rbegin();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::end()
-{
-    return m_elements.end();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::reverse_iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::rend()
-{
-    return m_elements.rend();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::const_iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::begin() const
-{
-    return m_elements.begin();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::const_iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::end() const
-{
-    return m_elements.end();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::const_iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::cbegin() const
-{
-    return m_elements.begin();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::const_iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::cend() const
-{
-    return m_elements.end();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-jitstd::pair<typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator, bool>
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::insert(const Value& val)
-{
-    // Allocate some space first.
-    rehash(2);
-    return insert_helper(val, m_buckets, m_elements, false);
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::insert(const_iterator position, const Value& value)
-{
-    // Allocate some space first.
-    rehash(2);
-
-    // We will not use the hint here, we can consider doing this later.
-    return insert_helper(this->val, m_buckets, m_elements, false).first;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-template<typename InputIterator>
-void hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::insert(InputIterator first, InputIterator last)
-{
-    // Allocate some space first.
-    rehash(2);
-    while (first != last)
-    {
-        (void) insert_helper(*first, m_buckets, m_elements, false);
-        ++first;
-    }
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::erase(iterator position)
-{
-    return erase_helper(position);
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::erase(const key_type& key)
-{
-    iterator iter = erase_helper(find(key));
-    return iter == end() ? 0 : 1;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::erase(iterator first, iterator last)
-{
-    iterator iter = end();
-    while (first != last)
-    {
-        iter = erase_helper(find(m_keyOf(*first)));
-        ++first;
-    }
-    return iter;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-void hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::clear()
-{
-    m_buckets.clear();
-    m_elements.clear();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-void hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::swap(hashtable& set)
-{
-    std::swap(set.m_buckets, m_buckets);
-    std::swap(set.m_elements, m_elements);
-    std::swap(set.m_flLoadFactor, this->m_flLoadFactor);
-    std::swap(set.m_flMaxLoadFactor, this->m_flMaxLoadFactor);
-    std::swap(set.m_keyOf, this->m_keyOf);
-}
-
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::hasher
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::hash_function() const
-{
-    return m_hasher;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::key_equal
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::key_eq() const
-{
-    return m_pred;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::const_iterator
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::find(const key_type& key) const
-{
-    if (empty())
-    {
-        return end();
-    }
-    size_type nHash = hash_helper(key, m_buckets.size());
-    BucketEntry& entry = m_buckets[nHash];
-    for (iterator i = entry.first; i != entry.second; ++i)
-    {
-        if (m_pred(m_keyOf(*i), key))
-        {
-            return i;
-        }
-    }
-    return end();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::iterator
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::find(const key_type& key)
-{
-    if (empty())
-    {
-        return end();
-    }
-    size_type nHash = hash_helper(key, m_buckets.size());
-    BucketEntry& entry = m_buckets[nHash];
-    for (iterator i = entry.first; i != entry.second; ++i)
-    {
-        if (m_pred(m_keyOf(*i), key))
-        {
-            return i;
-        }
-    }
-    return end();
-}
-
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-    hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::count(const key_type& key) const
-{
-    size_type nCount = 0;
-    size_type nHash = hash_helper(key, m_buckets.size());
-    BucketEntry& bucket = m_buckets[nHash];
-    for (iterator i = bucket.first; i != bucket.second; ++i)
-    {
-        if (m_pred(m_keyOf(*i), key))
-        {
-            ++nCount;
-        }
-    }
-    return nCount;  
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::bucket_count() const
-{   
-    return m_buckets.size();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::max_bucket_count() const
-{
-    return m_buckets.size();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::bucket_size(size_type size) const
-{
-    rehash(size);
-    return bucket_count();
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::size_type
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::bucket(const key_type& key) const
-{
-    return hash_helper(key, m_buckets.size());
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::local_iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::begin(size_type size)
-{
-    return m_buckets[size].first;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-typename hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::local_iterator
-hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::end(size_type size)
-{
-    return m_buckets[size].second;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-float hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::load_factor() const
-{
-    return m_nSize ? (((float) m_nSize) /  m_buckets.size()) : 0;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-float hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::max_load_factor() const
-{
-    return m_flMaxLoadFactor;
-}
-
-template <typename Key, typename Value, typename Hash, typename Pred, typename Alloc, typename KeyOf>
-void hashtable<Key, Value, Hash, Pred, Alloc, KeyOf>::max_load_factor(float flLoadFactor)
-{
-    m_flMaxLoadFactor = flLoadFactor;
-    rehash(m_buckets.size());
-}
-
-} // end of namespace jitstd.
diff --git a/src/coreclr/src/jit/jitstd/jitstd.cpp b/src/coreclr/src/jit/jitstd/jitstd.cpp
deleted file mode 100644 (file)
index 48d80e2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// jitstd.cpp : Defines the entry point for the console application.
-//
-
-
-#include "stdafx.h"
-
-#include <iostream>
-#include <windows.h>
-#include <string>
-
-#include "iallocator.h"
-
-#include "algorithm.h"
-#include "functional.h"
-#include "hash.h"
-
-#include "unordered_map.h"
-#include "unordered_set.h"
-#include "hashtable.h"
-#include "list.h"
-#include "vector.h"
-#include "pair.h"
-
-int _tmain(int argc, _TCHAR* argv[])
-{
-    // return test1();
-    return 0;
-}
-
-
diff --git a/src/coreclr/src/jit/jitstd/jitstd.sln b/src/coreclr/src/jit/jitstd/jitstd.sln
deleted file mode 100644 (file)
index 6aa099c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jitstd", "jitstd.vcxproj", "{A4576E91-78F0-4FD1-8323-8FA3BACE0581}"
-EndProject
-Global
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Win32 = Debug|Win32
-               Release|Win32 = Release|Win32
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {A4576E91-78F0-4FD1-8323-8FA3BACE0581}.Debug|Win32.ActiveCfg = Debug|Win32
-               {A4576E91-78F0-4FD1-8323-8FA3BACE0581}.Debug|Win32.Build.0 = Debug|Win32
-               {A4576E91-78F0-4FD1-8323-8FA3BACE0581}.Release|Win32.ActiveCfg = Release|Win32
-               {A4576E91-78F0-4FD1-8323-8FA3BACE0581}.Release|Win32.Build.0 = Release|Win32
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
diff --git a/src/coreclr/src/jit/jitstd/jitstd.vcxproj b/src/coreclr/src/jit/jitstd/jitstd.vcxproj
deleted file mode 100644 (file)
index bed1b3a..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{A4576E91-78F0-4FD1-8323-8FA3BACE0581}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>jitstd</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="algorithm.h" />
-    <ClInclude Include="allocator.h" />
-    <ClInclude Include="functional.h" />
-    <ClInclude Include="hash.h" />
-    <ClInclude Include="hashtable.h" />
-    <ClInclude Include="iterator.h" />
-    <ClInclude Include="list.h" />
-    <ClInclude Include="pair.h" />
-    <ClInclude Include="stdafx.h" />
-    <ClInclude Include="targetver.h" />
-    <ClInclude Include="type_traits.h" />
-    <ClInclude Include="unordered_map.h" />
-    <ClInclude Include="unordered_set.h" />
-    <ClInclude Include="vector.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="jitstd.cpp" />
-    <ClCompile Include="stdafx.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-    </ClCompile>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file
index ed55888..265af70 100644 (file)
@@ -23,6 +23,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
 #include "iterator.h"
 #include "functional.h"
+#include "utility.h"
 
 namespace jitstd
 {
diff --git a/src/coreclr/src/jit/jitstd/stdafx.cpp b/src/coreclr/src/jit/jitstd/stdafx.cpp
deleted file mode 100644 (file)
index 1012ef9..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// stdafx.cpp : source file that includes just the standard includes
-// jitstd.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
diff --git a/src/coreclr/src/jit/jitstd/stdafx.h b/src/coreclr/src/jit/jitstd/stdafx.h
deleted file mode 100644 (file)
index 6d2519d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-
-#pragma once
-
-#include "targetver.h"
-
-#include <stdio.h>
-#include <tchar.h>
-
-
-
-// TODO: reference additional headers your program requires here
diff --git a/src/coreclr/src/jit/jitstd/targetver.h b/src/coreclr/src/jit/jitstd/targetver.h
deleted file mode 100644 (file)
index 260ee4a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <sdkddkver.h>
diff --git a/src/coreclr/src/jit/jitstd/unordered_map.h b/src/coreclr/src/jit/jitstd/unordered_map.h
deleted file mode 100644 (file)
index ff1ad87..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// ==++==
-//
-
-//
-
-//
-// ==--==
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XX                                                                           XX
-XX                          unordered_map<K,V,H,P,A>                         XX
-XX  Derives from hashtable for most implementation. Inserted elements are    XX
-XX  value pairs and the hash key is provided by the helper method that       XX
-XX  extracts the key from the key value pair                                 XX
-XX                                                                           XX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-*/
-
-#pragma once
-
-#include "hashtable.h"
-
-namespace jitstd
-{
-
-template <typename Key, typename Value>
-struct pair_key
-{
-    Key& operator()(const jitstd::pair<Key, Value>& pair) const
-    {
-        return pair.first;
-    }
-};
-
-template<typename Key,
-         typename Value,
-         typename Hash = jitstd::hash<Key>,
-         typename Pred = jitstd::equal_to<Key>,
-         typename Alloc = jitstd::allocator<jitstd::pair<const Key, Value> > >
-class unordered_map
-    : public hashtable<Key, pair<const Key, Value>, Hash, Pred, Alloc, pair_key<const Key, Value>>
-{
-public:
-
-    typedef Key key_type;
-    typedef Value mapped_type;
-    typedef jitstd::pair<const Key, Value> value_type;
-    typedef Hash hasher;
-    typedef Pred key_equal;
-    typedef Alloc allocator_type;
-    typedef typename allocator_type::pointer pointer;             
-    typedef typename allocator_type::const_pointer const_pointer;       
-    typedef typename allocator_type::reference reference;
-    typedef typename allocator_type::const_reference const_reference;
-    typedef size_t size_type;
-    typedef ptrdiff_t difference_type;
-
-    explicit unordered_map(size_type size, const hasher& hasher, const key_equal& pred, const allocator_type& allocator);
-    explicit unordered_map(size_type size, const allocator_type& allocator);
-    template<typename InputIterator> 
-    unordered_map(InputIterator, InputIterator, 
-                  size_type size, 
-                  const hasher& hasher,
-                  const key_equal& pred, 
-                  const allocator_type& allocator);
-
-    unordered_map(const unordered_map& map);
-    explicit unordered_map(const allocator_type& allocator);
-    unordered_map(const unordered_map& map, const allocator_type& allocator);
-    ~unordered_map();
-
-    unordered_map& operator=(unordered_map const&);
-    mapped_type& operator[](const Key& key);
-    mapped_type& operator[](key_type&& key);
-
-    typename unordered_map<Key, Value, Hash, Pred, Alloc>::iterator insert(const key_type& key, const mapped_type& value);
-
-private:
-    typedef hashtable<Key, pair<const Key, Value>, Hash, Pred, Alloc, pair_key<const Key, Value>> base_type;
-};
-
-}
-
-
-namespace jitstd
-{
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_map<Key, Value, Hash, Pred, Alloc>::unordered_map(size_type size, const hasher& hasher, const key_equal& pred, const allocator_type& allocator)
-    : base_type(size, hasher, pred, allocator)
-{
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_map<Key, Value, Hash, Pred, Alloc>::unordered_map(size_type size, const allocator_type& allocator)
-    : base_type(size, allocator)
-{
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-template<typename InputIterator> 
-unordered_map<Key, Value, Hash, Pred, Alloc>::unordered_map(InputIterator first, InputIterator last, 
-                size_type size, 
-                const hasher& hasher,
-                const key_equal& pred, 
-                const allocator_type& allocator)
-    : base_type(first, last, size, hasher, pred, allocator)
-{
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_map<Key, Value, Hash, Pred, Alloc>::unordered_map(const unordered_map& map)
-    : base_type(map)
-{
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_map<Key, Value, Hash, Pred, Alloc>::unordered_map(const allocator_type& allocator)
-    : base_type(allocator)
-{
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_map<Key, Value, Hash, Pred, Alloc>::unordered_map(const unordered_map& map, const allocator_type& allocator)
-    : base_type(map, allocator)
-{
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_map<Key, Value, Hash, Pred, Alloc>::~unordered_map()
-{
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_map<Key, Value, Hash, Pred, Alloc>& unordered_map<Key, Value, Hash, Pred, Alloc>::operator=(const unordered_map& map)
-{
-    base_type::operator=(map);
-    return *this;
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-Value& unordered_map<Key, Value, Hash, Pred, Alloc>::operator[](const Key& key)
-{
-    typename unordered_map<Key, Value, Hash, Pred, Alloc>::iterator iter = base_type::find(key, this->key_eq());
-    if (iter == this->end())
-    {
-        iter = base_type::insert(jitstd::pair<const Key, mapped_type>(key, mapped_type())).first;
-    }
-    return (*iter).second;
-}
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-Value& unordered_map<Key, Value, Hash, Pred, Alloc>::operator[](key_type&& key)
-{
-    typename unordered_map<Key, Value, Hash, Pred, Alloc>::iterator iter = base_type::find(key, this->key_eq());
-    if (iter == this->end())
-    {
-        iter = base_type::insert(jitstd::pair<const Key, mapped_type>(key, mapped_type())).first;
-    }
-    return (*iter).second;
-}
-
-
-template<typename Key, typename Value, typename Hash, typename Pred, typename Alloc>
-typename unordered_map<Key, Value, Hash, Pred, Alloc>::iterator
-unordered_map<Key, Value, Hash, Pred, Alloc>::insert(const key_type& key, const mapped_type& value)
-{
-    typename unordered_map<Key, Value, Hash, Pred, Alloc>::iterator iter = base_type::find(key, this->key_eq());
-    iter = base_type::insert(jitstd::pair<const Key, mapped_type>(key, value)).first;
-    return iter;
-}
-
-}
diff --git a/src/coreclr/src/jit/jitstd/unordered_set.h b/src/coreclr/src/jit/jitstd/unordered_set.h
deleted file mode 100644 (file)
index 388e724..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// ==++==
-//
-
-//
-
-//
-// ==--==
-
-/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XX                                                                           XX
-XX                          unordered_set<V,H,P,A>                           XX
-XX                                                                           XX
-XX  Derives from hashtable for most implementation. The hash key is the      XX
-XX  elements themselves                                                      XX
-XX                                                                           XX
-XX                                                                           XX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-*/
-
-#pragma once
-
-#include "allocator.h"
-#include "hashtable.h"
-
-namespace jitstd
-{
-
-template <typename Value,
-          typename Hash = jitstd::hash<Value>,
-          typename Pred = jitstd::equal_to<Value>,
-          typename Alloc = jitstd::allocator<Value>>
-class unordered_set
-    : public hashtable<Value, Value, Hash, Pred, Alloc>
-{
-public:
-    typedef Value key_type;
-    typedef Value value_type;
-    typedef Hash hasher;
-    typedef Pred key_equal;
-    typedef Alloc allocator_type;
-    typedef typename allocator_type::pointer pointer;             
-    typedef typename allocator_type::const_pointer const_pointer;       
-    typedef typename allocator_type::reference reference;
-    typedef typename allocator_type::const_reference const_reference;
-    typedef size_t size_type;
-    typedef ptrdiff_t difference_type;
-    typedef typename list<Value, Alloc>::iterator iterator;
-    typedef typename list<Value, Alloc>::const_iterator const_iterator;
-    typedef typename list<Value, Alloc>::iterator local_iterator;
-
-private:
-    typedef hashtable<Value, Value, Hash, Pred, Alloc> base_type;
-    unordered_set();
-
-    typedef pair<iterator, iterator> BucketEntry;
-    typedef vector<BucketEntry, typename Alloc::template rebind<BucketEntry>::allocator> Buckets;
-    typedef list<Value, Alloc> Elements;
-
-public:
-    explicit unordered_set(size_type,
-        const allocator_type& a);
-
-    unordered_set(size_type n,
-        const hasher& hf,
-        const key_equal& eq, 
-        const allocator_type&);
-
-    template<typename InputIterator> 
-    unordered_set(
-        InputIterator f, InputIterator l,
-        size_type n,
-        const hasher& hf,
-        const key_equal& eq, 
-        const allocator_type&);
-
-    explicit unordered_set(const allocator_type&);
-
-    unordered_set(const unordered_set& other);
-
-    ~unordered_set();
-
-    unordered_set& operator=(unordered_set const&);
-};
-
-} // end of namespace jitstd
-
-
-namespace jitstd
-{
-
-template <typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_set<Value, Hash, Pred, Alloc>::unordered_set(
-    size_type n,
-    allocator_type const& allocator)
-    : hashtable<Value>(n, allocator)
-{
-    this->rehash(n);
-}
-
-template <typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_set<Value, Hash, Pred, Alloc>::unordered_set(
-    size_type n,
-    hasher const& hf,
-    key_equal const& eq,
-    allocator_type const& allocator)
-    : hashtable<Value>(n, hf, eq, allocator)
-{
-    this->rehash(n);
-}
-
-template <typename Value, typename Hash, typename Pred, typename Alloc>
-template<typename InputIterator>
-unordered_set<Value, Hash, Pred, Alloc>::unordered_set(
-    InputIterator f, InputIterator l,
-    size_type n,
-    const hasher& hf,
-    const key_equal& eq, 
-    const allocator_type& allocator)
-    : hashtable<Value>(f, l, n, hf, eq, allocator)
-{
-    this->rehash(n);
-    insert(this->first, this->last);
-}
-
-template <typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_set<Value, Hash, Pred, Alloc>::unordered_set(const allocator_type& allocator)
-: hashtable<Value>(allocator)
-{
-}
-
-template <typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_set<Value, Hash, Pred, Alloc>::unordered_set(const unordered_set& other)
-: hashtable<Value>(other)
-{
-}
-
-template <typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_set<Value, Hash, Pred, Alloc>::~unordered_set()
-{
-}
-
-template <typename Value, typename Hash, typename Pred, typename Alloc>
-unordered_set<Value, Hash, Pred, Alloc>&
-    unordered_set<Value, Hash, Pred, Alloc>::operator=(unordered_set const& other)
-{
-    base_type::operator=(other);
-    return *this;
-}
-
-} // end of namespace jitstd.
index 1930be8..426059f 100644 (file)
@@ -6,6 +6,9 @@
 
 #pragma once
 
+#include "pair.h"
+#include "type_traits.h"
+
 namespace jitstd
 {