diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2009-01-08 04:48:20 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2009-01-08 04:48:20 +0000 |
commit | 8bb5e9901346f448461289f2d0079ed6d534b571 (patch) | |
tree | f234f8d527d6e1fdd02d418c86fc5c78580c8016 /include/llvm/ADT/StringMap.h | |
parent | 2ec78c4a63c47e24c0e7e280b65368af931e8ad5 (diff) | |
download | external_llvm-8bb5e9901346f448461289f2d0079ed6d534b571.zip external_llvm-8bb5e9901346f448461289f2d0079ed6d534b571.tar.gz external_llvm-8bb5e9901346f448461289f2d0079ed6d534b571.tar.bz2 |
* Added unittests for StringMap
* Fixed but in StringMap::clear()
* Removed trailing whitespace
Original patch by Talin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61914 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringMap.h')
-rw-r--r-- | include/llvm/ADT/StringMap.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index d5acd22..ac27055 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -336,7 +336,7 @@ public: // clear - Empties out the StringMap void clear() { if (empty()) return; - + // Zap all values, resetting the keys back to non-present (not tombstone), // which is safe because we're removing all elements. for (ItemBucket *I = TheTable, *E = TheTable+NumBuckets; I != E; ++I) { @@ -345,6 +345,8 @@ public: I->Item = 0; } } + + NumItems = 0; } /// GetOrCreateValue - Look up the specified key in the table. If a value @@ -421,7 +423,7 @@ protected: StringMapImpl::ItemBucket *Ptr; public: typedef StringMapEntry<ValueTy> value_type; - + explicit StringMapConstIterator(StringMapImpl::ItemBucket *Bucket, bool NoAdvance = false) : Ptr(Bucket) { |