> On Oct 4, 2016, at 4:25 AM, David Vandevoorde <[email protected]> wrote:
> Shouldn't the ABI document specify how type_info entries are collated and 
> hashed with their before() and hash_code() members?

Yes, that seems reasonable.  It's only necessary for interoperation of multiple 
standard libraries on a platform, but that's a thing.

Since the ABI only formally guarantees that the names are uniqued, I think the 
obviously correct way of implementing these is to compare name pointers in 
before() and reinterpret the name pointer as the result of hash_code().  That 
is what libc++ seems to do.  I don't have a recent libstdc++ header around; the 
ancient one I do have uses that rule for before() and doesn't implement 
hash_code(), but IIRC these days libstdc++ uses a variant ABI for type_info 
anyway.

Darwin ARM64 uses a variant ABI that does not guarantee that names are uniqued, 
and so we need a different rule there to handle that; in particular, it does 
actually have to fall back on string comparisons and string hashes for 
non-unique type info.

John.
_______________________________________________
cxx-abi-dev mailing list
[email protected]
http://sourcerytools.com/cgi-bin/mailman/listinfo/cxx-abi-dev

Reply via email to