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
This commit is contained in:
Chris Lattner 2011-06-21 06:22:33 +00:00
parent 9568e5c3c3
commit 39ff10a293

View File

@ -307,7 +307,7 @@ public:
return ValueTy(); return ValueTy();
} }
ValueTy& operator[](StringRef Key) { ValueTy &operator[](StringRef Key) {
return GetOrCreateValue(Key).getValue(); return GetOrCreateValue(Key).getValue();
} }
@ -355,8 +355,7 @@ public:
/// exists, return it. Otherwise, default construct a value, insert it, and /// exists, return it. Otherwise, default construct a value, insert it, and
/// return. /// return.
template <typename InitTy> template <typename InitTy>
StringMapEntry<ValueTy> &GetOrCreateValue(StringRef Key, MapEntryTy &GetOrCreateValue(StringRef Key, InitTy Val) {
InitTy Val) {
unsigned BucketNo = LookupBucketFor(Key); unsigned BucketNo = LookupBucketFor(Key);
ItemBucket &Bucket = TheTable[BucketNo]; ItemBucket &Bucket = TheTable[BucketNo];
if (Bucket.Item && Bucket.Item != getTombstoneVal()) if (Bucket.Item && Bucket.Item != getTombstoneVal())
@ -378,19 +377,19 @@ public:
return *NewItem; return *NewItem;
} }
StringMapEntry<ValueTy> &GetOrCreateValue(StringRef Key) { MapEntryTy &GetOrCreateValue(StringRef Key) {
return GetOrCreateValue(Key, ValueTy()); return GetOrCreateValue(Key, ValueTy());
} }
// FIXME: Remove this method.
template <typename InitTy> template <typename InitTy>
StringMapEntry<ValueTy> &GetOrCreateValue(const char *KeyStart, MapEntryTy &GetOrCreateValue(const char *KeyStart, const char *KeyEnd,
const char *KeyEnd, InitTy Val) {
InitTy Val) {
return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart), Val); return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart), Val);
} }
StringMapEntry<ValueTy> &GetOrCreateValue(const char *KeyStart, // FIXME: Remove this method.
const char *KeyEnd) { MapEntryTy &GetOrCreateValue(const char *KeyStart, const char *KeyEnd) {
return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart)); return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart));
} }