[llvm-commits] [llvm] r152300 - in /llvm/trunk: include/llvm/ADT/FoldingSet.h lib/Support/FoldingSet.cpp

Chandler Carruth chandlerc at google.com
Thu Mar 8 00:29:25 PST 2012


On Wed, Mar 7, 2012 at 11:42 PM, Daniel Dunbar <daniel at zuster.org> wrote:

> +inline void FoldingSetNodeID::AddPointer(const void *Ptr) {
> +  // Note: this adds pointers to the hash using sizes and endianness that
> +  // depend on the host.  It doesn't matter however, because hashing on
> +  // pointer values in inherently unstable.  Nothing  should depend on the
> +  // ordering of nodes in the folding set.
> +  if (sizeof(void*) == sizeof(unsigned))
> +    AddInteger((unsigned) (unsigned long long) Ptr);
> +  else if (sizeof(void*) == sizeof(unsigned long long)) {
> +    AddInteger((unsigned long long) Ptr);
>

Why not cast to uintptr_t, and ensure there is an AddInteger for that size?

Also, it looks like this patch is still causing significant regressions on
the build bots:
http://lab.llvm.org:8011/builders/llvm-x86_64-linux/builds/3517
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120308/bde5f94a/attachment.html>


More information about the llvm-commits mailing list