This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: More __comp_ctor () woes
On Tue, 2006-10-24 at 03:32 +0000, Brendon Costa wrote:
> Sorry that my previous email was unclear. I have tried to clarify what i
> meant in this email by answering your questions.
>
>
> If there is a simple class like:
>
> class MyClass
> {
> MyClass()
> {}
> };
>
> int main()
> {
> MyClass c;
> return 0;
> }
>
> This will produce at least 3 FUNCTION_DECL nodes:
> 1) main()
> 2) MyClass::MyClass(MyClass* this)
> 3) MyClass::__comp_ctor (MyClass* this)
>
> I call (2) a "User Constructor" for want of a better name. But note that
> BOTH (2) and (3) are considered "constructors" as returned by
> DECL_CONSTRUCTOR_P(fndecl)
This comes from the fact ABI has two constructors, an in charge and an
out of charge and the orginal constructor is still there though 3 is a
clone of (2). (2) is never compiled or called.
> I have the FUNCTION_DECL node for (3) and want to find (2) from it.
Why do you need to find (2)? It is not the function which is actually
called. DECL_SAVED_TREE might not be set but that is because it has
already been gimplified and lowered to CFG at the time you are looking
through the calls.
Why do you need to know the constructor anyways?
Thanks,
Andrew Pinski