Skip to content

Commit

Permalink
Most things are not in tr1 anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiggar committed Oct 23, 2016
1 parent df0018f commit 1d0dbdc
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 231 deletions.
6 changes: 3 additions & 3 deletions src/lib/Map.h
Expand Up @@ -18,11 +18,11 @@ using boost::tie;
template <
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
typename _Alloc = phc_allocator<std::pair<const _Key, _Tp> >
>
class phc_unordered_map : virtual public GC_obj, public unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
class phc_unordered_map : virtual public GC_obj, public std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>
{
public:
int reference_count;
Expand All @@ -45,7 +45,7 @@ void print_cow_memory_stats ();
template <
typename _Key,
typename _Tp,
typename _Hash = hash<_Key>,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
typename _Alloc = phc_allocator<std::pair<const _Key, _Tp> >
>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Set.h
Expand Up @@ -17,11 +17,11 @@

template <
typename _Tp,
typename _Hash = hash<_Tp>,
typename _Hash = std::hash<_Tp>,
typename _Pred = std::equal_to<_Tp>,
typename _Alloc = phc_allocator<_Tp>
>
class phc_unordered_set : virtual public GC_obj, public unordered_set<_Tp, _Hash, _Pred, _Alloc>
class phc_unordered_set : virtual public GC_obj, public std::unordered_set<_Tp, _Hash, _Pred, _Alloc>
{
public:
int reference_count;
Expand All @@ -41,7 +41,7 @@ extern long long __set_private_copy_construct_count;

template <
typename _Tp,
typename _Hash = hash<_Tp>,
typename _Hash = std::hash<_Tp>,
typename _Pred = std::equal_to<_Tp>,
typename _Alloc = phc_allocator<_Tp>
>
Expand Down
2 changes: 1 addition & 1 deletion src/optimize/Alias_name.cpp
Expand Up @@ -38,6 +38,6 @@ Alias_name::operator!= (const Alias_name& other) const
size_t
Alias_name::hash () const
{
return std::tr1::hash<string>() (this->str ());
return std::hash<string>() (this->str ());
}

73 changes: 35 additions & 38 deletions src/optimize/Alias_name.h
Expand Up @@ -86,44 +86,41 @@ namespace std



namespace tr1
{
template <>
struct hash<Alias_name>
{
size_t operator() (const Alias_name& an) const
{
return an.hash ();
}
};

template <>
struct hash<const Alias_name>
{
size_t operator() (const Alias_name& an) const
{
return an.hash ();
}
};

template <>
struct hash<Alias_name*>
{
size_t operator() (const Alias_name*& an) const
{
return an->hash ();
}
};

template <>
struct hash<const Alias_name*>
{
size_t operator() (const Alias_name* const an) const
{
return an->hash ();
}
};
}
template <>
struct hash<Alias_name>
{
size_t operator() (const Alias_name& an) const
{
return an.hash ();
}
};

template <>
struct hash<const Alias_name>
{
size_t operator() (const Alias_name& an) const
{
return an.hash ();
}
};

template <>
struct hash<Alias_name*>
{
size_t operator() (const Alias_name*& an) const
{
return an->hash ();
}
};

template <>
struct hash<const Alias_name*>
{
size_t operator() (const Alias_name* const an) const
{
return an->hash ();
}
};
}

#endif // PHC_ALIAS_NAME
2 changes: 1 addition & 1 deletion src/optimize/ssa/SSA_name.cpp
Expand Up @@ -38,7 +38,7 @@ SSA_name::operator!= (const SSA_name& other) const
size_t
SSA_name::hash () const
{
return std::tr1::hash<string>() (this->str ());
return std::hash<string>() (this->str ());
}

string
Expand Down
77 changes: 36 additions & 41 deletions src/optimize/ssa/SSA_name.h
Expand Up @@ -25,7 +25,7 @@ class SSA_name : virtual public GC_obj

bool operator== (const SSA_name& other) const;
bool operator!= (const SSA_name& other) const;
size_t hash () const;
size_t hash () const;

public:
// I'm not 100% sure what this is used for...
Expand Down Expand Up @@ -62,46 +62,41 @@ namespace std
}
};



namespace tr1
{
template <>
struct hash<SSA_name>
{
size_t operator() (const SSA_name& sn) const
{
return sn.hash ();
}
};

template <>
struct hash<const SSA_name>
{
size_t operator() (const SSA_name& sn) const
{
return sn.hash ();
}
};

template <>
struct hash<SSA_name*>
{
size_t operator() (const SSA_name*& sn) const
{
return sn->hash ();
}
};

template <>
struct hash<const SSA_name*>
{
size_t operator() (const SSA_name* const sn) const
{
return sn->hash ();
}
};
}
template <>
struct hash<SSA_name>
{
size_t operator() (const SSA_name& sn) const
{
return sn.hash ();
}
};

template <>
struct hash<const SSA_name>
{
size_t operator() (const SSA_name& sn) const
{
return sn.hash ();
}
};

template <>
struct hash<SSA_name*>
{
size_t operator() (const SSA_name*& sn) const
{
return sn->hash ();
}
};

template <>
struct hash<const SSA_name*>
{
size_t operator() (const SSA_name* const sn) const
{
return sn->hash ();
}
};
}


Expand Down
2 changes: 1 addition & 1 deletion src/optimize/wpa/Context.h
Expand Up @@ -82,7 +82,7 @@ class CX_map_hash : virtual public GC_obj
public:
size_t operator() (Context* cx1) const
{
return std::tr1::hash<string>() (cx1->name ());
return std::hash<string>() (cx1->name ());
}
};

Expand Down
37 changes: 17 additions & 20 deletions src/optimize/wpa/Def_use.h
Expand Up @@ -24,26 +24,23 @@ typedef enum _deftype deftype;
// For hashmaps
namespace std
{
namespace tr1
{
template <>
struct hash<reftype>
{
size_t operator() (reftype t) const
{
return hash<int>() ((int)(t));
}
};

template <>
struct hash<deftype>
{
size_t operator() (deftype t) const
{
return hash<int>() ((int)(t));
}
};
}
template <>
struct hash<reftype>
{
size_t operator() (reftype t) const
{
return hash<int>() ((int)(t));
}
};

template <>
struct hash<deftype>
{
size_t operator() (deftype t) const
{
return hash<int>() ((int)(t));
}
};
}

class Def_use : public WPA
Expand Down

0 comments on commit 1d0dbdc

Please sign in to comment.