This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to find function_decl by identifier in plugin
- From: Ivan Kulagin <kadet901 at gmail dot com>
- To: Mikhail Maltsev <maltsevm at gmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Mon, 26 Oct 2015 21:57:40 +0600
- Subject: Re: How to find function_decl by identifier in plugin
- Authentication-results: sourceware.org; auth=none
- References: <CANaLYJ_cQfebBfnB7PqDYFFu6cGCcW1Z0goKS+Z1tFRW0Vm80w at mail dot gmail dot com> <562E3919 dot 1000402 at gmail dot com>
Thank you for your reply!
>Does it work when GIMPLE representation is already built (just checking)?
It work with built GIMPLE representation (after pass_tm_edges).
> You probably need to use the symbol table. See the 'symbol_table' class
> defined in 'cgraph.h' (there is a global instance of this class, 'symtab').
I have tried to use symtab instance already, but it contains not full
list symbols... for example it doesn't contains some external
functions. You can to see this even on "hello world" program.
But, I have compiled a program with option -fdump-tree-all-all and
have analyzed the *.tu file (translation unit), and it contains the
all external declarations and the type declarations.
I actually don't understand why the symtab doesn't contains it. And
how can I get declarations from external scope?
Thank you!
-Ivan