On Tue, Jan 29, 2013 at 6:44 AM, Chassin <chas...@ceis.cujae.edu.cu> wrote:
> Hi again , this time i am trying to clone a function then insert it with new
> name
>
> sample code ....
>
> struct cgraph_node *old_node = util_get_cgnode_by_name((char *)user_data);
> struct cgraph_node *new_node ;
>
> tree old_decl = old_node->decl;
> tree new_decl = copy_node(old_decl);
>
>
> // Changing the name ....
> DECL_STRUCT_FUNCTION (new_decl) = NULL;
> DECL_NAME (new_decl) = clone_function_name (old_decl, "_X");
> SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl));
> SET_DECL_RTL (new_decl, NULL);
> new_node = cgraph_clone_node (old_node, new_decl,
> old_node->count,CGRAPH_FREQ_BASE, 0, false,NULL);
> cgraph_add_new_function(new_decl,false);
>
>
> this is hooked to PLUGIN_ALL_IPA_PASSES_END , but its raises an error in the
> line ( cgraph_add_new_function ) , why ?

You should use cgraph_function_versioning.

Richard.

> --
> Chaddy Huussin Vazquez , chas...@ceis.cujae.edu.cu
>
> Superior Polytechnic Institute ‘Jose Antonio Echeverrıa’
> Informatics Engineering Faculty
>
>
>
> 48 Aniversario del Instituto Superior Politecnico Jose Antonio Echeverria,
> Cujae
> Una obra de la Revolucion Cubana | 2 de diciembre de 1964 |
> http://cujae.edu.cu
>
>
>
> Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu

Reply via email to