X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FStringMap.h;h=0a4a5d631d9c55df99e10d12b5f51eeff4348fc3;hb=84701836bfb1889e2e26e361ebd5d29d972ab396;hp=869a87fdced331b0be84ea6b353dfe211cd46f48;hpb=99ec779a93cf7a09ac336b63d2d67818960343a1;p=oota-llvm.git diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 869a87fdced..0a4a5d631d9 100644 --- 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())