Finding all CALL_EXPR tree nodes during GENERIC

2017-11-18 Thread Katsunori Kumatani
Hello, I'm doing some testing with a gcc plugin (also helped me understand a lot of how GCC works) but I've hit a roadblock. I want to find all of a function body's CALL_EXPR nodes (i.e. what calls it has) early during GENERIC, so I assume the PLUGIN_PRE_GENERICIZE hook is what I should use right?

Re: Finding all CALL_EXPR tree nodes during GENERIC

2017-11-19 Thread Katsunori Kumatani
lk_tree_fn is a tree* right? That would be useful to know too. On Sat, Nov 18, 2017 at 6:49 PM, Richard Biener wrote: > On November 18, 2017 5:38:35 PM GMT+01:00, Katsunori Kumatani > wrote: >>Hello, I'm doing some testing with a gcc plugin (also helped me >>understand

Re: Finding all CALL_EXPR tree nodes during GENERIC

2017-11-21 Thread Katsunori Kumatani
On Mon, Nov 20, 2017 at 12:32 PM, Richard Biener wrote: > On Sun, Nov 19, 2017 at 9:27 PM, Katsunori Kumatani > wrote: >> Yes, it seems walk_tree does the job, I was probably doing something >> wrong before. Thank you. >> >> I have a question about it. Am I corr

GCC Plugin Callback on template instantiation (or constexpr call evaluation)

2017-12-09 Thread Katsunori Kumatani
For a GCC plugin, is there a way to have a callback registered/get called on template instantiation of a type with an attribute or some other means? Consider: template struct foo { typedef T __attribute__((bar)) type; }; void foobar(foo::type); In this case, the attribute handler callback gets c

Re: GCC contribution

2018-03-28 Thread Katsunori Kumatani
Please don't change the lang_hooks into virtual methods. Speaking from a plugin development viewpoint, C hooks are very easy to override individually, without having to change the entire object or create a new one. I realize that it's not the intended use for the hooks, and not why they were

Re: GCC contribution

2018-03-29 Thread Katsunori Kumatani
On Thu, Mar 29, 2018 at 8:01 PM, Mikhail Maltsev wrote: > On Wed, Mar 28, 2018 at 11:15 PM, Katsunori Kumatani > wrote: >> >> For example, I wanted to add some plugin processing (actually a top-level >> asm statement) at the end of a translation unit (with gathered data