[cfe-commits] r42253 - /cfe/trunk/include/clang/Analysis/DataflowValues.h

Chris Lattner sabre at nondot.org
Sun Sep 23 21:04:10 PDT 2007


On Sep 23, 2007, at 8:53 PM, Ted Kremenek wrote:

> I'm not even certain if what I coded is a good hash function. It was
> a hack (based on code I saw in DenseMap.h) to get things working.
> Suggestions?

Until you have big enough inputs for the hash function to matter, I  
wouldn't worry about it.  When you do, you can profile various options.

-Chris

> On Sep 23, 2007, at 4:53 PM, Chris Lattner wrote:
>
>> Author: lattner
>> Date: Sun Sep 23 18:53:07 2007
>> New Revision: 42253
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=42253&view=rev
>> Log:
>> Fix for 64-bit systems.
>>
>> Modified:
>>     cfe/trunk/include/clang/Analysis/DataflowValues.h
>>
>> Modified: cfe/trunk/include/clang/Analysis/DataflowValues.h
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/
>> Analysis/DataflowValues.h?rev=42253&r1=42252&r2=42253&view=diff
>>
>> ===================================================================== 
>> =
>> ========
>> --- cfe/trunk/include/clang/Analysis/DataflowValues.h (original)
>> +++ cfe/trunk/include/clang/Analysis/DataflowValues.h Sun Sep 23
>> 18:53:07 2007
>> @@ -37,10 +37,10 @@
>>      static unsigned getHashValue(const clang::CFG::Edge& E) {
>>        const clang::CFGBlock* P1 = E.getSrc();
>>        const clang::CFGBlock* P2 = E.getDst();
>> -      return (reinterpret_cast<unsigned>(P1) >> 4) ^
>> -      (reinterpret_cast<unsigned>(P1) >> 9) ^
>> -      (reinterpret_cast<unsigned>(P2) >> 5) ^
>> -      (reinterpret_cast<unsigned>(P2) >> 10);
>> +      return static_cast<unsigned>((reinterpret_cast<uintptr_t>
>> (P1) >> 4) ^
>> +                                   (reinterpret_cast<uintptr_t>
>> (P1) >> 9) ^
>> +                                   (reinterpret_cast<uintptr_t>
>> (P2) >> 5) ^
>> +                                   (reinterpret_cast<uintptr_t>
>> (P2) >> 10));
>>      }
>>
>>      static bool isEqual(const clang::CFG::Edge& LHS,
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list