This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] AST optimizer in C++?
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Pop Sébastian <pop at gauvain dot u-strasbg dot fr>
- Cc: Chris Lattner <sabre at nondot dot org>, dnovillo at redhat dot com,gcc at gcc dot gnu dot org
- Date: Tue, 27 Aug 2002 00:18:31 -0400
- Subject: Re: [tree-ssa] AST optimizer in C++?
Just an FYI, I reimplemented from scratch (so i wouldn't have to deal
with any revealing of code i've been asked not to reveal issues) the
graph_traits stuff, and their callgraph stuff, in a C++ based AST
Yep that's a nice interface for handling CFG nodes.
I saw something like this also in open64.
It's so simple to just say: iterate over all BB in topological order
and just write "for (topological_CFG::iterator i = ..."
The following code actually works:
static CallGraph temp; /* I'm just playing with the callgraph for right
now, so ignore this*/
extern "C" void update_and_print_call_graph (tree F)
/* Print out call graph in depth first order */
for (df_iterator<CallGraph *> I = df_begin (&temp,true), E=df_end
(&temp); I != E; ++I)
std::cout <<"Call graph node name:"<< IDENTIFIER_POINTER (DECL_NAME
(CGN>getFunction())) << std::endl;
I've yet to deal with the issue of a Tree class (either by conversion,
It's just something i play with from time to time.
Though if you guys want to play with a C++ based AST optimizer, i'll
throw it on a branch or something (It can construct callgraphs
incrementally, and a few other things).