From db3db6b2b659d1e41d6bbe8b48625f8e90de48fe Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 10 Jul 2018 15:10:49 +0000 Subject: [PATCH] Add CachedHashStringRef::data(). This accessor is useful and could be slightly more efficient than Str.val().data() because you can avoid StringRef instantiation. Differential Revision: https://reviews.llvm.org/D49133 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336683 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/CachedHashString.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/llvm/ADT/CachedHashString.h b/include/llvm/ADT/CachedHashString.h index a56a6213a07..d8f0e7afdd4 100644 --- a/include/llvm/ADT/CachedHashString.h +++ b/include/llvm/ADT/CachedHashString.h @@ -43,6 +43,7 @@ public: } StringRef val() const { return StringRef(P, Size); } + const char *data() const { return P; } uint32_t size() const { return Size; } uint32_t hash() const { return Hash; } }; -- 2.11.0