How to extract internal tree structure information?
Christian Wagner
christian.wagner@dnw-germany.aero
Wed Jul 26 09:21:00 GMT 2006
Hi,
Steven Bosscher wrote:
> On 7/25/06, Christian Wagner <christian.wagner@dnw-germany.aero> wrote:
>> Hi,
>>
>> I'm trying to extract information from C++ code during the compilation
>> process.
>> I need information about declarations, statements, functions (including
>> parameters and symbol name), source line and source file.
>
> Perhaps you can tell why?
Yes, I need this information to create a description of my source code as a
graph, like a call graph, but with more information on the nodes. Every code
line should be one node in the graph. If I have a function: I want to use the
symbol name to link the function to another graph which describes it. And I need
to identify the source file and the line to find the comments in the original
code file.
>> Could somebody please point out good places for me to add such a
>> function?
>> Could you please name tree structures which contain the full information?
>
> Look in gcc/cp/semantics.c, there's a function (I don't recall which)
> that finalizes the tree in the front end and hands it to the
> middle-end for gimplification (probably through a call to
> cgraph_finalize or something like that).
Thanks for the hint. It will take me some time to look into that.
Christian
More information about the Gcc
mailing list