[llvm-commits] [llvm] r44432 - /llvm/trunk/include/llvm/ADT/StringMap.h

Chris Lattner sabre at nondot.org
Wed Nov 28 22:14:41 PST 2007


Author: lattner
Date: Thu Nov 29 00:14:41 2007
New Revision: 44432

URL: http://llvm.org/viewvc/llvm-project?rev=44432&view=rev
Log:
Pass the whole StringMapEntry into StringMapEntryInitializer::Initialize.

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=44432&r1=44431&r2=44432&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Thu Nov 29 00:14:41 2007
@@ -22,6 +22,8 @@
   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 @@
 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 @@
     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;
   }
   





More information about the llvm-commits mailing list