On Mon, May 31, 2010 at 8:26 AM, Mark Mitchell <m...@codesourcery.com> wrote:
> I am pleased to report that the GCC Steering Committee and the FSF have
> approved the use of C++ in GCC itself.  Of course, there's no reason for
> us to use C++ features just because we can.  The goal is a better
> compiler for users, not a C++ code base for its own sake.
>

Outstanding decision!

C++ is an amazing language.

C++'s three main features(encapsulation, inheritance, polymorphism)
can greatly improve the GCC's code base, render it more modular and
readable and let GCC developer to think at a more abstract layer.

In GCC, there are too many data structures that can be encapsulated as
ADT(Abstract Data Type), like sbitmap, bitmap, struct real_value,
struct sreal, double_int, HWI,  etc. I will glad to see these data
structures can be used as conveniently as string in C++.


The complexity and irregularity of TREE and RTL  IRs may be the
biggest hurdle to use inheritance and polymorphism on them.


Language hooks and target hooks can be easily replaced by virtual methods.


I have FUD on the use of "advanced" C++ features like template(even
standard template), namespace, exceptions. This is partly because my
favorite source code analyzer can not handle them properly. I have
tried to use my favorite source code analyzer to analyze LLVM source
code, which use C++ standard template aggressively, the result is not
ideal . I also have tried to use it to analyze Open64 source code,
which does not use template, the result is much better .It would be
nice if there are another template-free encapsulation over standard
template.  For example, an template-free container encapsulating
standard container template.



-- 
徐持恒(Chiheng Xu)
Wuhan,China

Reply via email to