em_mes.3 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. .TH EM_MES 3 "$Revision$"
  2. .ad
  3. .SH NAME
  4. em_mes \- EM-message generating routines
  5. .SH SYNOPSIS
  6. .nf
  7. .B #include <em.h>
  8. .PP
  9. .B C_ms_err()
  10. .PP
  11. .B C_ms_opt()
  12. .PP
  13. .B C_ms_emx(wsiz, psiz)
  14. .B arith wsiz, psiz;
  15. .PP
  16. .B #include <em_reg.h>
  17. .B C_ms_reg(offs, siz, class, prior)
  18. .B arith offs, siz;
  19. .B int class, prior;
  20. .PP
  21. .B C_ms_src(nlines, filnam)
  22. .B int nlines;
  23. .B char *filnam;
  24. .PP
  25. .B C_ms_flt()
  26. .PP
  27. .B C_ms_com(str)
  28. .B char *str;
  29. .PP
  30. .B C_ms_par(nparams)
  31. .B arith nparams;
  32. .PP
  33. .B #include <em_ego.h>
  34. .B C_ms_ego(hint, offs, siz, regno)
  35. .B int hint, regno;
  36. .B arith offs, siz;
  37. .PP
  38. .B C_ms_gto()
  39. .PP
  40. .B C_ms_stb_cst(s, e1, e2, e3)
  41. .B char *s;
  42. .B int e1, e2;
  43. .B arith e3;
  44. .PP
  45. .B C_ms_stb_dlb(s, e1, e2, l, off)
  46. .B char *s;
  47. .B int e1, e2;
  48. .B label l;
  49. .B arith off;
  50. .PP
  51. .B C_ms_stb_dnam(s, e1, e2, l, off)
  52. .B char *s;
  53. .B int e1, e2;
  54. .B char *l;
  55. .B arith off;
  56. .PP
  57. .B C_ms_stb_ilb(s, e1, e2, l)
  58. .B char *s;
  59. .B int e1, e2;
  60. .B label l;
  61. .PP
  62. .B C_ms_stb_pnam(s, e1, e2, p)
  63. .B char *s;
  64. .B int e1, e2;
  65. .B char *p;
  66. .PP
  67. .B C_ms_lin(l)
  68. .B int l;
  69. .fi
  70. .SH DESCRIPTION
  71. This set of routines forms a front end for the
  72. .IR em_code (3)
  73. module.
  74. The philosophy behind this package is to provide a single routine for
  75. each type of EM message that is generated by a front-end compiler.
  76. Each routine internally builds a message instruction by using the
  77. .BR C_mes_begin ,
  78. .B C_mes_end
  79. and the
  80. .BI C_ cstp
  81. routines from the
  82. .I em_code
  83. module.
  84. The actions taken by these functions depend on the type of
  85. .I em_code
  86. module that is loaded together with this module.
  87. The routines described here do not prevent the user from directly
  88. composing EM messages himself.
  89. .PP
  90. .BR C_ms_err ()
  91. generates a message that indicates some error during the compilation.
  92. .PP
  93. .BR C_ms_opt ()
  94. causes any optimization to be suppressed.
  95. .PP
  96. .BR C_ms_emx ()
  97. indicates the wordsize
  98. .I wsiz
  99. and pointersize
  100. .IR psiz .
  101. This must be the first code generated, or the generated code is illegal.
  102. .PP
  103. .BR C_ms_reg ()
  104. can be used to indicate that a local variable, having offset
  105. .I offs
  106. and size (in bytes)
  107. .IR siz ,
  108. may be stored in a register.
  109. .I Class
  110. indicates the use of the variable.
  111. The following classes are allowed (the names are defined in em_reg.h):
  112. .RS
  113. .IP reg_any 12
  114. no specific type
  115. .IP reg_loop 12
  116. loop control variable
  117. .IP reg_pointer 12
  118. pointer variable
  119. .IP reg_float 12
  120. floating point variable
  121. .LP
  122. .RE
  123. .I Prior
  124. is taken to be the priority of the variable; higher numbers indicate
  125. better candidates.
  126. .PP
  127. .BR C_ms_src ()
  128. produces an indication of the number of source lines,
  129. .IR nlines ,
  130. in file
  131. .IR filnam .
  132. This information can be used by a profiler.
  133. .PP
  134. .BR C_ms_flt ()
  135. produces an indication that floating-point operations are used.
  136. .PP
  137. .BR C_ms_com ()
  138. causes the string
  139. .I str
  140. to be inserted as comment in the resulting output.
  141. Note that this routine does not provide the full semantics of EM in this
  142. area, but the user himself can build a comment message with other types
  143. of comment if he likes.
  144. .PP
  145. .BR C_ms_par ()
  146. produces an indication that no more than
  147. .I nbytes
  148. of parameters are accessed, either directly or indirectly.
  149. .PP
  150. .BR C_ms_ego ()
  151. produces a hint from the EM global optimizer.
  152. The parameters needed are conform to the format of the message.
  153. .PP
  154. .BR C_ms_gto ()
  155. can be invoked to indicate that a procedure uses a non-local goto.
  156. .PP
  157. The
  158. .B C_ms_stb
  159. and
  160. .B C_ms_lin
  161. routines produce a message that a back-end can use for (debugger) symbol table
  162. entries.
  163. .SH FILES
  164. .nf
  165. ~em/modules/h/em.h
  166. ~em/h/em_reg.h
  167. ~em/h/em_ego.h
  168. ~em/modules/lib/libem_mes.a
  169. .fi
  170. .SH MODULES
  171. em_code(3)
  172. .SH SEE ALSO
  173. em_code(3), read_em(3)
  174. .SH DIAGNOSTICS
  175. None of the functions return a value.
  176. .SH BUGS
  177. The
  178. .BR C_ms_ext ()
  179. routine has not yet been implemented, since this message uses
  180. a variable number of arguments.