On 5/25/12, Paweł Sikora <pl...@agmk.net> wrote:
> On Friday 25 of May 2012 10:15:54 Diego Novillo wrote:
> > Lawrence, Ian and Gaby have been working on the proposed coding
> > guidelines for C++ (http://gcc.gnu.org/wiki/CppConventions).
>
> on this page we can read:
>
> "The following features of the C++ language should in general
> be avoided in GCC code.  (...)  Defining new templates (use of
> existing templates, e.g., from the standard library, is fine)."

That rule came from Ian's approach with gold.  It works well for
a new project.  It does not work well in gcc.

> so, why you just don't use the hash table implementation from
> libstdc++?

Diego and I looked long and hard at this issue.  It all came down
to a sequence of problems.  First, libstdc++ isn't rigged for GTY,
so we would have to instrument the library.  Second, the GTY parser
doesn't handle C++, so we would have to redo the GTY parser.  Third,
PCH requires gc, which requires GTY, so we cannot easily get rid
of gc.  Fourth, any use of libstdc++ will make different tradeoffs
in size and performance, so any switch would require both a change
in form and a change in substance.  We would simultaneously have
to show benefit on two axes, which is a predictor of trouble.

So, instead we chose to take a more incremental approach, exploiting
C++ with the existing algorithms and requiring mostly mechanical
changes in client code.  Both the hash table and vector patches
take that approach.

-- 
Lawrence Crowl

Reply via email to