Commit af01a064 by Yuly Novikov Committed by Commit Bot

Revert "Adds TUnorderedMap and uses it for tLevel in TSymbolTableLevel."

This reverts commit c14348a2. Reason for revert: crashes in murmurhash on Nexus 6 See https://build.chromium.org/p/chromium.gpu.fyi/builders/Android%20Release%20%28Nexus%206%29/builds/7865 Original change's description: > Adds TUnorderedMap and uses it for tLevel in TSymbolTableLevel. > > Change-Id: I27ba7a41c599ef6f7fe68b22c27bd2a40175ddf9 > Reviewed-on: https://chromium-review.googlesource.com/526672 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=jmadill@chromium.org,kbr@chromium.org,bajones@chromium.org,kainino@chromium.org,lethalantidote@chromium.org Change-Id: Id4a428430c6d286b910790ba7c30503c98ce728f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/551235Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 1d72298b
......@@ -7,17 +7,15 @@
#ifndef COMPILER_TRANSLATOR_COMMON_H_
#define COMPILER_TRANSLATOR_COMMON_H_
#include <stdio.h>
#include <limits>
#include <map>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
#include <limits>
#include <stdio.h>
#include "common/angleutils.h"
#include "common/debug.h"
#include "common/third_party/murmurhash/MurmurHash3.h"
#include "compiler/translator/PoolAlloc.h"
namespace sh
......@@ -78,23 +76,6 @@ class TVector : public std::vector<T, pool_allocator<T>>
TVector(size_type i) : std::vector<T, pool_allocator<T>>(i) {}
};
template <class K, class D, class H = std::hash<K>, class CMP = std::equal_to<K>>
class TUnorderedMap : public std::unordered_map<K, D, H, CMP, pool_allocator<std::pair<const K, D>>>
{
public:
POOL_ALLOCATOR_NEW_DELETE();
typedef pool_allocator<std::pair<const K, D>> tAllocator;
TUnorderedMap() : std::unordered_map<K, D, H, CMP, tAllocator>() {}
// use correct two-stage name lookup supported in gcc 3.4 and above
TUnorderedMap(const tAllocator &a)
: std::unordered_map<K, D, H, CMP, tAllocator>(
std::unordered_map<K, D, H, CMP, tAllocator>::key_compare(),
a)
{
}
};
template <class K, class D, class CMP = std::less<K>>
class TMap : public std::map<K, D, CMP, pool_allocator<std::pair<const K, D>>>
{
......@@ -123,18 +104,4 @@ inline TString str(T i)
} // namespace sh
namespace std
{
template <>
struct hash<sh::TString>
{
size_t operator()(const sh::TString &s) const
{
uint32_t result = 0;
MurmurHash3_x86_32(s.data(), static_cast<int>(s.length()), 0, &result);
return result;
}
};
} // namespace std
#endif // COMPILER_TRANSLATOR_COMMON_H_
......@@ -232,7 +232,7 @@ class TInterfaceBlockName : public TSymbol
class TSymbolTableLevel
{
public:
typedef TUnorderedMap<TString, TSymbol *> tLevel;
typedef TMap<TString, TSymbol *> tLevel;
typedef tLevel::const_iterator const_iterator;
typedef const tLevel::value_type tLevelPair;
typedef std::pair<tLevel::iterator, bool> tInsertResult;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment