This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: [BE] How to query attributes of a function being called?
- From: Ian Lance Taylor <iant at google dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 05 May 2009 22:49:00 -0700
- Subject: Re: [BE] How to query attributes of a function being called?
- References: <4A006F1F.3050002@gjlay.de>
Georg-Johann Lay <avr@gjlay.de> writes:
> Hi, suppose this test case of C code:
>
> typedef void (*cb_t)(void) __attribute__((callback));
>
> void caller (cb_t cb)
> {
> cb();
> }
>
> What I need in the backend is a way to query for the attributs that
> are attaches to callees like 'cb'.
>
> ./config/i386/winnt.c uses TARGET_MANGLE_DECL_ASSEMBLER_NAME in order
> to encode some information in the callee's name, but in my case the
> call may be indirect as indicated above.
It may work to look at the MEM_EXPR of the call operand and look at
DECL_ATTRIBUTES of that.
Ian