From: emery@MBUNIX.MITRE.ORG (Emery)
Subject: limitations on optimizers for conditional compilation
Date: 11 Dec 89 02:02:44 GMT [thread overview]
Message-ID: <8912110202.AA11909@mbunix.mitre.org> (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
next reply other threads:[~1989-12-11 2:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1989-12-11 2:02 Emery [this message]
1989-12-11 15:58 ` "limitations" of conditional compilation 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox