This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] AST optimizer in C++?

Per Bothner <> writes:

| Pop Sébastian wrote:
| > Keeping the original tree structure as it is avoids to retranslate the 
| > representation back to trees once we're finished.  So I'm for abstraction.
| > I think that we should avoid is to deal with tree structure directly, and 
| > build an interface that will abstract existent structures (maybe tree 
| > structures will change).
| Perhaps something like:
| class Tree {
|     union tree_node *node;
| };

| Or:

| class Tree {
|    union tree_common common;
| }

Since the class Tree will base class, it is likely that we will
exclusively using pointers to Tree, then the second declaration saves
an unnecessary indirection.

And, if we were to be using C++, I'm not convinced that we would like
to use "union tree_code" whose purpose is solely to provide
polymorphic container type.  But, yes, I understand your point:

| Long term, I'd be in favor of re-writing the entire ocmpiler in C++,
| but as a migration strategy it has to be a *wrapper* around the
| existing tree types, and at least for now must allow boostrapping
| without an existing C++ compiler.  If the experiment looks promising,
| I'd be open to switching the entire compiler to C++, again assuming
| it can be done incrmentally, without a total re-write!

Well, I have some impression that there are some sentiment against C++
somewhere... Well, I wish that impression were wrong...

-- Gaby

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]