How to access the function body of a constructor?

Swati Rathi
Sat Nov 8 09:09:00 GMT 2014

This post is in continuation to my below post.

My pass is hooked after pass_ipa_pta as already mentioned below.
I have enabled the LTO framework by using the flags "-flto 

Without the LTO mode, macro DECL_CLONED_FUNCTION returns the cloned 
However, in the LTO mode this information is not available.

How do I make this information available in the LTO framework?
Is there any other way to get the cloned copy of the constructor 
"__base_ctor" from "__comp_ctor"?


On Monday 15 September 2014 03:41 PM, Swati Rathi wrote:
> I am trying to access the body of a constructor.
> My pass is hooked after pass_ipa_pta.
> Constructor for a class is invoked as :
>     __comp_ctor  (&b);
> However the constructor body is dumped as
>     __base_ctor  (struct B * const this)
>     {
>         :
>     }
> I am not able to access basic blocks from __comp_ctor?
> Is __comp_ctor a cloned function of  __base_ctor?
> Also assuming it to be a cloned function, I tried to access it using 
> "clones", "clones_of" fields of structure cgraph_node.
> But these fields does not store anything (or at least for the 
> functions I tried).
> What does these fields (clones, clone_of etc.) store?
> Will the macro DECL_CLONED_FUNCTION give me __base_ctor from 
> __comp_ctor ?
> I tried using it but it gives an error, "undefined symbol: 
> _Z22decl_cloned_function_pPK9tree_nodeb".
> Kindly tell me way to access the constructor body.
> Regards,
> Swati

More information about the Gcc mailing list