Pass the whole StringMapEntry into StringMapEntryInitializer::Initialize.
authorChris Lattner <sabre@nondot.org>
Thu, 29 Nov 2007 06:14:41 +0000 (06:14 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 29 Nov 2007 06:14:41 +0000 (06:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44432 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringMap.h

index deaf915f3d7e23fedda002c884bc6c2fd9fb609f..1fa128a5fc5b29b007c9698aa629e6fcbd2be26f 100644 (file)
@@ -22,6 +22,8 @@ namespace llvm {
   class StringMapConstIterator;
   template<typename ValueT>
   class StringMapIterator;
+  template<typename ValueTy>
+  class StringMapEntry;
 
 /// StringMapEntryInitializer - This datatype can be partially specialized for
 /// various datatypes in a stringmap to allow them to be initialized when an 
@@ -30,7 +32,7 @@ template<typename ValueTy>
 class StringMapEntryInitializer {
 public:
   template <typename InitTy>
-  static void Initialize(ValueTy &T, InitTy InitVal) {
+  static void Initialize(StringMapEntry<ValueTy> &T, InitTy InitVal) {
   }
 };
   
@@ -168,7 +170,7 @@ public:
     StrBuffer[KeyLength] = 0;  // Null terminate for convenience of clients.
     
     // Initialize the value if the client wants to.
-    StringMapEntryInitializer<ValueTy>::Initialize(NewItem->getValue(),InitVal);
+    StringMapEntryInitializer<ValueTy>::Initialize(*NewItem, InitVal);
     return NewItem;
   }