1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
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
..
ELFRelocs [ELF] Update x86_64 relocations to 0.99.8 ABI 2016-03-20 09:45:08 +00:00
AlignOf.h Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes. 2016-01-26 18:48:36 +00:00
Allocator.h BumpPtrAllocator::Reset should also poison the first slab which doesn't get deallocated. 2016-01-11 21:28:03 +00:00
ARMBuildAttributes.h [ARM] Add DSP build attribute and extension targeting 2016-01-25 11:26:11 +00:00
ARMEHABI.h
ARMTargetParser.def [ARM] Add Cortex-A32 support 2016-03-21 17:29:01 +00:00
ARMWinEH.h
ArrayRecycler.h
Atomic.h
BlockFrequency.h
BranchProbability.h Minor code cleanups. NFC. 2016-02-15 04:30:37 +00:00
CachePruning.h Add Cache Pruning support 2016-04-02 03:28:26 +00:00
Capacity.h
Casting.h
CBindingWrapping.h Reorganize the C API headers to improve build times. 2015-12-18 01:46:52 +00:00
circular_raw_ostream.h
CodeGen.h Support: Fix incremental build when re-configuring targets 2016-02-13 22:58:43 +00:00
CodeGenCWrappers.h Support: Fix incremental build when re-configuring targets 2016-02-13 22:58:43 +00:00
COFF.h Reland "[CodeView] Use assembler directives for line tables" 2016-01-29 00:49:42 +00:00
COM.h
CommandLine.h
Compiler.h Add an LLVM_BUILTIN_DEBUGTRAP macro. 2016-03-10 05:15:03 +00:00
Compression.h
ConvertUTF.h More UTF string conversion wrappers 2016-03-11 15:59:32 +00:00
CrashRecoveryContext.h Remove useless and unused CrashRecoveryContext::getBacktrace(). This function always returned an empty string. 2016-03-25 20:30:10 +00:00
DataExtractor.h
DataStream.h
DataTypes.h.cmake Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
Debug.h
DOTGraphTraits.h
Dwarf.def DWARF RenderScript vendor extension 2016-02-01 10:39:24 +00:00
Dwarf.h Add support for the .debug_macro section of the forthcoming DWARF 5 spec. 2015-12-15 21:50:27 +00:00
DynamicLibrary.h
ELF.h Define NT_GNU_BUILD_ID constant. 2016-03-11 20:20:25 +00:00
Endian.h [readobj] Expand CodeView dumping functionality 2016-01-13 19:32:35 +00:00
EndianStream.h Typo fix and simplification. 2016-01-22 19:58:18 +00:00
Errc.h
Errno.h
Error.h [Support] Add a checked flag to Expected<T>, require checks before access or 2016-04-05 19:57:03 +00:00
ErrorHandling.h
ErrorOr.h Use std::forward to make ErrorOr<T> constructible from a value that has a user-defined conversion to T. No functionality change intended. 2016-02-09 04:47:58 +00:00
FileOutputBuffer.h
FileSystem.h Add disk_space() to llvm::fs 2016-04-01 00:18:08 +00:00
FileUtilities.h
Format.h [Support] Fix the examples and assertion for format_hex_no_prefix to take into account that there are no prefix characters to include in Width. 2016-02-08 01:02:55 +00:00
FormattedStream.h
GCOV.h
GenericDomTree.h [DominatorTree] Remove unnecessary map population. NFC. 2016-01-07 19:21:29 +00:00
GenericDomTreeConstruction.h
GraphWriter.h
Host.h [CMAKE] Update build on recent Haiku 2016-02-26 17:01:45 +00:00
JamCRC.h
LEB128.h
LICENSE.TXT
LineIterator.h
Locale.h
LockFileManager.h
MachO.h
ManagedStatic.h Support: Give ManagedStatic's helper object library visibility 2016-02-25 22:05:19 +00:00
MathExtras.h Delete dead code. 2016-01-18 21:01:50 +00:00
MD5.h Fix comment for MD5Hash. 2016-02-09 13:28:44 +00:00
Memory.h
MemoryBuffer.h Reorganize the C API headers to improve build times. 2015-12-18 01:46:52 +00:00
MemoryObject.h
MipsABIFlags.h
Mutex.h
MutexGuard.h
OnDiskHashTable.h Don't force OnDiskHashTables to have a minimum of 64 buckets. That's 2016-03-26 01:49:50 +00:00
Options.h
Path.h
PluginLoader.h
PointerLikeTypeTraits.h Revert "Revert "[ptr-traits] Implement the base pointer traits using the actual"" 2015-12-30 23:37:25 +00:00
PrettyStackTrace.h
Printable.h
Process.h
Program.h Replace static const int with enum to fix obnoxious linker errors about a missing definition 2016-02-03 21:45:39 +00:00
RandomNumberGenerator.h
raw_os_ostream.h
raw_ostream.h Drop an unnecessary use of writev. 2015-12-16 22:59:06 +00:00
raw_sha1_ostream.h Const correctness in raw_sha1_ostream (NFC) 2016-04-01 05:12:18 +00:00
Recycler.h
RecyclingAllocator.h
Regex.h
Registry.h Add support for importing and exporting Registry objects on Windows 2016-02-09 19:37:25 +00:00
RWMutex.h
SaveAndRestore.h
ScaledNumber.h Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-02 18:20:45 +00:00
SHA1.h Add support for computing SHA1 in LLVM 2016-04-01 04:30:16 +00:00
Signals.h
SMLoc.h
Solaris.h
SourceMgr.h
SpecialCaseList.h
StreamingMemoryObject.h Support: Implement StreamingMemoryObject::getPointer 2016-03-27 23:00:59 +00:00
StringPool.h
StringSaver.h
SwapByteOrder.h
SystemUtils.h
TargetParser.h
TargetRegistry.h [MC, COFF] Support link /incremental conditionally 2015-12-21 22:09:27 +00:00
TargetSelect.h
thread.h Add hardware_concurrency interface to llvm::thread (NFC) 2016-03-04 00:25:54 +00:00
Threading.h
ThreadLocal.h
ThreadPool.h Add <atomic> to ThreadPool.h, since std::atomic is used 2016-03-24 20:39:17 +00:00
Timer.h [Support] Allow multiple paired calls to {start,stop}Timer() 2015-12-22 17:36:17 +00:00
TimeValue.h
ToolOutputFile.h
TrailingObjects.h Remove TrailingObjects::operator delete. It's still suffering from 2016-02-09 02:09:16 +00:00
type_traits.h is_integral_or_enum ❥ enum class ⇒ hashable enum class 2016-04-09 20:04:34 +00:00
TypeName.h [Support] Don't check for ICC directly and rely on the __GNUC__ check 2016-02-25 06:13:01 +00:00
Unicode.h
UnicodeCharRanges.h
UniqueLock.h
Valgrind.h Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
Watchdog.h
Win64EH.h
WindowsError.h
YAMLParser.h Add != to YAMLParser's basic_collection_iterator. 2016-01-06 05:17:12 +00:00
YAMLTraits.h Require allocator parameter to YAML traits. 2016-03-17 00:34:54 +00:00