Files
archived-llvm-mirror/include/llvm/Support
JF Bastien fd71b93500 is_integral_or_enum ❥ enum class ⇒ hashable enum class
Summary:
As discussed in D18775 making AtomicOrdering an enum class makes it non-hashable, which shouldn't be the case. Hashing.h defines hash_value for all is_integral_or_enum, but type_traits.h's definition of is_integral_or_enum only checks for *inplicit* conversion to integral types which leaves enum classes out and is very confusing because is_enum is true for enum classes.

This patch:
  - Adds a check for is_enum when determining is_integral_or_enum.
  - Explicitly converts the value parameter in hash_value to handle enum class hashing.

Note that the warning at the top of Hashing.h still applies: each execution of the program has a high probability of producing a different hash_code for a given input. Thus their values are not stable to save or persist, and should only be used during the execution for the construction of hashing datastructures.

Reviewers: dberlin, chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18938

llvm-svn: 265879
2016-04-09 20:04:34 +00:00
..
2016-02-15 04:30:37 +00:00
2016-04-02 03:28:26 +00:00
2015-11-17 19:00:52 +00:00
2016-02-01 10:39:24 +00:00
2016-03-11 20:20:25 +00:00
2016-01-22 19:58:18 +00:00
2016-04-01 00:18:08 +00:00
2016-02-26 17:01:45 +00:00
2010-11-29 18:16:10 +00:00
2016-01-18 21:01:50 +00:00
2016-02-09 13:28:44 +00:00
2015-08-08 18:27:36 +00:00
2016-04-01 04:30:16 +00:00
2015-08-10 04:22:09 +00:00
2013-05-21 20:36:13 +00:00
2015-08-10 04:22:09 +00:00
2015-08-10 04:22:09 +00:00