Commit graph

10 commits

Author SHA1 Message Date
carl 472654c366 ANSI C conversion and add procedure declarations. 2019-05-11 01:17:24 +08:00
George Koehler 87a2315037 strcmp, strncmp are in <string.h>
*Important:*  Do `make clean` to work around a problem and prevent
infinite rebuilds, https://github.com/davidgiven/ack/issues/68

I edit tokens.g in util/LLgen/src, so I regenerate tokens.c.  The
regeneration script bootstrap.sh can't find LLgen, but I can run the
same command by typing the path to llgen.
2017-11-14 17:35:35 -05:00
George Koehler ca4bd38206 Delete old "assert.h" files; use libc <assert.h>.
Edit build.lua for programs losing their private assert.h, so they
depend on a list of .h files excluding assert.h.

Remove modules/src/assert; it would be a dependency of cpp.ansi but we
didn't build it, so cpp.ansi uses the libc assert.

I hope that libc <assert.h> can better report failed assertions.  Some
old "assert.h" files didn't report the expression.  Some reported a
literal "x", because traditional C expanded the macro parameter x in
"x", but ANSI C89 doesn't expand macro parameters in string literals.
2017-11-09 22:22:13 -05:00
George Koehler 307a8b996e Add regvar_w() and regvar_d() for use with reglap.
If the ncg table uses reglap, then regvar($1, reg_float) would have
two sizes of registers.  An error from ncgg would happen if regvar()
was in a token that allows only one size.  Now one can pick a size
with regvar_w() for word size or regvar_d() for double-word size.

Add regvar_d and regvar_w as keywords in ncgg.  Modify EX_REGVAR to
include the register size.  In ncg, add some checks for the register
size.  In tables without reglap, regvar() works as before, and ncg
ignores the register size in EX_REGVAR.
2017-10-17 12:05:41 -04:00
George Koehler 7e9348169c Add reglap to ncg. Add 4-byte reg_float to PowerPC ncg.
The new feature "reglap" allows two sizes of floating-point register
variables (reg_float), if each register overlaps a single register of
the other size.  PowerPC ncg uses reglap to define 4-byte instances
of f14 to f31 that overlap the 8-byte instances.

When ncgg sees the definition of fs14("f14")=f14, it removes the
8-byte f14 from its rvnumbers array, and adds the 4-byte fs14 in its
place.  Later, when ncg puts a variable in fs14, if it is an 8-byte
variable, then ncg switches to the 8-byte f14.  The code has
/* reglap */ comments in util/ncgg or #ifdef REGLAP in mach/proto/ncg

reglap became necessary because my commit a20b87c caused PowerPC ego
to allocate reg_float in both 4-byte and 8-byte sizes.
2017-10-14 12:40:04 -04:00
dtrg cd09c29949 Rationalised use of #includes to be more standards-compliant. 2006-07-18 17:18:42 +00:00
ceriel 5c83e7dbb5 Header --> Id 1994-06-24 11:31:16 +00:00
ceriel 815166e421 Added copyright notice 1987-03-09 19:15:41 +00:00
ceriel 45238eea0f Some bug fixes and minor extensions 1987-01-16 13:51:42 +00:00
sater 72b83cca59 *** empty log message *** 1985-01-08 09:59:28 +00:00