EM_OPT(3ACK)

NAME
emopt - EM code peephole optimizer interface for compilers

SYNOPSIS
#define PEEPHOLE
#include <em.h>

O_init(wsize, psize)
arith wsize, psize;

int O_open(filename)
O_close()
int O_busy()
char *filename;

O_magic()

O_df_dlb(l)
O_df_dnam(s)
O_df_ilb(l)
label l; char *s;

O_pro(s, l)
O_pro_narg(s)
O_end(l)
O_end_narg()
char *s; arith l;

O_exa_dlb(l)
O_exa_dnam(s)
O_exp(s)
O_ina_dlb(l)
O_ina_dnam(s)
O_inp(s)
char *s; label l;

O_bss_cstp()
O_hol_cstp()
O_con_cstp()
O_rom_cstp()

#include <em_mes.h>
O_mes_begin(ms)
O_cstp()
O_mes_end()
int ms;

O_exc(c1, c2)
arith c1, c2;

O_mnem()
O_mnem_dlb()
O_mnem_dnam()
O_mnem_narg()

O_insertpart(id)
int id;

O_beginpart(id)
int id;

O_endpart(id)
int id;

DESCRIPTION
This package provides a procedural EM code peephole optimizer interface to be used in compilers and other EM code producing programs. The interface routines are identical to the EM_CODE(3) procedure interface except that all names have been replaced by O_xxx It is possible to convert a program that is currently using the EM_CODE interface to use this module instead by defining PEEPHOLE before including em.h. This defines a series of macros to map all the C_xxx names to the corresponding O_xxx names. The module in turn calls C_xxx routines to output the optimized code. Hence it is possible to add peephole optimization to any program that outputs EM code using the EM_CODE module.

Details of the O_xxx routines may be obtained by referring to the description of the corresponding C_xxx routine in EM_CODE(3).

FILES
~em/modules/h/em.h
~em/modules/lib/libemopt.a

MODULES
alloc(3), system(3), string(3), em_code(3)

SEE ALSO
em_nopt(1) em_code(3), read_em(3), em_mes(3)

DIAGNOSTICS
O_open returns 1 if the open is successful and 0 if not.

BUGS
It is not possible to indicate that the argument of O_con_cst () must be seen as an unsigned value.

AUTHOR
Bruce McKenzie <bruce@cantuar.UUCP>