Re: suggestion for Merging LLVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 15, 2011 at 11:34 PM, Christopher Li <sparse@xxxxxxxxxxx> wrote:
> I have one question regarding this change:
> 2ded1e7406914eda77abde035416140849d76f68
>
>    sparse: Bump up sizeof(_Bool) to 8 bits
>
>    We need sizeof(_Bool) to be one byte to generate code for boolean
> expressions
>    in the LLVM backend.
>
> Sparse already evaluate sizeof(_Bool) as 8 bits. It current just give warnings.
> Will remove the warning sufficient to make sparse-llvm happy?
> I take a look at the code LLVM generate, It seem LLVM treat _Bool as 1
> bit integer
> as well. Can we not change the internal representation of _Bool, only
> the sizeof(_Bool)?

No, it's not sufficient right now. For something like this:

#include <stdbool.h>

bool is_zero(int x)
{
	return !x;
}

you'd get:

[penberg@tux sparse]$ ./sparse-llvm bool.c
bool.c:3:6: warning: symbol 'is_zero' was not declared. Should it be static?
invalid bit size 1 for type 2

if you revert the commit. However, LLVM 3.0 seems to support 1 bit
integer types so we can probably clean that up.

                                Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux