Re: [RFC v0 0/4] Give a type to constants too

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

 



On Thu, Mar 16, 2017 at 11:04 AM, Dibyendu Majumdar
<mobile@xxxxxxxxxxxxxxx> wrote:
>
> I think that having the size and information whether an integer
> constant is an integer or pointer should be good enough

The thing is, I don't think you should should actually look at the
pseudo for that AT ALL.

The size is encoded in the operation itself, and that's what you should use.

Now, the "integer vs pointer" thing is perhaps more interesting. We do
*not* encode that, and we use the same "add" operation for both
integers and pointer values. That's because basically linearization
treats pointers as integers too, although we do actually keep the
pseudos separate because we consider casts to/from pointers to be
special (so they aren't _purely_ just integers).

So the instruction itself has

 - size

 - sign

 - _much_ of optype

and I think that the proper long-term fix is perhaps to try to make
that "much" into "all". And part of that may actually be about getting
rid of some of the type differences entirely (ie turn pointers truly
into just pointer-sized integers, the way they almost are already).

That does mean that the llvm interface would need to use even more
explicit casts to make llvm happy.

                Linus
--
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