public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: lars brinkhoff <lars@nocrew.org>
To: Joern Rennecke <amylaar@cygnus.co.uk>
Cc: gcc@gcc.gnu.org
Subject: Re: External or local SYMBOL_REF?
Date: Tue, 19 Sep 2000 10:10:00 -0000	[thread overview]
Message-ID: <8566nspauc.fsf@junk.nocrew.org> (raw)
In-Reply-To: <200009181305.OAA31836@phal.cygnus.co.uk>

Joern Rennecke <amylaar@cygnus.co.uk> writes:
> > If I have an rtx x for which GET_CODE (x) == SYMBOL_REF, how do I
> > find out whether the symbol is external or local?
> There no such information in the rtl in general.
> You can arrange for the inforamation to be extracted from the tree and
> encoded in the name of the symbol by defining ENCODE_SECTION_INFO.

Thanks.  This seems to work well:

#define ENCODE_SECTION_INFO(DECL)       encode_section_info(DECL)

#define SYMBOL_REF_EXTERNAL SYMBOL_REF_FLAG

void
encode_section_info (decl)
     tree decl;
{
  enum tree_code code = TREE_CODE (decl);
  if (code == VAR_DECL || code == FUNCTION_DECL)
    SYMBOL_REF_EXTERNAL (XEXP (DECL_RTL (decl), 0)) = !TREE_STATIC (decl);
}

      reply	other threads:[~2000-09-19 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-16 13:07 lars brinkhoff
2000-09-18  6:05 ` Joern Rennecke
2000-09-19 10:10   ` lars brinkhoff [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=8566nspauc.fsf@junk.nocrew.org \
    --to=lars@nocrew.org \
    --cc=amylaar@cygnus.co.uk \
    --cc=gcc@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).