1994-06-24 11:31:16 +00:00
|
|
|
/* $Id$ */
|
1987-03-09 19:15:41 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1984-11-26 15:04:22 +00:00
|
|
|
/* O U T P U T R O U T I N E S */
|
|
|
|
|
|
|
|
|
1984-11-29 10:11:37 +00:00
|
|
|
extern FILE *curoutp; /* current output file */
|
|
|
|
|
|
|
|
#define outbyte(b) putc(b,curoutp)
|
2017-11-15 21:29:27 +00:00
|
|
|
void outshort(short i); /*
|
1984-11-29 10:11:37 +00:00
|
|
|
* Write a short to curoutp
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
void outoff(offset off); /*
|
1984-11-29 10:11:37 +00:00
|
|
|
* Write an offset to curoutp
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
void outproc(proc_p p); /*
|
1988-09-02 13:55:54 +00:00
|
|
|
* Write a procid to curoutp
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
void putdtable(dblock_p head, FILE *df);
|
|
|
|
/*
|
1984-11-26 15:04:22 +00:00
|
|
|
* Write the data block table to file df,
|
|
|
|
* preceded by its length.
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
void putptable(proc_p head, FILE *pf, bool all);
|
|
|
|
/*
|
1984-11-26 15:04:22 +00:00
|
|
|
* Write the proc table to file pf,
|
|
|
|
* preceded by its length. If all=false,
|
|
|
|
* the fields computed by CF will not be
|
|
|
|
* written (used by the IC phase).
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
void putunit(short kind, proc_p p, line_p l, FILE *gf, FILE *lf);
|
|
|
|
/*
|
1984-11-26 15:04:22 +00:00
|
|
|
* If kind = LTEXT, then write
|
|
|
|
* the control flow graph to file gf,
|
|
|
|
* preceded by its length (#basic blocks);
|
|
|
|
* write the EM code of every basic block
|
|
|
|
* in the graph to file lf, preceded by
|
|
|
|
* the number of instructions in the block.
|
|
|
|
* Else, (kind = LDATA) just write the
|
|
|
|
* list of instructions (data declarations)
|
|
|
|
* to lf.
|
|
|
|
*/
|
2017-11-15 21:29:27 +00:00
|
|
|
short putlines(line_p l, FILE *lf);
|
|
|
|
/*
|
1984-11-26 15:04:22 +00:00
|
|
|
* Output the list of em instructions
|
|
|
|
* headed by l. Return the number of
|
|
|
|
* instructions written.
|
|
|
|
*/
|