This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
help with front end and scopes
- From: Andre Groenewald <adres dot is dot gevat at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 12 Apr 2017 10:24:31 +0200
- Subject: help with front end and scopes
- Authentication-results: sourceware.org; auth=none
I am a bit stuck on global, file and local name spaces and scopes.
Normally my expression bindings is associated with a function, which
makes the function the scope of all the variables.
my front end can parse something like this:
int testfunc(int parmVar)
{
int testfuncVar;
}
int testfunc2(int funcVar)
{
int testfuncVar2;
}
Every function is individually gimplified and added and finalized.
Everything is chained and bind correctly.
parser->Fndecl = build_fn_decl(functionName, fnDeclType);
....
gimplify_function_tree(parser->Fndecl);
cgraph_node::finalize_function(parser->Fndecl, true);
I want to expand my front end to something like this:
module TestModule
{
int moduleVariable;
class TestClass
{
int classVariable;
int testfunc(int parmVar)
{
int testfuncVar;
}
}
}
The question is what should TestModule be declared as, what tree type
or declaration function, and also TestClass. How should TestModule be
gimplified and then finalized.
Thank you
André