public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: eashan gupta <gupta.eashan@gmail.com>
To: law@redhat.com
Cc: gcc-help@gcc.gnu.org
Subject: Re: Access RTX register information
Date: Thu, 7 May 2020 18:21:23 +0530	[thread overview]
Message-ID: <CAJT-Qf9EqiX3fzYHGUs9y3n1+UJb26WTk7n=Bgnnc1fvY86aQQ@mail.gmail.com> (raw)
In-Reply-To: <e377914b4365500398e8874684a2802535908a52.camel@redhat.com>

Hi,
Yes, thanks for replying.
The above command works but it returns an IDENTIFIER_NODE so it
requires IDENTIFIER_POINTER(DECL_NAME(CONST_CAST_TREE(REG_EXPR(object))))
to give the name of the variable.
Thanks.

Eashan

On Wed, May 6, 2020 at 11:05 PM Jeff Law <law@redhat.com> wrote:

> On Wed, 2020-05-06 at 05:12 +0530, eashan gupta wrote:
> > Hi,
> > Thanks a lot for replying.
> > I have tried tracing the print_rtl_single too following the REG_EXPR but
> it
> > ends up in the code of printing the complete tree.
> Right.  It's that tree structure that will have the name emebedded in it.
>
> >
> > Is it possible to access this information directly, ie get the variable
> name
> > stored in a string instead of printing it out?
> Probably something like DECL_NAME (REG_EXPR (object)) or
> DECL_ASSEMBLER_NAME
> (REG_EXPR (object))
>
>
> > I am not too familiar with the code for the tree and it would be very
> helpful
> > to me if I could get the method to get the variable name
> stored/extracted from
> > the tree.
> You're almost certainly going to need to refer to tree.h and tree.def to
> understand how to dig out the information you want.
>
> jeff
> >
>
>

      reply	other threads:[~2020-05-07 12:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 22:57 eashan gupta
2020-05-05 23:06 ` Jeff Law
2020-05-05 23:42   ` eashan gupta
2020-05-06 17:35     ` Jeff Law
2020-05-07 12:51       ` eashan gupta [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='CAJT-Qf9EqiX3fzYHGUs9y3n1+UJb26WTk7n=Bgnnc1fvY86aQQ@mail.gmail.com' \
    --to=gupta.eashan@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=law@redhat.com \
    /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).