projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99ec779
)
Add methods to StringMap to erase entries by key.
author
Dan Gohman
<gohman@apple.com>
Mon, 23 Jun 2008 21:07:03 +0000
(21:07 +0000)
committer
Dan Gohman
<gohman@apple.com>
Mon, 23 Jun 2008 21:07:03 +0000
(21:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52640
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/StringMap.h
patch
|
blob
|
history
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);
}
+ 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())