aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/StringMap.h
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2009-01-08 04:48:20 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2009-01-08 04:48:20 +0000
commit8bb5e9901346f448461289f2d0079ed6d534b571 (patch)
treef234f8d527d6e1fdd02d418c86fc5c78580c8016 /include/llvm/ADT/StringMap.h
parent2ec78c4a63c47e24c0e7e280b65368af931e8ad5 (diff)
downloadexternal_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.h6
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) {