Separating type_info classes into separate .o files

Mark Mitchell mark@codesourcery.com
Sat Mar 17 05:25:00 GMT 2007


Gabriel Dos Reis wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
> 
> [...]
> 
> | Do the libstdc++ maintainers have any objections to this change, in
> | principle?
> 
> I'm all for it with a caveat:

Here is the patch.  I've tested this on x86_64-unknown-linux-gnu, with
no regressions, and confirmed that this program:

  struct S {
    virtual void f();
  };
  void S::f() {}

  int main() {}

pulls in substantially fewer symbols.  In particular, the following
classes are no longer pulled in:

* bad_cast, bad_typeid
* dynamic_cast
* vmi_class_type_info

And, for this program:

  #include <typeinfo>

  const std::type_info* ti;

  int main () {
    ti = &typeid (int);
  }

we no longer pull in all of the type_info classes.

I plan to commit this in 24 hours, assuming no objections.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: type_info.patch
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070317/245dfeb2/attachment.ksh>


More information about the Libstdc++ mailing list