forked from OSchip/llvm-project
Add a new (simple) StringMap::clear method, patch by Pratik
Solanki! llvm-svn: 53008
This commit is contained in:
parent
ed50fb5b61
commit
bedd1b2427
|
@ -333,6 +333,12 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear - Empties out the StringMap
|
||||||
|
void clear() {
|
||||||
|
while (!empty())
|
||||||
|
erase(begin());
|
||||||
|
}
|
||||||
|
|
||||||
/// GetOrCreateValue - Look up the specified key in the table. If a value
|
/// GetOrCreateValue - Look up the specified key in the table. If a value
|
||||||
/// exists, return it. Otherwise, default construct a value, insert it, and
|
/// exists, return it. Otherwise, default construct a value, insert it, and
|
||||||
/// return.
|
/// return.
|
||||||
|
|
|
@ -112,10 +112,7 @@ CollectorMetadata &CollectorModuleMetadata::get(const Function &F) {
|
||||||
|
|
||||||
void CollectorModuleMetadata::clear() {
|
void CollectorModuleMetadata::clear() {
|
||||||
Map.clear();
|
Map.clear();
|
||||||
|
NameMap.clear();
|
||||||
// TODO: StringMap should provide a clear method.
|
|
||||||
while (!NameMap.empty())
|
|
||||||
NameMap.erase(NameMap.begin());
|
|
||||||
|
|
||||||
for (iterator I = begin(), E = end(); I != E; ++I)
|
for (iterator I = begin(), E = end(); I != E; ++I)
|
||||||
delete *I;
|
delete *I;
|
||||||
|
|
Loading…
Reference in New Issue