This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: GCC front end and GCC internals


I am discovering the awesome world of GCC internals. I managed to
develop a basic front end. It can call internal and external functions
and link with standard libraries. All is good.

The hunger for more does not end. I want to call c++ libraries and
interact with c++ objects.

My starting point was to call a test c++ method. I created a test c++
class with a test method/function. It was compiled into a library. The
library was tested with c++ program and it worked. I manage to call it
from my front end, but the parameter I passed was messed up. It was
some random value every time I called the method.

I disassembled my program and the test c++ program, then compared the
two. I found that it uses a different register as in the case when
calling a standard c style function.

It seems that methods are different in the calling convention than
normal functions, which is fine. All that I need to do is set correct
tree property and every will work, right? The question is what tree
property should I set, which macro should I use to set that property?

Please be patient with my English, it is not my first language.

Thank you all in advance.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]