Commit Graph

5 Commits

Author SHA1 Message Date
Justin Lebar
902d11d34d [ADT] Don't rely on string literals not being convertible to non-const char* in CachedHashString.
The build was breaking on some platforms because we assumed that
CachedHashString("foo") would match the CachedHashString(StringRef)
constructor rather than the CachedHashString(char*) constructor.

To fix this, provide a CachedHashString(const char*) constructor, and
add a dummy argument to the old CachedHashString(char*) constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 22:10:23 +00:00
Justin Lebar
600523a457 [ADT] Get rid of use of LLVM_NOEXCEPT in CachedHashString.h.
LLVM_NOEXCEPT is no longer necessary (yay).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 20:28:00 +00:00
Justin Lebar
2a98ad5c2c [ADT] Compare strings' hashes first before comparing their values.
Summary:
We already have the hashes in hand, and comparing hashes should be much
more discriminatory than comparing the StringRefs' sizes.

Reviewers: rafael

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25705

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 20:10:51 +00:00
Justin Lebar
228ec7d254 [ADT] Add CachedHashString.
Summary:
This is like CachedHashStringRef, but owns its data.

This lets us use strings inside of DenseMaps.

Reviewers: timshen

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25645

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 20:10:48 +00:00
Justin Lebar
fd7d73fae5 [ADT] Move CachedHashString to its own header in ADT, and rename to CachedHashStringRef.
Summary:
Reclaiming the name 'CachedHashString' will let us add a type with that
name that owns its value.

Reviewers: timshen

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25644

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284434 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 22:24:36 +00:00