C++ demangler horrors
Phil Edwards
phil@jaj.com
Thu Jun 26 20:37:00 GMT 2003
On Thu, Jun 26, 2003 at 03:12:06PM -0400, Kaveh R. Ghazi wrote:
> >
> > > Can't you write mini replacements?
> >
> > The one compiled in libiberty use <dynstring>, not <string>. I tried
> > mini <vector> once. But it seems not a small project, considering
> > all the <vector> features the demengler uses. I think my time is
> > better spent somewhere else.
>
> But if this represents a way out of the problem (and I don't know that
> it does) then we could list this in the "beginner" projects section
> and call for volunteers who know c++ to write this code for us.
I very much doubt if this is going to happen, for three reasons:
1) Nobody will write a C++ replacement for vector and string. That's just
unnecessary reinvention of the wheel.
2) There are plenty of C libraries that present vector-like and string-like
replacements (actually, all we'd need is vector, since we have
dyn-string), but we can't include them as part of the tree. More
reinvention.
3) The primary demangler author will almost certainly refuse to fold such
"backwards" steps into his code (and I don't blame him; I'd do the same
thing), which means that we would need volunteers to keep our "C++ with
no library" ("C++-"?) version in sync.
If someone volunteers to do #3, the problem is solved. If not, then maybe
something like
a) bootstrap as normal
b) build target libiberty with no demangling support
if c++ is an enabled language,
c) build libstdc++
d) build the demangler
e) fold the demangler objects into libiberty and libsupc++
end if
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams
More information about the Gcc
mailing list