Hi again,
Yes. You can start by calling it in the same place cgraph_create_edges ()
is been called. (cgraph_analyze_function ())
To be able to do that, probably I will need to register a new token
(i.e. MY_PRAGMA_TOKEN) and build a node of this token within the
pragma handler (in c-pragma.c).
>
> And the code crashes at the macro FOR_EACH_BB_FN.. This is exatly as
> it is implemented in cgraph_create_edges() function.. but I think that
> the problem is because I call it at wrong time (too early, or too late
> - before or after parsing).. Could it be?
Yes. You can start by calling it
Hi Revital,
Because of doing copy, paste I forgot to delete one line from the CASE
1 example:
Instead:
> /* below I pass a the tree of the current_function_decl a global
> variable in tree.h */
> this_cfun = DECL_STRUCT_FUNCTION(current_function_decl);
> FOR_EACH_BB_FN(bb, this_cfu
> /* below I pass a the tree of the current_function_decl a global
> variable in tree.h */
> this_cfun = DECL_STRUCT_FUNCTION(current_function_decl);
> FOR_EACH_BB_FN(bb, this_cfun) /* Crashes here, Also tried with
> FOR_EACH_BB */
> for (bsi = bsi_start(bb); !bsi_end_p(bsi); b
Hi,
In file "c-pragma.c" I try to implement my custom pragma handler where
I try to traverse the statements within the function where the pragma
is detected. To implement the traversal I used the implementation of
"cgraph_create_edges" function as reference (in cgraphunit.c file).
My code is as
On Dec 5, 2006, at 3:14 AM, Ferad Zyulkyarov wrote:
Also, having the opportunity, I would like to ask you if there is any
function to use for deleting a tree
ggc_free if you _know_ it is free.
Ferad Zyulkyarov writes:
>
> Also, having the opportunity, I would like to ask you if there is any
> function to use for deleting a tree (most particularly a statement or
> variable declaration tree) or it would be enough to assign it as NULL
> (which does not seems to be a gentle solution).
Hi Revital,
Thank you very much.. This is very helpful. I was about to lost myself
in the code. I will try to experiment with your advices.
Also, having the opportunity, I would like to ask you if there is any
function to use for deleting a tree (most particularly a statement or
variable declara
> I try to change the front-end tree structure of a c/c++ program as a
> side effect of execution of a pragma. The operations that are involved
> is to walk through in a tree (i.e "C" block), insertion of a tree
> (i.e. statement, block, declaration) in the abstract syntax tree and
> deletion of a