[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

crutch installation



Date: Thu, 15 Feb 90 22:13:11 PST
   From: roland@xxxxxxxxxxx (Roland King)

   I can see two ways to do it: 1) make a CCC analogous to CC that runs the 
   preprocessor output for each file through the crutch then invokes CC
   with the appropriate substitutions.  Advantage: it treats the crutch
   as a fix to cfront, which, conceptually, is what it is. Disadvantage:
   you have the overhead of an extra pass even where you know you won't
   need it.  2) do it like stubble: the makefiles involved recognize
   some characteristic of the file name. BIG Disadvantage: it further
   complicates an already messy naming scheme.  As a kludgy solution, I
   suggest a #define HALE to be included at the beginning of source files
   that don't need the crutch.  

I suggest a variant of #1: make a CCC shell script analogous to the CC
shell script, except that it runs the crutch between cpp and cfront.
There's no need to go through cpp twice.  #1 itself is acceptable
though. 

I think #2 is quite wrong, because it embodies in our file structure &
our makefile code the fact that we're using crutch in front of our C++
compiler.  The point of view *should* be: We can build a more complete
compiler for the C++ language out of crutch plus AT&T's cfront.  The
result is simply a C++ compiler, not a separate tool.  Therefore it
should be invoked *as* a C++ compiler.

I like the idea of something like "#define HALE", but that particular
construct wouldn't work because crutch runs after cpp (when the
#define has already been removed).  I don't have a good alternative--
this is the kind of thing that people have suggested pragmas for, but
we should stay away from them.  Anyone have a better idea here?  Also,
the word "HALE" in the program sends the wrong message, because the
program itself is healthy either way, it's just cfront that's somewhat
diseased.  In any case, it is premature to worry about the overhead of
crutch until we find out: 1) how great this overhead is, and 2) how
often can one avoid it for real X++ programs.  I suspect the answer to
both of these will lead us to running crutch always.

   BTW when I run cpp on a file, then the crutch, then CC, it works
   but I get "undefined function" warnings.  Is there some magic I might
   be missing about sandwiching something between preprocessor and
   compiler?

Say more.  By itself the above doesn't ring a bell.  What function
does it say is undefined?  Where does it come from?  Who generates it?