llvm.org GIT mirror llvm / 6316fbc
Convert StringMap to using StringRef for its APIs. - Yay for '-'s and simplifications! - I kept StringMap::GetOrCreateValue for compatibility purposes, this can eventually go away. Likewise the StringMapEntry Create functions still follow the old style. - NIFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76888 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 10 years ago
12 changed file(s) with 109 addition(s) and 146 deletion(s). Raw diff Collapse all Expand all
1313 #ifndef LLVM_ADT_STRINGMAP_H
1414 #define LLVM_ADT_STRINGMAP_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/Support/Allocator.h"
1718 #include
1819 #include
9495 /// specified bucket will be non-null. Otherwise, it will be null. In either
9596 /// case, the FullHashValue field of the bucket will be set to the hash value
9697 /// of the string.
97 unsigned LookupBucketFor(const char *KeyStart, const char *KeyEnd);
98 unsigned LookupBucketFor(const StringRef &Key);
9899
99100 /// FindKey - Look up the bucket that contains the specified key. If it exists
100101 /// in the map, return the bucket number of the key. Otherwise return -1.
101102 /// This does not modify the map.
102 int FindKey(const char *KeyStart, const char *KeyEnd) const;
103 int FindKey(const StringRef &Key) const;
103104
104105 /// RemoveKey - Remove the specified StringMapEntry from the table, but do not
105106 /// delete it. This aborts if the value isn't in the table.
107108
108109 /// RemoveKey - Remove the StringMapEntry for the specified key from the
109110 /// table, returning it. If the key is not in the table, this returns null.
110 StringMapEntryBase *RemoveKey(const char *KeyStart, const char *KeyEnd);
111 StringMapEntryBase *RemoveKey(const StringRef &Key);
111112 private:
112113 void init(unsigned Size);
113114 public:
134135 : StringMapEntryBase(strLen), second() {}
135136 StringMapEntry(unsigned strLen, const ValueTy &V)
136137 : StringMapEntryBase(strLen), second(V) {}
138
139 StringRef getKey() const {
140 return StringRef(getKeyData(), getKeyLength());
141 }
137142
138143 const ValueTy &getValue() const { return second; }
139144 ValueTy &getValue() { return second; }
276281 return const_iterator(TheTable+NumBuckets, true);
277282 }
278283
279 iterator find(const char *KeyStart, const char *KeyEnd) {
280 int Bucket = FindKey(KeyStart, KeyEnd);
284 iterator find(const StringRef &Key) {
285 int Bucket = FindKey(Key);
281286 if (Bucket == -1) return end();
282287 return iterator(TheTable+Bucket);
283288 }
284 iterator find(const char *Key) {
285 return find(Key, Key + strlen(Key));
286 }
287 iterator find(const std::string &Key) {
288 return find(Key.data(), Key.data() + Key.size());
289 }
290
291 const_iterator find(const char *KeyStart, const char *KeyEnd) const {
292 int Bucket = FindKey(KeyStart, KeyEnd);
289
290 const_iterator find(const StringRef &Key) const {
291 int Bucket = FindKey(Key);
293292 if (Bucket == -1) return end();
294293 return const_iterator(TheTable+Bucket);
295294 }
296 const_iterator find(const char *Key) const {
297 return find(Key, Key + strlen(Key));
298 }
299 const_iterator find(const std::string &Key) const {
300 return find(Key.data(), Key.data() + Key.size());
301 }
302295
303296 /// lookup - Return the entry for the specified key, or a default
304297 /// constructed value if no such entry exists.
305 ValueTy lookup(const char *KeyStart, const char *KeyEnd) const {
306 const_iterator it = find(KeyStart, KeyEnd);
307 if (it != end())
308 return it->second;
309 return ValueTy();
310 }
311 ValueTy lookup(const char *Key) const {
298 ValueTy lookup(const StringRef &Key) const {
312299 const_iterator it = find(Key);
313300 if (it != end())
314301 return it->second;
315302 return ValueTy();
316303 }
317 ValueTy lookup(const std::string &Key) const {
318 const_iterator it = find(Key);
319 if (it != end())
320 return it->second;
321 return ValueTy();
322 }
323
324 ValueTy& operator[](const char *Key) {
325 return GetOrCreateValue(Key, Key + strlen(Key)).getValue();
326 }
327 ValueTy& operator[](const std::string &Key) {
328 return GetOrCreateValue(Key.data(), Key.data() + Key.size()).getValue();
329 }
330
331 size_type count(const char *KeyStart, const char *KeyEnd) const {
332 return find(KeyStart, KeyEnd) == end() ? 0 : 1;
333 }
334 size_type count(const char *Key) const {
335 return count(Key, Key + strlen(Key));
336 }
337 size_type count(const std::string &Key) const {
338 return count(Key.data(), Key.data() + Key.size());
304
305 ValueTy& operator[](const StringRef &Key) {
306 return GetOrCreateValue(Key).getValue();
307 }
308
309 size_type count(const StringRef &Key) const {
310 return find(Key) == end() ? 0 : 1;
339311 }
340312
341313 /// insert - Insert the specified key/value pair into the map. If the key
342314 /// already exists in the map, return false and ignore the request, otherwise
343315 /// insert it and return true.
344316 bool insert(MapEntryTy *KeyValue) {
345 unsigned BucketNo =
346 LookupBucketFor(KeyValue->getKeyData(),
347 KeyValue->getKeyData()+KeyValue->getKeyLength());
317 unsigned BucketNo = LookupBucketFor(KeyValue->getKey());
348318 ItemBucket &Bucket = TheTable[BucketNo];
349319 if (Bucket.Item && Bucket.Item != getTombstoneVal())
350320 return false; // Already exists in map.
379349 /// exists, return it. Otherwise, default construct a value, insert it, and
380350 /// return.
381351 template
352 StringMapEntry &GetOrCreateValue(const StringRef &Key,
353 InitTy Val) {
354 unsigned BucketNo = LookupBucketFor(Key);
355 ItemBucket &Bucket = TheTable[BucketNo];
356 if (Bucket.Item && Bucket.Item != getTombstoneVal())
357 return *static_cast(Bucket.Item);
358
359 MapEntryTy *NewItem =
360 MapEntryTy::Create(Key.begin(), Key.end(), Allocator, Val);
361
362 if (Bucket.Item == getTombstoneVal())
363 --NumTombstones;
364 ++NumItems;
365
366 // Fill in the bucket for the hash table. The FullHashValue was already
367 // filled in by LookupBucketFor.
368 Bucket.Item = NewItem;
369
370 if (ShouldRehash())
371 RehashTable();
372 return *NewItem;
373 }
374
375 StringMapEntry &GetOrCreateValue(const StringRef &Key) {
376 return GetOrCreateValue(Key, ValueTy());
377 }
378
379 template
382380 StringMapEntry &GetOrCreateValue(const char *KeyStart,
383381 const char *KeyEnd,
384382 InitTy Val) {
385 unsigned BucketNo = LookupBucketFor(KeyStart, KeyEnd);
386 ItemBucket &Bucket = TheTable[BucketNo];
387 if (Bucket.Item && Bucket.Item != getTombstoneVal())
388 return *static_cast(Bucket.Item);
389
390 MapEntryTy *NewItem = MapEntryTy::Create(KeyStart, KeyEnd, Allocator, Val);
391
392 if (Bucket.Item == getTombstoneVal())
393 --NumTombstones;
394 ++NumItems;
395
396 // Fill in the bucket for the hash table. The FullHashValue was already
397 // filled in by LookupBucketFor.
398 Bucket.Item = NewItem;
399
400 if (ShouldRehash())
401 RehashTable();
402 return *NewItem;
383 return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart), Val);
403384 }
404385
405386 StringMapEntry &GetOrCreateValue(const char *KeyStart,
406387 const char *KeyEnd) {
407 return GetOrCreateValue(KeyStart, KeyEnd, ValueTy());
388 return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart));
408389 }
409390
410391 /// remove - Remove the specified key/value pair from the map, but do not
419400 V.Destroy(Allocator);
420401 }
421402
422 bool erase(const char *Key) {
403 bool erase(const StringRef &Key) {
423404 iterator I = find(Key);
424405 if (I == end()) return false;
425406 erase(I);
426407 return true;
427408 }
428409
429 bool erase(const std::string &Key) {
430 iterator I = find(Key);
431 if (I == end()) return false;
432 erase(I);
433 return true;
434 }
435
436410 ~StringMap() {
437411 clear();
438412 free(TheTable);
None //===-- StringPool.h - Interned string pool -------------------------------===//
0 //===-- StringPool.h - Interned string pool ---------------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
6363 /// intern - Adds a string to the pool and returns a reference-counted
6464 /// pointer to it. No additional memory is allocated if the string already
6565 /// exists in the pool.
66 PooledStringPtr intern(const char *Begin, const char *End);
67
68 /// intern - Adds a null-terminated string to the pool and returns a
69 /// reference-counted pointer to it. No additional memory is allocated if
70 /// the string already exists in the pool.
71 inline PooledStringPtr intern(const char *Str);
66 PooledStringPtr intern(const StringRef &Str);
7267
7368 /// empty - Checks whether the pool is empty. Returns true if so.
7469 ///
138133 inline bool operator!=(const PooledStringPtr &That) { return S != That.S; }
139134 };
140135
141 PooledStringPtr StringPool::intern(const char *Str) {
142 return intern(Str, Str + strlen(Str));
143 }
144
145136 } // End llvm namespace
146137
147138 #endif
5858 // Look up this function in the string map.
5959 const char *ValueName = F->getNameStart();
6060 StringMap::iterator I =
61 Map->find(ValueName, ValueName+F->getNameLen());
61 Map->find(StringRef(ValueName, F->getNameLen()));
6262 return I != Map->end() ? I->second : 0;
6363 }
6464
7474
7575 GCStrategy *GCModuleInfo::getOrCreateStrategy(const Module *M,
7676 const std::string &Name) {
77 const char *Start = Name.c_str();
78
79 strategy_map_type::iterator NMI =
80 StrategyMap.find(Start, Start + Name.size());
77 strategy_map_type::iterator NMI = StrategyMap.find(Name);
8178 if (NMI != StrategyMap.end())
8279 return NMI->getValue();
8380
8481 for (GCRegistry::iterator I = GCRegistry::begin(),
8582 E = GCRegistry::end(); I != E; ++I) {
86 if (strcmp(Start, I->getName()) == 0) {
83 if (Name == I->getName()) {
8784 GCStrategy *S = I->instantiate();
8885 S->M = M;
8986 S->Name = Name;
90 StrategyMap.GetOrCreateValue(Start, Start + Name.size()).setValue(S);
87 StrategyMap.GetOrCreateValue(Name).setValue(S);
9188 StrategyList.push_back(S);
9289 return S;
9390 }
6464 /// specified bucket will be non-null. Otherwise, it will be null. In either
6565 /// case, the FullHashValue field of the bucket will be set to the hash value
6666 /// of the string.
67 unsigned StringMapImpl::LookupBucketFor(const char *NameStart,
68 const char *NameEnd) {
67 unsigned StringMapImpl::LookupBucketFor(const StringRef &Name) {
6968 unsigned HTSize = NumBuckets;
7069 if (HTSize == 0) { // Hash table unallocated so far?
7170 init(16);
7271 HTSize = NumBuckets;
7372 }
74 unsigned FullHashValue = HashString(NameStart, NameEnd);
73 unsigned FullHashValue = HashString(Name.begin(), Name.end());
7574 unsigned BucketNo = FullHashValue & (HTSize-1);
7675
7776 unsigned ProbeAmt = 1;
101100 // being non-null and for the full hash value) not at the items. This
102101 // is important for cache locality.
103102
104 // Do the comparison like this because NameStart isn't necessarily
103 // Do the comparison like this because Name isn't necessarily
105104 // null-terminated!
106105 char *ItemStr = (char*)BucketItem+ItemSize;
107 unsigned ItemStrLen = BucketItem->getKeyLength();
108 if (unsigned(NameEnd-NameStart) == ItemStrLen &&
109 memcmp(ItemStr, NameStart, ItemStrLen) == 0) {
106 if (Name == StringRef(ItemStr, BucketItem->getKeyLength())) {
110107 // We found a match!
111108 return BucketNo;
112109 }
125122 /// FindKey - Look up the bucket that contains the specified key. If it exists
126123 /// in the map, return the bucket number of the key. Otherwise return -1.
127124 /// This does not modify the map.
128 int StringMapImpl::FindKey(const char *KeyStart, const char *KeyEnd) const {
125 int StringMapImpl::FindKey(const StringRef &Key) const {
129126 unsigned HTSize = NumBuckets;
130127 if (HTSize == 0) return -1; // Really empty table?
131 unsigned FullHashValue = HashString(KeyStart, KeyEnd);
128 unsigned FullHashValue = HashString(Key.begin(), Key.end());
132129 unsigned BucketNo = FullHashValue & (HTSize-1);
133130
134131 unsigned ProbeAmt = 1;
150147 // Do the comparison like this because NameStart isn't necessarily
151148 // null-terminated!
152149 char *ItemStr = (char*)BucketItem+ItemSize;
153 unsigned ItemStrLen = BucketItem->getKeyLength();
154 if (unsigned(KeyEnd-KeyStart) == ItemStrLen &&
155 memcmp(ItemStr, KeyStart, ItemStrLen) == 0) {
150 if (Key == StringRef(ItemStr, BucketItem->getKeyLength())) {
156151 // We found a match!
157152 return BucketNo;
158153 }
171166 /// delete it. This aborts if the value isn't in the table.
172167 void StringMapImpl::RemoveKey(StringMapEntryBase *V) {
173168 const char *VStr = (char*)V + ItemSize;
174 StringMapEntryBase *V2 = RemoveKey(VStr, VStr+V->getKeyLength());
169 StringMapEntryBase *V2 = RemoveKey(StringRef(VStr, V->getKeyLength()));
175170 V2 = V2;
176171 assert(V == V2 && "Didn't find key?");
177172 }
178173
179174 /// RemoveKey - Remove the StringMapEntry for the specified key from the
180175 /// table, returning it. If the key is not in the table, this returns null.
181 StringMapEntryBase *StringMapImpl::RemoveKey(const char *KeyStart,
182 const char *KeyEnd) {
183 int Bucket = FindKey(KeyStart, KeyEnd);
176 StringMapEntryBase *StringMapImpl::RemoveKey(const StringRef &Key) {
177 int Bucket = FindKey(Key);
184178 if (Bucket == -1) return 0;
185179
186180 StringMapEntryBase *Result = TheTable[Bucket].Item;
1212
1313 #include "llvm/Support/StringPool.h"
1414 #include "llvm/Support/Streams.h"
15 #include "llvm/ADT/StringRef.h"
1516
1617 using namespace llvm;
1718
2122 assert(InternTable.empty() && "PooledStringPtr leaked!");
2223 }
2324
24 PooledStringPtr StringPool::intern(const char *Begin, const char *End) {
25 table_t::iterator I = InternTable.find(Begin, End);
25 PooledStringPtr StringPool::intern(const StringRef &Key) {
26 table_t::iterator I = InternTable.find(Key);
2627 if (I != InternTable.end())
2728 return PooledStringPtr(&*I);
2829
29 entry_t *S = entry_t::Create(Begin, End);
30 entry_t *S = entry_t::Create(Key.begin(), Key.end());
3031 S->getValue().Pool = this;
3132 InternTable.insert(S);
3233
16561656 // Ignore unknown calls.
16571657 const char *CalleeName = Callee->getNameStart();
16581658 StringMap::iterator OMI =
1659 Optimizations.find(CalleeName, CalleeName+Callee->getNameLen());
1659 Optimizations.find(StringRef(CalleeName, Callee->getNameLen()));
16601660 if (OMI == Optimizations.end()) continue;
16611661
16621662 // Set the builder to the instruction after the call.
396396 unsigned StrLength) {
397397 sys::SmartScopedWriter Writer(ConstantsLock);
398398 StringMapEntry &Entry =
399 MDStringCache.GetOrCreateValue(StrBegin, StrBegin + StrLength);
399 MDStringCache.GetOrCreateValue(StringRef(StrBegin, StrLength));
400400 MDString *&S = Entry.getValue();
401401 if (!S) S = new MDString(Entry.getKeyData(),
402402 Entry.getKeyLength());
459459
460460 void LLVMContextImpl::erase(MDString *M) {
461461 sys::SmartScopedWriter Writer(ConstantsLock);
462 MDStringCache.erase(MDStringCache.find(M->StrBegin,
463 M->StrBegin + M->length()));
462 MDStringCache.erase(MDStringCache.find(StringRef(M->StrBegin,
463 M->length())));
464464 }
465465
466466 void LLVMContextImpl::erase(MDNode *M) {
3232 // lookup a value - Returns null on failure...
3333 //
3434 Value *ValueSymbolTable::lookup(const std::string &Name) const {
35 const_iterator VI = vmap.find(Name.data(), Name.data() + Name.size());
35 const_iterator VI = vmap.find(Name);
3636 if (VI != vmap.end()) // We found the symbol
3737 return VI->getValue();
3838 return 0;
4040
4141 Value *ValueSymbolTable::lookup(const char *NameBegin,
4242 const char *NameEnd) const {
43 const_iterator VI = vmap.find(NameBegin, NameEnd);
43 // FIXME: ValueSymbolTable should move to a StringRef based API.
44 const_iterator VI = vmap.find(StringRef(NameBegin, NameEnd - NameBegin));
4445 if (VI != vmap.end()) // We found the symbol
4546 return VI->getValue();
4647 return 0;
7071 UniqueName.append_uint_32(++LastUnique);
7172 // Try insert the vmap entry with this suffix.
7273 ValueName &NewName =
73 vmap.GetOrCreateValue(UniqueName.data(),
74 UniqueName.data() + UniqueName.size());
74 vmap.GetOrCreateValue(StringRef(UniqueName.data(),
75 UniqueName.size()));
7576 if (NewName.getValue() == 0) {
7677 // Newly inserted name. Success!
7778 NewName.setValue(V);
9495 ValueName *ValueSymbolTable::createValueName(const char *NameStart,
9596 unsigned NameLen, Value *V) {
9697 // In the common case, the name is not already in the symbol table.
97 ValueName &Entry = vmap.GetOrCreateValue(NameStart, NameStart+NameLen);
98 ValueName &Entry = vmap.GetOrCreateValue(StringRef(NameStart, NameLen));
9899 if (Entry.getValue() == 0) {
99100 Entry.setValue(V);
100101 //DEBUG(DOUT << " Inserted value: " << Entry.getKeyData() << ": "
112113
113114 // Try insert the vmap entry with this suffix.
114115 ValueName &NewName =
115 vmap.GetOrCreateValue(UniqueName.data(),
116 UniqueName.data() + UniqueName.size());
116 vmap.GetOrCreateValue(StringRef(UniqueName.data(),
117 UniqueName.size()));
117118 if (NewName.getValue() == 0) {
118119 // Newly inserted name. Success!
119120 NewName.setValue(V);
106106 *CurPtr == '.' || *CurPtr == '@')
107107 ++CurPtr;
108108 // Unique string.
109 CurStrVal =
110 getSS(TheStringSet).GetOrCreateValue(TokStart, CurPtr, 0).getKeyData();
109 CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
110 CurPtr - TokStart),
111 0).getKeyData();
111112 return asmtok::Identifier;
112113 }
113114
120121 ++CurPtr;
121122
122123 // Unique string.
123 CurStrVal =
124 getSS(TheStringSet).GetOrCreateValue(TokStart, CurPtr, 0).getKeyData();
124 CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
125 CurPtr - TokStart),
126 0).getKeyData();
125127 return asmtok::Register;
126128 }
127129
248250 }
249251
250252 // Unique string, include quotes for now.
251 CurStrVal =
252 getSS(TheStringSet).GetOrCreateValue(TokStart, CurPtr, 0).getKeyData();
253 CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
254 CurPtr - TokStart),
255 0).getKeyData();
253256 return asmtok::String;
254257 }
255258
378378
379379 void LTOModule::addAsmGlobalSymbol(const char *name) {
380380 // only add new define if not already defined
381 if ( _defines.count(name, &name[strlen(name)+1]) == 0 )
381 if ( _defines.count(name) == 0 )
382382 return;
383383
384384 // string is owned by _defines
506506 it != _undefines.end(); ++it) {
507507 // if this symbol also has a definition, then don't make an undefine
508508 // because it is a tentative definition
509 if ( _defines.count(it->getKeyData(), it->getKeyData()+
510 it->getKeyLength()) == 0 ) {
509 if ( _defines.count(it->getKey())) {
511510 NameAndAttributes info = it->getValue();
512511 _symbols.push_back(info);
513512 }
2121 static const char testKey[];
2222 static const uint32_t testValue;
2323 static const char* testKeyFirst;
24 static const char* testKeyLast;
24 static size_t testKeyLength;
2525 static const std::string testKeyStr;
2626
2727 void assertEmptyMap() {
3434
3535 // Lookup tests
3636 EXPECT_EQ(0u, testMap.count(testKey));
37 EXPECT_EQ(0u, testMap.count(testKeyFirst, testKeyLast));
37 EXPECT_EQ(0u, testMap.count(StringRef(testKeyFirst, testKeyLength)));
3838 EXPECT_EQ(0u, testMap.count(testKeyStr));
3939 EXPECT_TRUE(testMap.find(testKey) == testMap.end());
40 EXPECT_TRUE(testMap.find(testKeyFirst, testKeyLast) == testMap.end());
40 EXPECT_TRUE(testMap.find(StringRef(testKeyFirst, testKeyLength)) ==
41 testMap.end());
4142 EXPECT_TRUE(testMap.find(testKeyStr) == testMap.end());
4243 }
4344
5657
5758 // Lookup tests
5859 EXPECT_EQ(1u, testMap.count(testKey));
59 EXPECT_EQ(1u, testMap.count(testKeyFirst, testKeyLast));
60 EXPECT_EQ(1u, testMap.count(StringRef(testKeyFirst, testKeyLength)));
6061 EXPECT_EQ(1u, testMap.count(testKeyStr));
6162 EXPECT_TRUE(testMap.find(testKey) == testMap.begin());
62 EXPECT_TRUE(testMap.find(testKeyFirst, testKeyLast) == testMap.begin());
63 EXPECT_TRUE(testMap.find(StringRef(testKeyFirst, testKeyLength)) ==
64 testMap.begin());
6365 EXPECT_TRUE(testMap.find(testKeyStr) == testMap.begin());
6466 }
6567 };
6769 const char StringMapTest::testKey[] = "key";
6870 const uint32_t StringMapTest::testValue = 1u;
6971 const char* StringMapTest::testKeyFirst = testKey;
70 const char* StringMapTest::testKeyLast = testKey + sizeof(testKey) - 1;
72 size_t StringMapTest::testKeyLength = sizeof(testKey) - 1;
7173 const std::string StringMapTest::testKeyStr(testKey);
7274
7375 // Empty map tests.
8991
9092 // Lookup tests
9193 EXPECT_EQ(0u, constTestMap.count(testKey));
92 EXPECT_EQ(0u, constTestMap.count(testKeyFirst, testKeyLast));
94 EXPECT_EQ(0u, constTestMap.count(StringRef(testKeyFirst, testKeyLength)));
9395 EXPECT_EQ(0u, constTestMap.count(testKeyStr));
9496 EXPECT_TRUE(constTestMap.find(testKey) == constTestMap.end());
95 EXPECT_TRUE(constTestMap.find(testKeyFirst, testKeyLast) ==
97 EXPECT_TRUE(constTestMap.find(StringRef(testKeyFirst, testKeyLength)) ==
9698 constTestMap.end());
9799 EXPECT_TRUE(constTestMap.find(testKeyStr) == constTestMap.end());
98100 }
185187 TEST_F(StringMapTest, StringMapEntryTest) {
186188 StringMap::value_type* entry =
187189 StringMap::value_type::Create(
188 testKeyFirst, testKeyLast, 1u);
190 testKeyFirst, testKeyFirst + testKeyLength, 1u);
189191 EXPECT_STREQ(testKey, entry->first());
190192 EXPECT_EQ(1u, entry->second);
191193 }
195197 SCOPED_TRACE("InsertTest");
196198 testMap.insert(
197199 StringMap::value_type::Create(
198 testKeyFirst, testKeyLast, testMap.getAllocator(), 1u));
200 testKeyFirst, testKeyFirst + testKeyLength,
201 testMap.getAllocator(), 1u));
199202 assertSingleItemMap();
200203 }
201204