[llvm] r261071 - Fix the hash function.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 05:29:42 PST 2016


Binding | tighter is the intended behavior in the DWARF spec, the
warning is fixed in r261207.

That being said, this commit should've come with a test case ...

On Thu, Feb 18, 2016 at 3:39 AM, David Jones via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> This change appears to trigger -Werror=parentheses. I've attached two
> patches: one with the semantically equivalent change (binding the +
> more tightly than |), and another with what I believe is (probably?)
> the intended behavior (binding | tighter than +, which matches the
> original behavior of +=). Both pass check-llvm.
>
>
>
> On Tue, Feb 16, 2016 at 11:00 PM, David Blaikie via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> Author: dblaikie
>> Date: Wed Feb 17 01:00:22 2016
>> New Revision: 261071
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=261071&view=rev
>> Log:
>> Fix the hash function.
>>
>> Modified:
>>     llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
>>
>> Modified: llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp?rev=261071&r1=261070&r2=261071&view=diff
>> ==============================================================================
>> --- llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp (original)
>> +++ llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp Wed Feb 17 01:00:22 2016
>> @@ -203,7 +203,7 @@ static void writeIndex(MCStreamer &Out,
>>      while (Buckets[H]) {
>>        assert(S != IndexEntries[Buckets[H] - 1].Signature &&
>>               "Duplicate type unit");
>> -      H += ((S >> 32) & Mask) | 1;
>> +      H = (H + ((S >> 32) & Mask) | 1) % Buckets.size();
>>      }
>>      Buckets[H] = i + 1;
>>    }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>


More information about the llvm-commits mailing list