From: Dibyendu Majumdar <mobile@majumdar.org.uk>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Christopher Li <sparse@chrisli.org>,
Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: Handling of local variables in the backend
Date: Wed, 13 Sep 2017 11:22:24 +0100 [thread overview]
Message-ID: <CACXZuxfw51dA6Ye2wzHTw2FNVKvP1pnq0WiKZH+5E_8j1viJOw@mail.gmail.com> (raw)
In-Reply-To: <20170913101842.ax5eiyoe5dgliibe@ltop.local>
Hi Luc,
On 13 September 2017 at 11:18, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> 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@chrisli.org> wrote:
>> > On Tue, Sep 12, 2017 at 5:54 PM, Dibyendu Majumdar
>> > <mobile@majumdar.org.uk> 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))
> ...
>
>
Thanks. I will look at this.
Regards
Dibyendu
prev parent reply other threads:[~2017-09-13 10:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 21:54 Handling of local variables in the backend Dibyendu Majumdar
2017-09-12 22:44 ` Christopher Li
2017-09-13 9:56 ` Dibyendu Majumdar
2017-09-13 10:18 ` Luc Van Oostenryck
2017-09-13 10:22 ` Dibyendu Majumdar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACXZuxfw51dA6Ye2wzHTw2FNVKvP1pnq0WiKZH+5E_8j1viJOw@mail.gmail.com \
--to=mobile@majumdar.org.uk \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=sparse@chrisli.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).