[cfe-commits] r42253 - /cfe/trunk/include/clang/Analysis/DataflowValues.h

Ted Kremenek kremenek at apple.com
Sun Sep 23 20:53:44 PDT 2007


I'm not even certain if what I coded is a good hash function. It was  
a hack (based on code I saw in DenseMap.h) to get things working.   
Suggestions?

On Sep 23, 2007, at 4:53 PM, Chris Lattner wrote:

> Author: lattner
> Date: Sun Sep 23 18:53:07 2007
> New Revision: 42253
>
> URL: http://llvm.org/viewvc/llvm-project?rev=42253&view=rev
> Log:
> Fix for 64-bit systems.
>
> Modified:
>     cfe/trunk/include/clang/Analysis/DataflowValues.h
>
> Modified: cfe/trunk/include/clang/Analysis/DataflowValues.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ 
> Analysis/DataflowValues.h?rev=42253&r1=42252&r2=42253&view=diff
>
> ====================================================================== 
> ========
> --- cfe/trunk/include/clang/Analysis/DataflowValues.h (original)
> +++ cfe/trunk/include/clang/Analysis/DataflowValues.h Sun Sep 23  
> 18:53:07 2007
> @@ -37,10 +37,10 @@
>      static unsigned getHashValue(const clang::CFG::Edge& E) {
>        const clang::CFGBlock* P1 = E.getSrc();
>        const clang::CFGBlock* P2 = E.getDst();
> -      return (reinterpret_cast<unsigned>(P1) >> 4) ^
> -      (reinterpret_cast<unsigned>(P1) >> 9) ^
> -      (reinterpret_cast<unsigned>(P2) >> 5) ^
> -      (reinterpret_cast<unsigned>(P2) >> 10);
> +      return static_cast<unsigned>((reinterpret_cast<uintptr_t> 
> (P1) >> 4) ^
> +                                   (reinterpret_cast<uintptr_t> 
> (P1) >> 9) ^
> +                                   (reinterpret_cast<uintptr_t> 
> (P2) >> 5) ^
> +                                   (reinterpret_cast<uintptr_t> 
> (P2) >> 10));
>      }
>
>      static bool isEqual(const clang::CFG::Edge& LHS,
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list