This is the mail archive of the
mailing list for the GCC project.
Fwd: GCC front end and GCC internals
- From: Andre Groenewald <adres dot is dot gevat at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 30 Mar 2017 08:05:07 +0200
- Subject: Fwd: GCC front end and GCC internals
- Authentication-results: sourceware.org; auth=none
- References: <CAHDABscuC-y=FS6SPJ1L3LG2oasHP-NCqFpwGKaUNUBMg6aTDw@mail.gmail.com>
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.