[PATCH] D25645: [ADT] Add CachedHashString.

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 13:45:21 PDT 2016


timshen added inline comments.


================
Comment at: llvm/include/llvm/ADT/CachedHashString.h:11
 // This file defines CachedHashString and CachedHashStringRef.  These are like
 // std::string and StringRef, except they store their hash in addition to their
 // string data.
----------------
CachedHashString is not like std::string, because it doesn't support operations like operator+=. :)


================
Comment at: llvm/include/llvm/ADT/CachedHashString.h:24
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/StringRef.h"
----------------
It's not used, is it?


================
Comment at: llvm/include/llvm/ADT/CachedHashString.h:94
+
+  // TODO: Use small-string optimization to avoid allocating.
+
----------------
It is unfortunate to implement some of the std::string functionalities from scratch. Is there a way to implement it in terms of std::string?


https://reviews.llvm.org/D25645





More information about the llvm-commits mailing list