comp.lang.ada
 help / color / mirror / Atom feed
* limitations on optimizers for conditional compilation
@ 1989-12-11  2:02 Emery
  1989-12-11 15:58 ` "limitations" of " William Thomas Wolfe, 2847 
  1989-12-11 20:10 ` limitations on optimizers for " Robert Munck
  0 siblings, 2 replies; 7+ messages in thread
From: Emery @ 1989-12-11  2:02 UTC (permalink / raw)


Armin points out that it is perfectly legal to do conditional
compilation of statements based on some (constant) boolean value.
This is something I'd expect a good compiler to do, and a technique
that I have used (sending prayers to the God of Compilers that my
compiler was "good").   

Where this approach fails, though, is in non-statements such as type
declarations.  It would be nice to have support for this:
	type foo_bar is 
	  record
	    x : integer;
#ifdef VAX
	    y : float_64;
#elsif IBM_PC_WITH_8087
	    y : IEEE_float;
#endif
	end record;

I suspect that the very clever person could use variant records for
this example, but I also suspect that it wouldn't take much to come up
with type definitions where a variant record approach wouldn't work.

Using these ("constant type") variant records would probably make the
program harder to read, because it wouldn't be clear to the maintainer
if this was a variant record object (or subtype) based on some 'real
variant) or based on some conditional compilation feature.  Objects
are often widely separated from their declaration, compared to
(optimizable) conditional compilation statements.
				dave 
				emery@aries.mitre.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1989-12-15 20:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-12-11  2:02 limitations on optimizers for conditional compilation Emery
1989-12-11 15:58 ` "limitations" of " William Thomas Wolfe, 2847 
1989-12-12 21:10   `  Sun Visualization Products
1989-12-13 17:33   ` Andy DeFaria
1989-12-14 20:56     ` William Thomas Wolfe, 2847 
1989-12-15 20:05   ` Andy DeFaria
1989-12-11 20:10 ` limitations on optimizers for " Robert Munck

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