[llvm-commits] [llvm] r133504 - /llvm/trunk/include/llvm/ADT/StringMap.h
Chris Lattner
sabre at nondot.org
Mon Jun 20 23:22:34 PDT 2011
Author: lattner
Date: Tue Jun 21 01:22:33 2011
New Revision: 133504
URL: http://llvm.org/viewvc/llvm-project?rev=133504&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/ADT/StringMap.h
Modified: llvm/trunk/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=133504&r1=133503&r2=133504&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Tue Jun 21 01:22:33 2011
@@ -307,7 +307,7 @@
return ValueTy();
}
- ValueTy& operator[](StringRef Key) {
+ ValueTy &operator[](StringRef Key) {
return GetOrCreateValue(Key).getValue();
}
@@ -355,8 +355,7 @@
/// 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 @@
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));
}
More information about the llvm-commits
mailing list