public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [gcc-plugin] hooking function declarations...
@ 2010-04-08  8:07 Paweł Sikora
  2010-04-10 18:40 ` Paweł Sikora
  2010-04-12 20:12 ` Diego Novillo
  0 siblings, 2 replies; 4+ messages in thread
From: Paweł Sikora @ 2010-04-08  8:07 UTC (permalink / raw)
  To: gcc-help

hi,

i'm working on some gcc plugin and need to access all declarations
for function and classes. hooking on plugin_finish_type and  
plugin_pre_genericize
gives me afaics only record_trees for declared classes.
how can i obtain (in easiest way) function decls?

thanks for hints.
BR,
Pawel.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gcc-plugin] hooking function declarations...
  2010-04-08  8:07 [gcc-plugin] hooking function declarations Paweł Sikora
@ 2010-04-10 18:40 ` Paweł Sikora
  2010-04-12 20:12 ` Diego Novillo
  1 sibling, 0 replies; 4+ messages in thread
From: Paweł Sikora @ 2010-04-10 18:40 UTC (permalink / raw)
  To: gcc-help

On Thursday 08 April 2010 09:06:54 Paweł Sikora wrote:
> hi,
> 
> i'm working on some gcc plugin and need to access all declarations
> for function and classes. hooking on plugin_finish_type and
> plugin_pre_genericize
> gives me afaics only record_trees for declared classes.
> how can i obtain (in easiest way) function decls?

i should notice that i'm compiling only external library *header*
and in such case the plugin_pre_genericize isn't invoked.
afaics plugin_pre_genericize is invoked for classic translation unit.
is it a lack of implemenation in header-precompilation machinery?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gcc-plugin] hooking function declarations...
  2010-04-08  8:07 [gcc-plugin] hooking function declarations Paweł Sikora
  2010-04-10 18:40 ` Paweł Sikora
@ 2010-04-12 20:12 ` Diego Novillo
  2010-04-13 18:46   ` Paweł Sikora
  1 sibling, 1 reply; 4+ messages in thread
From: Diego Novillo @ 2010-04-12 20:12 UTC (permalink / raw)
  To: Paweł Sikora; +Cc: gcc-help

On Thu, Apr 8, 2010 at 03:06, Paweł Sikora <pluto@agmk.net> wrote:

> gives me afaics only record_trees for declared classes.
> how can i obtain (in easiest way) function decls?

There is a patch that may give you what you want.
http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00315.html
It still has not been added to trunk, however.

Alternately, you could look at dehydra
(https://developer.mozilla.org/en/Dehydra) which had to solve a
similar problem.


Diego.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gcc-plugin] hooking function declarations...
  2010-04-12 20:12 ` Diego Novillo
@ 2010-04-13 18:46   ` Paweł Sikora
  0 siblings, 0 replies; 4+ messages in thread
From: Paweł Sikora @ 2010-04-13 18:46 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc-help

On Monday 12 April 2010 22:12:04 Diego Novillo wrote:
> On Thu, Apr 8, 2010 at 03:06, Paweł Sikora <pluto@agmk.net> wrote:
> > gives me afaics only record_trees for declared classes.
> > how can i obtain (in easiest way) function decls?
> 
> There is a patch that may give you what you want.
> http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00315.html

it looks nice but introduces a redudancy in hooking, e.g. it reports
class methods via PLUGIN_FINISH_DECL while suitable decls are available
via PLUGIN_FINISH_TYPE/TYPE_METHODS chain.
is such redudancy expected?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-13 18:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08  8:07 [gcc-plugin] hooking function declarations Paweł Sikora
2010-04-10 18:40 ` Paweł Sikora
2010-04-12 20:12 ` Diego Novillo
2010-04-13 18:46   ` Paweł Sikora

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).