comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Looking for a smart linker for GNAT/DOS
Date: 1997/04/23
Date: 1997-04-23T00:00:00+00:00	[thread overview]
Message-ID: <dewar.861815882@merv> (raw)
In-Reply-To: 335B6E77.4CC6@elca-matrix.ch


Mats Weber says

<<The subpackages in Text_IO are all generic, and GNAT implements generics
via macro expansion, so I don't see what this wins in exe size when
these generics are not instantiated. Or am I missing something ?
>>

Yes, you are missing something. Only a tiny part of these packages is
generic. All sorts of basic support code (e.g. basic conversion code)
is likely to be loaded anyway in typical text_io implementations. For
example, Float_IO uses some basic floationg-point conversion routines,
that are not loaded in GNAT if you do not instantiate Float_IO.

<<One of the situations where I would like dead code elimination in the
linker or compiler is in generic instances. It often happens that a
generic unit (e.g. AVL trees with set operations, iterators, etc.) is
instantiated very often with only a small subset of its operations being
used (e.g. Insert, Member and Remove) and all the other stuff is unused.
The compilers/linkers I have used so far do not eliminate this kind of
dead code. (I know I can split the generic using generic children, but
the code exists (Ada 83) and I don't want to do this).

>>

Right in Ada you would use generic children to achieve this reliably without
depending on your implementation to eliminate unused code, but that's not
possible in Ada 83. Obviously we cannot figure out solutions for existing
Ada 83 technology here :-)

<<Even if the new GNAT pragma approach seems to make this possible (if I
understand it correctly, and assuming that the pragma is allowed for
subprograms created via generic instantiation), the process will be
manual. Is there any chance of having this done automatically ?
>>

You do not understand it correctly, and I don't quite understand where
your incorrect understanding came from -- I guess I was not clear. There
will indeed be an automatic tool that generates the necessary directives
for the compialtion process. This in fact will be one of the first
ASIS-based tools for GNAT (a whole suite of such tools is in the planning
stages, now that ASIS is becoming a reality for GNAT).





  reply	other threads:[~1997-04-23  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1997Apr15.202909.5879@news>
1997-04-16  0:00 ` Looking for a smart linker for GNAT/DOS Samuel Tardieu
1997-04-16  0:00   ` Gautier
1997-04-18  0:00     ` Robert Dewar
1997-04-19  0:00       ` Geert Bosch
1997-04-22  0:00         ` Robert Dewar
1997-04-28  0:00         ` Larry Kilgallen
1997-04-19  0:00       ` Fergus Henderson
1997-04-21  0:00         ` Robert Dewar
1997-04-21  0:00           ` Gautier
1997-04-23  0:00             ` Robert Dewar
1997-04-24  0:00               ` Gautier
1997-04-26  0:00                 ` Robert Dewar
1997-04-27  0:00                 ` Geert Bosch
1997-04-29  0:00                   ` Gautier
1997-04-21  0:00       ` Mats Weber
1997-04-23  0:00         ` Robert Dewar [this message]
1997-04-21  0:00       ` Gautier
     [not found] ` <dewar.861173085@merv>
1997-04-17  0:00   ` Gautier
1997-04-17  0:00     ` Robert Dewar
1997-04-18  0:00       ` Gautier
1997-04-19  0:00         ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox