From f3a991b8e3f5fd27bbdba03b215cb9975b6e169c Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Mon, 5 Dec 2016 07:04:19 +0000 Subject: [PATCH] TableGen: TableGenStringKey is no longer necessary as of r288642 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288651 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/TableGen/Record.cpp | 55 ----------------------------------------- 1 file changed, 55 deletions(-) diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index ae88af06912..2e69ed7e735 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -30,61 +30,6 @@ using namespace llvm; static BumpPtrAllocator Allocator; -//===----------------------------------------------------------------------===// -// std::string wrapper for DenseMap purposes -//===----------------------------------------------------------------------===// - -namespace llvm { - -/// This is a wrapper for std::string suitable for using as a key to a DenseMap. -/// Because there isn't a particularly -/// good way to indicate tombstone or empty keys for strings, we want -/// to wrap std::string to indicate that this is a "special" string -/// not expected to take on certain values (those of the tombstone and -/// empty keys). This makes things a little safer as it clarifies -/// that DenseMap is really not appropriate for general strings. - -class TableGenStringKey { -public: - TableGenStringKey(StringRef str) : data(str) {} - TableGenStringKey(const char *str) : data(str) {} - - StringRef str() const { return data; } - - friend hash_code hash_value(const TableGenStringKey &Value) { - using llvm::hash_value; - return hash_value(Value.str()); - } - -private: - std::string data; -}; - -/// Specialize DenseMapInfo for TableGenStringKey. -template<> struct DenseMapInfo { - static inline TableGenStringKey getEmptyKey() { - TableGenStringKey Empty("<<>>"); - return Empty; - } - - static inline TableGenStringKey getTombstoneKey() { - TableGenStringKey Tombstone("<<>>"); - return Tombstone; - } - - static unsigned getHashValue(const TableGenStringKey& Val) { - using llvm::hash_value; - return hash_value(Val); - } - - static bool isEqual(const TableGenStringKey& LHS, - const TableGenStringKey& RHS) { - return LHS.str() == RHS.str(); - } -}; - -} // end namespace llvm - //===----------------------------------------------------------------------===// // Type implementations //===----------------------------------------------------------------------===// -- 2.50.1