Hi all,

I am working with GCC 4.1.1. I need some information on the following

Before emitting a call instruction, i need to check for function
attributes. Based on that i need to emit the corresponding call
instruction. For that, before emitting the call instruction, i check
for the attributes of the called function through the declaration
node.

tree fn_id, fn_decl;
fn_id = get_identifier(name);
fn_decl = lookup_name(fn_id);

This code works fine if none of the optimizations are enabled. But
this fails for all levels of optimization as i am not able to get the
function decl tree(lookup_name return NULL).

When compiling the code with -fno-funit-at-a-time switch, i am able to
get the function declaration node.

The ASTs are  converted into the SSA and eventually to the RTL
representations after parsing each function (O0 - No optimization )or
when the whole file is parsed (with optimization).

When the whole file is parsed, is it that the Function declaration
nodes are removed intentionally by GCC ?

In this context (with -funit-at-a-time), how will i be able to access
the function declaration node of the called function just before
emitting the assembly ?

Or should i save the function declaration nodes for further use?

can any one suggest a workaround!!

Thanks in advance,

Regards,
Rohit

Reply via email to