[LLVMdev] We need better hashing

Jay Foad jay.foad at gmail.com
Fri Feb 17 00:56:17 PST 2012


On 17 February 2012 08:26, Talin <viridia at gmail.com> wrote:
> +  // Helper class to detect if the input type is 4-byte aligned.
> +  template<typename T>
> +  struct is_4byte_aligned {
> +    static const bool value = (sizeof(T) & 3) == 0;
> +  };

I don't think this is safe, e.g. for:

struct {
  char c[4];
}

Jay.



More information about the llvm-dev mailing list