17bc9cdef7
Most warnings are for functions implicitly returning int. Change most
of these functions to return void. (Traditional K&R C had no void
type, but C89 has it.)
Add prototypes to most function declarations in headers. This is
easy, because ego declares most of its extern functions, and the
comments listed most parameters. There were a few outdated or missing
declarations, and a few .c files that failed to include an .h with the
declarations.
Add prototypes to a few function definitions in .c files. Most
functions still have traditional K&R definitions. Most STATIC
functions still don't have prototypes, because they have no earlier
declaration where I would have added the prototype.
Change some prototypes in util/ego/share/alloc.h. Functions newmap()
and oldmap() handle an array of pointers to something; change the
array's type from `short **` to `void **`. Callers use casts to go
between `void **` and the correct type, like `line_p *`. Function
oldtable() takes a `short *`, not a `short **`; I added the wrong type
in 5bbbaf4
.
Make a few other changes to silence warnings. There are a few places
where clang wants extra parentheses in the code.
Edit util/ego/ra/build.lua to add the missing dependency on ra*.h; I
needed this to prevent crashes from ra.
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
/* $Id$ */
|
|
/*
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
*/
|
|
|
|
/* R E G I S T E R A L L O C A T I O N
|
|
*
|
|
* R A _ X F O R M . H
|
|
*/
|
|
|
|
void init_replacements(short psize, short wsize);
|
|
/*
|
|
* This routine must be called once, before
|
|
* any call to xform_proc. It initializes
|
|
* a machine dependent table.
|
|
*/
|
|
void xform_proc(proc_p p, alloc_p alloclist, short nrinstrs,
|
|
line_p instrmap[]);
|
|
/*
|
|
* Transform a procedure. Alloclist must
|
|
* contain the packed allocations (i.e. those
|
|
* allocations that are assigned a register).
|
|
*/
|
|
bool always_in_reg(offset off, alloc_p allocs, short *size_out);
|
|
/*
|
|
* See if the local variable with the given
|
|
* offset is stored in a register during its
|
|
* entire lifetime. As a side effect,
|
|
* return the size of the local.
|
|
*/
|
|
void rem_locals(proc_p p, alloc_p allocs);
|
|
/*
|
|
* Try to decrease the number of locals of
|
|
* procedure p, by looking at which locals
|
|
* are always stored in a register.
|
|
*/
|
|
void rem_formals(proc_p p, alloc_p allocs);
|
|
/*
|
|
* Try to decrease the number of formals of
|
|
* procedure p, by looking at which formals
|
|
* are always stored in a register.
|
|
*/
|