Re: Handling of local variables in the backend

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

 



On Wed, Sep 13, 2017 at 10:56:16AM +0100, Dibyendu Majumdar wrote:
> Hi Chris,
> 
> On 12 September 2017 at 23:44, Christopher Li <sparse@xxxxxxxxxxx> wrote:
> > On Tue, Sep 12, 2017 at 5:54 PM, Dibyendu Majumdar
> > <mobile@xxxxxxxxxxxxxxx> wrote:
> >>
> >> I think that there is no easy way to identify all the symbols used for
> >> which stack space is needed and do the allocas at the start - is
> >> there? I mean the only way is to go through all the instructions to
> >> find these references as far as I know.
> >
> >
> > Have you try the sym->symbol_list for the function node?
> > It should contain all the symbol used in that function.
> >
> 
> Did you mean struct entrypoint -> syms instead?
> I see that this contains a list of symbols ... I don't know if this is
> guaranteed to have all symbols defined in the function.

ep->accesses contains all the pseudos corresponding to the symbols
used for doing load & store accesses.

So, you probably should doing something like: 

	pseudo_t pseudo;

	FOR_EACH_PTR(ep->accesses, pseudo) {
		struct symbol *sym = pseudo->sym;
		unsigned log mods = sym->ctype.modifiers;

		if (mods & MOD_VOLATILE)
			...
		if (mods & (MOD_NONLOCAL | MOD_STATIC | MOD_ADDRESSABLE))
			...


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