From: Chris Lattner Date: Thu, 31 Jan 2008 17:24:51 +0000 (+0000) Subject: revert anton's recent stringmap patch, which breaks clang. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a91cfa9cd09635a6d046e144d07e68d924ac0fbb;p=oota-llvm.git revert anton's recent stringmap patch, which breaks clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46614 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 494ba3ad9cb..407cb1f1238 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -126,26 +126,23 @@ public: /// and data. template class StringMapEntry : public StringMapEntryBase { + ValueTy Val; public: - ValueTy second; - explicit StringMapEntry(unsigned StrLen) - : StringMapEntryBase(StrLen), second() {} + : StringMapEntryBase(StrLen), Val() {} StringMapEntry(unsigned StrLen, const ValueTy &V) - : StringMapEntryBase(StrLen), second(V) {} + : StringMapEntryBase(StrLen), Val(V) {} - const ValueTy &getValue() const { return second; } - ValueTy &getValue() { return second; } + const ValueTy &getValue() const { return Val; } + ValueTy &getValue() { return Val; } - void setValue(const ValueTy &V) { second = V; } + void setValue(const ValueTy &V) { Val = V; } /// getKeyData - Return the start of the string data that is the key for this /// value. The string data is always stored immediately after the /// StringMapEntry object. const char *getKeyData() const {return reinterpret_cast(this+1);} - const char *first() const { return getKeyData(); } - /// Create - Create a StringMapEntry for the specified key and default /// construct the value. template @@ -242,11 +239,6 @@ public: AllocatorTy &getAllocator() { return Allocator; } const AllocatorTy &getAllocator() const { return Allocator; } - typedef const char* key_type; - typedef ValueTy mapped_type; - typedef StringMapEntry value_type; - typedef size_t size_type; - typedef StringMapConstIterator const_iterator; typedef StringMapIterator iterator; @@ -275,25 +267,6 @@ public: return const_iterator(TheTable+Bucket); } - iterator find(const char *Key) { - return find(Key, Key + strlen(Key)); - } - const_iterator find(const char *Key) const { - return find(Key, Key + strlen(Key)); - } - - ValueTy& operator[](const char *Key) { - value_type& entry = GetOrCreateValue(Key, Key + strlen(Key)); - return entry.getValue(); - } - - size_type count(const char *KeyStart, const char *KeyEnd) const { - return find(KeyStart, KeyEnd) == end() ? 0 : 1; - } - size_type count(const char *Key) const { - return count(Key, Key + strlen(Key)); - } - /// insert - Insert the specified key/value pair into the map. If the key /// already exists in the map, return false and ignore the request, otherwise /// insert it and return true.