[llvm-commits] [llvm] r173563 - fix use of std::std. it's ordered set.

reed kotler rkotler at mips.com
Sat Jan 26 00:47:11 PST 2013


On 01/25/2013 11:18 PM, David Blaikie wrote:
> On Fri, Jan 25, 2013 at 10:58 PM, Reed Kotler <rkotler at mips.com> wrote:
>> Author: rkotler
>> Date: Sat Jan 26 00:58:35 2013
>> New Revision: 173563
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=173563&view=rev
>> Log:
>> fix use of std::std. it's ordered set.
> Any chance of a test case?
I'm trying to figure out how the code I had before passed test-suite for 
mips16 hard-float with that bug.  lol.

I was in a hurry and wanted to work around that soft float signature bug 
and didn't read that
std::set is ordered. i've never used that class before. i usually write 
my own.

when you get old you've already worked with 2000 different set classes 
or packages of
one type or another in literally a hundred or more languages.  they all 
merge together and i just think of math where a set is not ordered 
unless you say it's an ordered set.

In c++ it's ordered until you get to c++2011 and then there are 
unordered sets.

>>
>> Modified:
>>      llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
>>
>> Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=173563&r1=173562&r2=173563&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
>> +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Sat Jan 26 00:58:35 2013
>> @@ -206,14 +206,14 @@ const char *MipsTargetLowering::getTarge
>>   }
>>
>>   namespace {
>> -  struct eqstr {
>> +  struct ltstr {
>>       bool operator()(const char *s1, const char *s2) const
>>       {
>> -      return strcmp(s1, s2) == 0;
>> +      return strcmp(s1, s2) < 0;
>>       }
>>     };
>>
>> -  std::set<const char*, eqstr> noHelperNeeded;
>> +  std::set<const char*, ltstr> noHelperNeeded;
>>
>>     const char* addToNoHelperNeeded(const char* s) {
>>       noHelperNeeded.insert(s);
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list