[cfe-commits] r59173 - /cfe/trunk/include/clang/AST/TypeOrdering.h

Doug Gregor doug.gregor at gmail.com
Wed Nov 12 15:17:20 PST 2008


On Wed, Nov 12, 2008 at 5:58 PM, Sebastian Redl
<sebastian.redl at getdesigned.at> wrote:
> Douglas Gregor wrote:
>>
>> Author: dgregor
>> Date: Wed Nov 12 15:52:20 2008
>> New Revision: 59173
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=59173&view=rev
>> Log:
>> Slightly improve type hash
>>       static unsigned getHashValue(clang::QualType Val) {
>> -      return (unsigned)Val.getAsOpaquePtr();
>> +      return (unsigned)Val.getAsOpaquePtr() ^
>> +             ((unsigned)Val.getAsOpaquePtr() >> 9);
>>     }
>>
>
> This was already broken before this commit, but I'll mention it here: you
> can't cast a pointer to unsigned; it fails to compile on 64-bit systems such
> as mine. You must first cast to some integer type of sufficient size (e.g.
> size_t).

*Sigh*, sorry; someone else pointed this out earlier and I convinced
myself it wasn't an issue. Fixed now.

  - Doug



More information about the cfe-commits mailing list