Generation of GENERIC tree
charfi asma
charfiasma@yahoo.fr
Wed Jun 24 09:45:00 GMT 2009
Hello
I am interested too in the GENERIC
tree
I compile hello.cpp using g++
-fdump-tree-all, I do not get a generic intermediate representation,
there was (.tu, .class, .original, .gimple, .vcg ...)
To look at the GENERIC tree, I
compile hello.java using gcj (as mentioned in the answer bellow: "I
recommend looking at any gcc frontend other than the C/C++ frontends
to see how it is done....")
But when I compile java file using
the same option (fdump-tree-all) I do not get .generic as I expect..
Before .gimple, gcj generate only .original
is the GENERIC is represented by .original ?
compiling a java file, .original looks like this:
@1 function_decl name: @2 type: @3 scpe: @4
srcp: Hello.java:0 args: @5
extern inline body: @6
@2 identifier_node strg: <init> lngt: 6
@3 method_type size: @7 algn: 8 clas: @4
retn: @8 prms: @9
@4 record_type name: @10 size: @11 algn: 32
tag : struct flds: @12 fncs: @1
binf: @13
@5 parm_decl type: @14 scpe: @1 srcp: Hello.java:1
argt: @14 size: @11 algn: 32
..
compiling a c++ file, .original looks like this:
;; Function wchar_t* std::wcschr(wchar_t*, wchar_t) (_ZSt6wcschrPww)
;; enabled by -tree-original
return <retval> = wcschr ((const wchar_t *) __p, __c);
;; Function wchar_t* std::wcspbrk(wchar_t*, const wchar_t*) (_ZSt7wcspbrkPwPKw)
;; enabled by -tree-original
return <retval> = wcspbrk ((const wchar_t *) __s1, __s2);
...
When I red the gcc internals, TREE and GENERIC representations, I expect that I will find a code like c and c++ or a tree structure with TREE_LIST, TREE_CHAIN, ...
I have to study the GENERIC form, building a metamodel for this presentation, etc.
Can some one help me please, I am so confused.
Thank you very much.
Asma
----- Message d'origine ----
De : Ian Lance Taylor <iant@google.com>
À : Renuka Selvaraj <renukaselvaraj@acmet.com>
Cc : gcc-help@gcc.gnu.org
Envoyé le : Mardi, 28 Avril 2009, 16h59mn 02s
Objet : Re: Generation of GENERIC tree
"Renuka Selvaraj" <renukaselvaraj@acmet.com> writes:
> Please let me know how to generate GENERIC tree from parse tree and relative
> documents if any.
To generate GENERIC you call a bunch of buildN functions. I recommend
looking at any gcc frontend other than the C/C++ frontends to see how it
is done (the C/C++ frontends are not great examples for this because
they actually use GENERIC as the parse tree, so they don't do any
conversion).
I unfortunately don't know of any serious documentation for this. In
general the interface between the frontend and the middleend is not
really documented.
Ian
More information about the Gcc-help
mailing list