diff options
author | Chris Lattner <sabre@nondot.org> | 2011-06-21 06:22:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-06-21 06:22:33 +0000 |
commit | 39ff10a293012fe6f2db682c5518e1be2c50ca67 (patch) | |
tree | 8922e827400f64d5112b236d62d52983180d0f2e | |
parent | 9568e5c3c3f1e25288d2ff375dba0fddbf161fd6 (diff) | |
download | external_llvm-39ff10a293012fe6f2db682c5518e1be2c50ca67.zip external_llvm-39ff10a293012fe6f2db682c5518e1be2c50ca67.tar.gz external_llvm-39ff10a293012fe6f2db682c5518e1be2c50ca67.tar.bz2 |
use the MapEntryTy typedef instead of writing it out long form,
add some fixme's about methods that should be removed.
Merged from type-system-rewrite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133504 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/StringMap.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 934cacc..8aac201 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -307,7 +307,7 @@ public: return ValueTy(); } - ValueTy& operator[](StringRef Key) { + ValueTy &operator[](StringRef Key) { return GetOrCreateValue(Key).getValue(); } @@ -355,8 +355,7 @@ public: /// exists, return it. Otherwise, default construct a value, insert it, and /// return. template <typename InitTy> - StringMapEntry<ValueTy> &GetOrCreateValue(StringRef Key, - InitTy Val) { + MapEntryTy &GetOrCreateValue(StringRef Key, InitTy Val) { unsigned BucketNo = LookupBucketFor(Key); ItemBucket &Bucket = TheTable[BucketNo]; if (Bucket.Item && Bucket.Item != getTombstoneVal()) @@ -378,19 +377,19 @@ public: return *NewItem; } - StringMapEntry<ValueTy> &GetOrCreateValue(StringRef Key) { + MapEntryTy &GetOrCreateValue(StringRef Key) { return GetOrCreateValue(Key, ValueTy()); } + // FIXME: Remove this method. template <typename InitTy> - StringMapEntry<ValueTy> &GetOrCreateValue(const char *KeyStart, - const char *KeyEnd, - InitTy Val) { + MapEntryTy &GetOrCreateValue(const char *KeyStart, const char *KeyEnd, + InitTy Val) { return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart), Val); } - StringMapEntry<ValueTy> &GetOrCreateValue(const char *KeyStart, - const char *KeyEnd) { + // FIXME: Remove this method. + MapEntryTy &GetOrCreateValue(const char *KeyStart, const char *KeyEnd) { return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart)); } |