From: Richard Biener <richard.guenther@gmail.com>
To: Martin Jambor <mjambor@suse.cz>
Cc: Gary Oblock <goblock@marvell.com>, GCC Development <gcc@gcc.gnu.org>
Subject: Re: How does one traverse all the global decls
Date: Thu, 22 Aug 2019 10:49:00 -0000 [thread overview]
Message-ID: <CAFiYyc16uq-AiYoSPLTD82WWFbd_=yWYBuQvZBDTea_cfZTb=w@mail.gmail.com> (raw)
In-Reply-To: <ri6lfvlef0p.fsf@suse.cz>
On Thu, Aug 22, 2019 at 11:16 AM Martin Jambor <mjambor@suse.cz> wrote:
>
> Hi,
>
> On Wed, Aug 21 2019, Gary Oblock wrote:
> > I'm trying to do some analysis code for an optimization
> > that involves my code looking at all the declarations and
> > types there of during the link time optimizations.
> >
> > Note, doing this for the local variables seems to be trivial
> > because of FOR_EACH_LOCAL_DECL and there are also
> > obvious ways of getting at the type information once I have
> > a decl. However, I can't seem to find any similar way of
> > getting at the global level decls.
> >
> > I'd appreciate your help on this.
> >
>
> Look at FOR_EACH_VARIABLE defined in cgraph.h (because symtab.h does not
> exist) and it's various uses throughout the compiler.
There's also IPA-REFs so you can iterate over references of global
variables (not sure if there's a nice FOR_EACH interface for that).
Richard.
>
> Martin
next prev parent reply other threads:[~2019-08-22 10:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-21 21:33 Gary Oblock
2019-08-22 9:16 ` Martin Jambor
2019-08-22 10:49 ` Richard Biener [this message]
2019-08-22 18:19 ` [EXT] " Gary Oblock
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='CAFiYyc16uq-AiYoSPLTD82WWFbd_=yWYBuQvZBDTea_cfZTb=w@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc@gcc.gnu.org \
--cc=goblock@marvell.com \
--cc=mjambor@suse.cz \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).