projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add methods to StringMap to erase entries by key.
[oota-llvm.git]
/
include
/
llvm
/
ADT
/
StringMap.h
diff --git
a/include/llvm/ADT/StringMap.h
b/include/llvm/ADT/StringMap.h
index 869a87fdced331b0be84ea6b353dfe211cd46f48..0a4a5d631d9c55df99e10d12b5f51eeff4348fc3 100644
(file)
--- a/
include/llvm/ADT/StringMap.h
+++ b/
include/llvm/ADT/StringMap.h
@@
-377,6
+377,20
@@
public:
V.Destroy(Allocator);
}
V.Destroy(Allocator);
}
+ bool erase(const char *Key) {
+ iterator I = find(Key);
+ if (I == end()) return false;
+ erase(I);
+ return true;
+ }
+
+ bool erase(std::string Key) {
+ iterator I = find(Key);
+ if (I == end()) return false;
+ erase(I);
+ return true;
+ }
+
~StringMap() {
for (ItemBucket *I = TheTable, *E = TheTable+NumBuckets; I != E; ++I) {
if (I->Item && I->Item != getTombstoneVal())
~StringMap() {
for (ItemBucket *I = TheTable, *E = TheTable+NumBuckets; I != E; ++I) {
if (I->Item && I->Item != getTombstoneVal())