[llvm-commits] [llvm] r61922 - in /llvm/trunk: include/llvm/ADT/StringMap.h unittests/ADT/StringMapTest.cpp
Bill Wendling
isanbard at gmail.com
Thu Jan 8 14:25:00 PST 2009
On Thu, Jan 8, 2009 at 7:33 AM, Misha Brukman <brukman at gmail.com> wrote:
> 2009/1/8 Bill Wendling <isanbard at gmail.com>
>>
>> Modified: llvm/trunk/unittests/ADT/StringMapTest.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringMapTest.cpp?rev=61922&r1=61921&r2=61922&view=diff
>>
>>
>> ==============================================================================
>> --- llvm/trunk/unittests/ADT/StringMapTest.cpp (original)
>> +++ llvm/trunk/unittests/ADT/StringMapTest.cpp Thu Jan 8 02:26:46 2009
>> @@ -11,6 +11,19 @@
>> #include "llvm/ADT/StringMap.h"
>> using namespace llvm;
>>
>> +namespace llvm {
>> +
>> +template <>
>> +class StringMapEntryInitializer<uint32_t> {
>> +public:
>> + template <typename InitTy>
>> + static void Initialize(StringMapEntry<uint32_t> &T, InitTy InitVal) {
>> + T.second = InitVal;
>> + }
>> +};
>> +
>> +}
>> +
>
> Bill, I'm curious as to why you added this functionality to the unittest
> rather than directly into StringMap.h?
> Isn't this necessary there as well for correctness, or am I missing
> something?
>
The assignment in the original StringMapEntryInitializer should
probably be done for correctness. I didn't test that just yet, though.
For purposes of testing, we could have the Initialize do something
like add 37 to the InitVal and test that. (Just a thought.)
-bw
More information about the llvm-commits
mailing list