Author: lattner Date: Thu Jan 31 11:24:51 2008 New Revision: 46614 URL: http://llvm.org/viewvc/llvm-project?rev=46614&view=rev Log: revert anton's recent stringmap patch, which breaks clang.
Modified: llvm/trunk/include/llvm/ADT/StringMap.h Modified: llvm/trunk/include/llvm/ADT/StringMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=46614&r1=46613&r2=46614&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/StringMap.h (original) +++ llvm/trunk/include/llvm/ADT/StringMap.h Thu Jan 31 11:24:51 2008 @@ -126,26 +126,23 @@ /// and data. template<typename ValueTy> 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<const char*>(this+1);} - const char *first() const { return getKeyData(); } - /// Create - Create a StringMapEntry for the specified key and default /// construct the value. template<typename AllocatorTy, typename InitType> @@ -242,11 +239,6 @@ AllocatorTy &getAllocator() { return Allocator; } const AllocatorTy &getAllocator() const { return Allocator; } - typedef const char* key_type; - typedef ValueTy mapped_type; - typedef StringMapEntry<ValueTy> value_type; - typedef size_t size_type; - typedef StringMapConstIterator<ValueTy> const_iterator; typedef StringMapIterator<ValueTy> iterator; @@ -275,25 +267,6 @@ 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. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits