public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: Yunfeng ZHANG <zyf.zeroos@gmail.com>
Cc: gcc-patches@gcc.gnu.org,
	"Joseph S. Myers" <joseph@codesourcery.com>,
	       Dave Korn <dave.korn.cygwin@googlemail.com>,
	       Tom Tromey <tromey@redhat.com>
Subject: Re: [PATCH 1/2] gcc symbol database
Date: Wed, 18 Jul 2012 08:04:00 -0000	[thread overview]
Message-ID: <m3bojdsdfw.fsf@redhat.com> (raw)
In-Reply-To: <CA+dUcj3Xh-ZvTorG9WM84HDSuj_2O+htzAT=QLTB9HbZ49Fsiw@mail.gmail.com>	(Yunfeng ZHANG's message of "Wed, 18 Jul 2012 10:10:56 +0800")

Yunfeng ZHANG <zyf.zeroos@gmail.com> writes:

>> It took me a couple of minutes to understand what you meant here, so
>> please let me re-phrase to make sure I got it.
>>
>> You are saying that the callback function of the cb_lex_token event is
>> set by the callback function of the macro_start_expand event.
>>
>> Is that correct?
>
> Yes.

Thank you for making this clear.

>> And this makes me wonder why you'd need the second parameter of
>> macro_start_expand (the token).  I believe you should have all the
>> information you need with the first, second, and last parameter.  As I
>> said in my previous email, you can get the file offset of the token in
>> your client code by doing 'file_offset = line + column'.  So that token
>> should not be needed.  Thus, calling macro_start_expand from inside
>> funlike_invocation_p once you are sure the expansion of the macro is
>> going to take place, is possible.
>
> The only thing is the file-offset or source_location of the macro
> leader token.

To try to avoid confusion, I think what you call "source_location of the
macro leader token" is actually the spelling location of the macro.

> I don't know how to get it when macro_start_expand is called in
> funlike_invocation_p intern.

[...]

> BTW, I can change my plugin to use line/column instead of fileoffset, there
> ins't design limitation, only time.

I think you can add a new source_location parameter to
funlike_invocation_p function, and pass it the result->src_loc that you
need.

-- 
		Dodji

  reply	other threads:[~2012-07-18  8:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+dUcj3G+MhuQSOQVo5H=wK7R8PQ0MSOdX_s0+xM_ZvXXJkCJQ@mail.gmail.com>
2012-06-04 14:02 ` Dodji Seketeli
2012-06-05  6:56   ` Yunfeng ZHANG
2012-06-21  7:48     ` Yunfeng ZHANG
2012-06-27  8:46       ` Yunfeng ZHANG
2012-07-13 19:32       ` Dodji Seketeli
2012-07-16 10:09         ` Yunfeng ZHANG
2012-07-16 15:31           ` Dodji Seketeli
2012-07-17  7:14             ` Yunfeng ZHANG
2012-07-17  9:06               ` Dodji Seketeli
2012-07-18  2:11                 ` Yunfeng ZHANG
2012-07-18  8:04                   ` Dodji Seketeli [this message]
2012-07-19  1:18                     ` Yunfeng ZHANG
2012-07-19  7:04                       ` Yunfeng ZHANG
2012-07-19  8:06                         ` Dodji Seketeli
2012-08-06  5:37                           ` Yunfeng ZHANG
2012-08-13  6:44                             ` Dodji Seketeli
2012-09-06  1:34                               ` Yunfeng ZHANG
2012-05-28  8:41 Yunfeng ZHANG

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=m3bojdsdfw.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=dave.korn.cygwin@googlemail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=tromey@redhat.com \
    --cc=zyf.zeroos@gmail.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).