> On May 5, 2015, at 8:07 PM, David Blaikie <[email protected]> wrote:
> 
> If we believe hash collisions to be an issue - then type units are broken and 
> I'd like to figure out how to fix them, then use the same feature here.
>  

This led me to perform a little experiment: I had a python script calculate the 
MD5 sum of ~60.000 unique mangled type names that I extracted from the IR of a 
clang LTO build. There was not a single collision in the abbreviated 64-bit 
hashes, and I had to truncate the length of the hash values to 32 bits before I 
was able to produced even a single collision.

I think now that hash collisions might be a red herring and a calculable risk 
that we can decide to ignore.

The only thing that we cannot ignore here is that for ODR-less languages two 
types may legally have the same mangled name (and thus hash) when they are 
defined in two different modules. This means we can’t use type units for these 
languages and external type reference must be a pair of mangled name and module.

-- adrian
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to