code.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. /* C O D E - G E N E R A T I N G R O U T I N E S */
  7. #include <stdlib.h>
  8. #include <stdio.h>
  9. #include <string.h>
  10. #include "lint.h"
  11. #include "dbsymtab.h"
  12. #ifndef LINT
  13. #include <em.h>
  14. #else
  15. #include "l_em.h"
  16. #include "l_lint.h"
  17. #endif /* LINT */
  18. #include "botch_free.h"
  19. #include <alloc.h>
  20. #include "dataflow.h"
  21. #include "use_tmp.h"
  22. #include "arith.h"
  23. #include "type.h"
  24. #include "idf.h"
  25. #include "label.h"
  26. #include "code.h"
  27. #include "stmt.h"
  28. #include "def.h"
  29. #include "expr.h"
  30. #include "sizes.h"
  31. #include "stack.h"
  32. #include "level.h"
  33. #include "decspecs.h"
  34. #include "declar.h"
  35. #include "Lpars.h"
  36. #include "specials.h"
  37. #include "atw.h"
  38. #include "assert.h"
  39. #include "noRoption.h"
  40. #include "LLlex.h"
  41. #ifdef DBSYMTAB
  42. #include <stb.h>
  43. #endif /* DBSYMTAB */
  44. label lab_count = 1;
  45. label datlab_count = 1;
  46. #ifndef NOFLOAT
  47. int fp_used;
  48. #endif /* NOFLOAT */
  49. /* global function info */
  50. char *func_name;
  51. struct type *func_type;
  52. int func_notypegiven;
  53. #ifdef USE_TMP
  54. static int tmp_id;
  55. static int pro_id;
  56. #endif /* USE_TMP */
  57. extern char options[];
  58. extern char *symbol2str();
  59. #ifndef LINT
  60. init_code(dst_file)
  61. char *dst_file;
  62. {
  63. /* init_code() initialises the output file on which the
  64. compact EM code is written
  65. */
  66. C_init(word_size, pointer_size); /* initialise EM module */
  67. if (C_open(dst_file) == 0)
  68. fatal("cannot write to %s\n", dst_file);
  69. C_magic();
  70. C_ms_emx(word_size, pointer_size);
  71. #ifdef DBSYMTAB
  72. if (options['g']) {
  73. extern char *source;
  74. C_ms_std(source, N_SO, 0);
  75. stb_typedef(int_type, "int");
  76. stb_typedef(char_type, "char");
  77. stb_typedef(long_type, "long");
  78. stb_typedef(short_type, "short");
  79. stb_typedef(uchar_type, "unsigned char");
  80. stb_typedef(ushort_type, "unsigned short");
  81. stb_typedef(ulong_type, "unsigned long");
  82. stb_typedef(uint_type, "unsigned int");
  83. stb_typedef(float_type, "float");
  84. stb_typedef(double_type, "double");
  85. stb_typedef(void_type, "void");
  86. }
  87. #endif /* DBSYMTAB */
  88. #ifdef USE_TMP
  89. #ifdef PREPEND_SCOPES
  90. C_insertpart(tmp_id = C_getid());
  91. #endif /* USE_TMP */
  92. #endif /* PREPEND_SCOPES */
  93. }
  94. #endif /* LINT */
  95. struct string_cst *str_list = 0;
  96. code_string(val, len, dlb)
  97. char *val;
  98. int len;
  99. label dlb;
  100. {
  101. register struct string_cst *sc = new_string_cst();
  102. C_ina_dlb(dlb);
  103. sc->next = str_list;
  104. str_list = sc;
  105. sc->sc_value = val;
  106. sc->sc_len = len;
  107. sc->sc_dlb = dlb;
  108. }
  109. def_strings(sc)
  110. register struct string_cst *sc;
  111. {
  112. while (sc) {
  113. struct string_cst *sc1 = sc;
  114. C_df_dlb(sc->sc_dlb);
  115. str_cst(sc->sc_value, sc->sc_len);
  116. sc = sc->next;
  117. free_string_cst(sc1);
  118. }
  119. }
  120. #ifndef LINT
  121. end_code()
  122. {
  123. /* end_code() performs the actions to be taken when closing
  124. the output stream.
  125. */
  126. #ifndef NOFLOAT
  127. if (fp_used) {
  128. /* floating point used */
  129. C_ms_flt();
  130. }
  131. #endif /* NOFLOAT */
  132. def_strings(str_list);
  133. str_list = 0;
  134. C_ms_src((int)(LineNumber - 2), FileName);
  135. C_close();
  136. }
  137. #endif /* LINT */
  138. #ifdef PREPEND_SCOPES
  139. prepend_scopes()
  140. {
  141. /* prepend_scopes() runs down the list of global idf's
  142. and generates those exa's, exp's, ina's and inp's
  143. that superior hindsight has provided.
  144. */
  145. register struct stack_entry *se = local_level->sl_entry;
  146. #ifdef USE_TMP
  147. C_beginpart(tmp_id);
  148. #endif /* USE_TMP */
  149. while (se != 0) {
  150. register struct idf *id = se->se_idf;
  151. register struct def *df = id->id_def;
  152. if (df && (df->df_initialized || df->df_used || df->df_alloc))
  153. code_scope(id->id_text, df);
  154. se = se->next;
  155. }
  156. #ifdef USE_TMP
  157. C_endpart(tmp_id);
  158. #endif /* USE_TMP */
  159. }
  160. #endif /* PREPEND_SCOPES */
  161. code_scope(text, def)
  162. char *text;
  163. register struct def *def;
  164. {
  165. /* generates code for one name, text, of the storage class
  166. as given by def, if meaningful.
  167. */
  168. int fund = def->df_type->tp_fund;
  169. switch (def->df_sc) {
  170. case EXTERN:
  171. case GLOBAL:
  172. case IMPLICIT:
  173. if (fund == FUNCTION)
  174. C_exp(text);
  175. else
  176. C_exa_dnam(text);
  177. break;
  178. case STATIC:
  179. if (fund == FUNCTION)
  180. C_inp(text);
  181. else
  182. C_ina_dnam(text);
  183. break;
  184. }
  185. }
  186. static label return_label, return2_label;
  187. static char return_expr_occurred;
  188. static arith func_size;
  189. static label func_res_label;
  190. static char *last_fn_given = "";
  191. static label file_name_label;
  192. begin_proc(ds, idf) /* to be called when entering a procedure */
  193. struct decspecs *ds;
  194. struct idf *idf;
  195. {
  196. /* begin_proc() is called at the entrance of a new function
  197. and performs the necessary code generation:
  198. - a scope indicator (if needed) exp/inp
  199. - the procedure entry pro $name
  200. - reserves some space if the result of the function
  201. does not fit in the return area
  202. - a fil pseudo instruction
  203. */
  204. register char *name = idf->id_text;
  205. register struct def *def = idf->id_def;
  206. while (def->df_level > L_GLOBAL) def = def->next;
  207. /* idf->id_def does not indicate the right def structure
  208. when the function being defined has a parameter of the
  209. same name.
  210. */
  211. #ifndef PREPEND_SCOPES
  212. code_scope(name, def);
  213. #endif /* PREPEND_SCOPES */
  214. #ifdef DATAFLOW
  215. if (options['d'])
  216. DfaStartFunction(name);
  217. #endif /* DATAFLOW */
  218. /* set global function info */
  219. func_name = name;
  220. if (def->df_type->tp_fund != FUNCTION) {
  221. error("making function body for non-function");
  222. func_type = error_type;
  223. }
  224. else {
  225. func_type = def->df_type->tp_up;
  226. }
  227. func_notypegiven = ds->ds_notypegiven;
  228. func_size = ATW(func_type->tp_size);
  229. #ifndef USE_TMP
  230. C_pro_narg(name);
  231. #else
  232. C_insertpart(pro_id = C_getid());
  233. #endif
  234. if (is_struct_or_union(func_type->tp_fund)) {
  235. C_df_dlb(func_res_label = data_label());
  236. C_bss_cst(func_size, (arith)0, 1);
  237. }
  238. else
  239. func_res_label = 0;
  240. /* Special arrangements if the function result doesn't fit in
  241. the function return area of the EM machine. The size of
  242. the function return area is implementation dependent.
  243. */
  244. lab_count = (label) 1;
  245. return_label = text_label();
  246. return2_label = text_label();
  247. return_expr_occurred = 0;
  248. LocalInit();
  249. prc_entry(name);
  250. if (! options['L']) { /* profiling */
  251. if (strcmp(last_fn_given, FileName) != 0) {
  252. /* previous function came from other file */
  253. C_df_dlb(file_name_label = data_label());
  254. C_con_scon(last_fn_given = FileName,
  255. (arith)(strlen(FileName) + 1));
  256. }
  257. /* enable debug trace of EM source */
  258. C_fil_dlb(file_name_label, (arith)0);
  259. C_lin((arith)LineNumber);
  260. }
  261. #ifdef DBSYMTAB
  262. if (options['g']) {
  263. stb_string(def, FUNCTION, name);
  264. if (! strcmp(name, "main")) {
  265. C_ms_stb_cst(name, N_MAIN, 0, (arith) 0);
  266. }
  267. }
  268. #endif
  269. }
  270. end_proc(fbytes)
  271. arith fbytes;
  272. {
  273. /* end_proc() deals with the code to be generated at the end of
  274. a function, as there is:
  275. - the EM ret instruction: "ret 0"
  276. - loading of the function result in the function
  277. result area if there has been a return <expr>
  278. in the function body (see do_return_expr())
  279. - indication of the use of floating points
  280. - indication of the number of bytes used for
  281. formal parameters
  282. - use of special identifiers such as "setjmp"
  283. - "end" + number of bytes used for local variables
  284. */
  285. arith nbytes;
  286. char optionsn = options['n'];
  287. #ifdef DATAFLOW
  288. if (options['d'])
  289. DfaEndFunction();
  290. #endif /* DATAFLOW */
  291. C_df_ilb(return2_label);
  292. if (return_expr_occurred) C_asp(-func_size);
  293. C_df_ilb(return_label);
  294. prc_exit();
  295. #ifndef LINT
  296. if (return_expr_occurred) {
  297. if (func_res_label != 0) {
  298. C_lae_dlb(func_res_label, (arith)0);
  299. store_block(func_type->tp_size, func_type->tp_align);
  300. C_lae_dlb(func_res_label, (arith)0);
  301. C_ret(pointer_size);
  302. }
  303. else
  304. C_ret(func_size);
  305. }
  306. else C_ret((arith) 0);
  307. #endif /* LINT */
  308. /* getting the number of "local" bytes is posponed until here,
  309. because copying the function result in "func_res_label" may
  310. need temporaries! However, local_level is now L_FORMAL2, because
  311. L_LOCAL is already unstacked. Therefore, "unstack_level" must
  312. also pass "sl_max_block" to the level above L_LOCAL.
  313. */
  314. nbytes = ATW(- local_level->sl_max_block);
  315. #ifdef USE_TMP
  316. C_beginpart(pro_id);
  317. C_pro(func_name, nbytes);
  318. #endif
  319. if (fbytes > max_int) {
  320. error("%s has more than %ld parameter bytes",
  321. func_name, (long) max_int);
  322. }
  323. C_ms_par(fbytes); /* # bytes for formals */
  324. if (sp_occurred[SP_SETJMP]) { /* indicate use of "setjmp" */
  325. options['n'] = 1;
  326. C_ms_gto();
  327. sp_occurred[SP_SETJMP] = 0;
  328. }
  329. #ifdef USE_TMP
  330. C_endpart(pro_id);
  331. #endif
  332. LocalFinish();
  333. C_end(nbytes);
  334. if (nbytes > max_int) {
  335. error("%s has more than %ld bytes of local variables",
  336. func_name, (long) max_int);
  337. }
  338. options['n'] = optionsn;
  339. }
  340. do_return()
  341. {
  342. /* do_return handles the case of a return without expression.
  343. This version branches to the return label, which is
  344. probably smarter than generating a direct return.
  345. Return sequences may be expensive.
  346. */
  347. #ifdef DBSYMTAB
  348. if (options['g']) db_line(dot.tk_file, dot.tk_line);
  349. #endif /* DBSYMTAB */
  350. C_bra(return2_label);
  351. }
  352. do_return_expr(expr)
  353. struct expr *expr;
  354. {
  355. /* do_return_expr() generates the expression and the jump for
  356. a return statement with an expression.
  357. */
  358. ch7cast(&expr, RETURN, func_type);
  359. code_expr(expr, RVAL, TRUE, NO_LABEL, NO_LABEL);
  360. C_bra(return_label);
  361. return_expr_occurred = 1;
  362. }
  363. code_declaration(idf, expr, lvl, sc)
  364. register struct idf *idf; /* idf to be declared */
  365. struct expr *expr; /* initialisation; NULL if absent */
  366. int lvl; /* declaration level */
  367. int sc; /* storage class, as in the declaration */
  368. {
  369. /* code_declaration() does the actual declaration of the
  370. variable indicated by "idf" on declaration level "lvl".
  371. If the variable is initialised, the expression is given
  372. in "expr", but for global and static initialisations it
  373. is just non-zero, as the expression is not parsed yet.
  374. There are some cases to be considered:
  375. - filter out typedefs, they don't correspond to code;
  376. - global variables, coded only if initialized;
  377. - local static variables;
  378. - local automatic variables;
  379. Since the expression may be modified in the process,
  380. code_declaration() frees it after use, as the caller can
  381. no longer do so.
  382. If there is a storage class indication (EXTERN/STATIC),
  383. code_declaration() will generate an exa or ina.
  384. The sc is the actual storage class, as given in the
  385. declaration. This is to allow:
  386. extern int a;
  387. int a = 5;
  388. while at the same time forbidding
  389. extern int a = 5;
  390. */
  391. register struct def *def = idf->id_def;
  392. register arith size = def->df_type->tp_size;
  393. int def_sc = def->df_sc;
  394. if (def_sc == TYPEDEF) { /* no code for typedefs */
  395. #ifdef DBSYMTAB
  396. if (options['g']) {
  397. stb_typedef(def->df_type, idf->id_text);
  398. }
  399. #endif /* DBSYMTAB */
  400. return;
  401. }
  402. if (sc == EXTERN && expr && !is_anon_idf(idf))
  403. error("%s is extern; cannot initialize", idf->id_text);
  404. if (lvl == L_GLOBAL) { /* global variable */
  405. /* is this an allocating declaration? */
  406. if ( (sc == 0 || sc == STATIC)
  407. && def->df_type->tp_fund != FUNCTION
  408. && size >= 0
  409. )
  410. def->df_alloc = ALLOC_SEEN;
  411. if (expr) { /* code only if initialized */
  412. #ifndef PREPEND_SCOPES
  413. code_scope(idf->id_text, def);
  414. #endif /* PREPEND_SCOPES */
  415. def->df_alloc = ALLOC_DONE;
  416. C_df_dnam(idf->id_text);
  417. }
  418. }
  419. else
  420. if (lvl >= L_LOCAL) { /* local variable */
  421. /* STATIC, EXTERN, GLOBAL, IMPLICIT, AUTO or REGISTER */
  422. switch (def_sc) {
  423. case STATIC:
  424. if (def->df_type->tp_fund == FUNCTION) {
  425. /* should produce "inp $function" ??? */
  426. break;
  427. }
  428. /* they are handled on the spot and get an
  429. integer label in EM.
  430. */
  431. #ifdef DBSYMTAB
  432. if (options['g'] && ! expr) {
  433. stb_string(def, sc, idf->id_text);
  434. }
  435. #endif /* DBSYMTAB */
  436. C_df_dlb((label)def->df_address);
  437. if (expr) { /* there is an initialisation */
  438. }
  439. else { /* produce blank space */
  440. if (size <= 0) {
  441. error("size of %s unknown", idf->id_text);
  442. size = (arith)0;
  443. }
  444. C_bss_cst(ATW(size), (arith)0, 1);
  445. }
  446. break;
  447. case EXTERN:
  448. case GLOBAL:
  449. case IMPLICIT:
  450. /* we are sure there is no expression */
  451. break;
  452. case AUTO:
  453. case REGISTER:
  454. #ifdef DBSYMTAB
  455. if (options['g']) {
  456. stb_string(def, sc, idf->id_text);
  457. }
  458. #endif /* DBSYMTAB */
  459. if (expr)
  460. loc_init(expr, idf);
  461. break;
  462. default:
  463. crash("bad local storage class");
  464. /*NOTREACHED*/
  465. }
  466. }
  467. }
  468. loc_init(expr, id)
  469. struct expr *expr;
  470. register struct idf *id;
  471. {
  472. /* loc_init() generates code for the assignment of
  473. expression expr to the local variable described by id.
  474. It frees the expression afterwards.
  475. */
  476. register struct expr *e = expr;
  477. register struct type *tp = id->id_def->df_type;
  478. ASSERT(id->id_def->df_sc != STATIC);
  479. switch (tp->tp_fund) {
  480. case ARRAY:
  481. case STRUCT:
  482. case UNION:
  483. error("automatic %s cannot be initialized in declaration",
  484. symbol2str(tp->tp_fund));
  485. free_expression(e);
  486. return;
  487. }
  488. if (ISCOMMA(e)) { /* embraced: int i = {12}; */
  489. #ifndef NOROPTION
  490. if (options['R']) {
  491. if (ISCOMMA(e->OP_LEFT)) /* int i = {{1}} */
  492. expr_error(e, "extra braces not allowed");
  493. else
  494. if (e->OP_RIGHT != 0) /* int i = {1 , 2} */
  495. expr_error(e, "too many initializers");
  496. }
  497. #endif /* NOROPTION */
  498. while (e) {
  499. loc_init(e->OP_LEFT, id);
  500. e = e->OP_RIGHT;
  501. }
  502. }
  503. else { /* not embraced */
  504. ch7cast(&expr, '=', tp); /* may modify expr */
  505. #ifndef LINT
  506. {
  507. struct value vl;
  508. EVAL(expr, RVAL, TRUE, NO_LABEL, NO_LABEL);
  509. vl.vl_class = Name;
  510. vl.vl_data.vl_idf = id;
  511. vl.vl_value = (arith)0;
  512. store_val(&vl, tp);
  513. }
  514. #else /* LINT */
  515. id->id_def->df_set = 1;
  516. #endif /* LINT */
  517. free_expression(expr);
  518. }
  519. }
  520. bss(idf)
  521. register struct idf *idf;
  522. {
  523. /* bss() allocates bss space for the global idf.
  524. */
  525. arith size = idf->id_def->df_type->tp_size;
  526. #ifndef PREPEND_SCOPES
  527. code_scope(idf->id_text, idf->id_def);
  528. #endif /* PREPEND_SCOPES */
  529. #ifdef DBSYMTAB
  530. if (options['g']) {
  531. stb_string(idf->id_def, idf->id_def->df_sc, idf->id_text);
  532. }
  533. #endif /* DBSYMTAB */
  534. /* Since bss() is only called if df_alloc is non-zero, and
  535. since df_alloc is only non-zero if size >= 0, we have:
  536. */
  537. /* but we already gave a warning at the declaration of the
  538. array. Besides, the message given here does not apply to
  539. voids
  540. if (options['R'] && size == 0)
  541. warning("actual array of size 0");
  542. */
  543. C_df_dnam(idf->id_text);
  544. C_bss_cst(ATW(size), (arith)0, 1);
  545. }
  546. formal_cvt(df)
  547. register struct def *df;
  548. {
  549. /* formal_cvt() converts a formal parameter of type char or
  550. short from int to that type.
  551. */
  552. register struct type *tp = df->df_type;
  553. if (tp->tp_size != int_size &&
  554. (tp->tp_fund == CHAR || tp->tp_fund == SHORT)
  555. ) {
  556. LoadLocal(df->df_address, int_size);
  557. /* conversion(int_type, df->df_type); ???
  558. No, you can't do this on the stack! (CJ)
  559. */
  560. StoreLocal(df->df_address, tp->tp_size);
  561. }
  562. }
  563. #ifdef LINT
  564. /*ARGSUSED*/
  565. #endif /* LINT */
  566. code_expr(expr, val, code, tlbl, flbl)
  567. struct expr *expr;
  568. label tlbl, flbl;
  569. {
  570. /* code_expr() is the parser's interface to the expression code
  571. generator. If line number trace is wanted, it generates a
  572. lin instruction. EVAL() is called directly.
  573. */
  574. #ifndef LINT
  575. if (! options['L']) /* profiling */
  576. C_lin((arith)(expr->ex_line));
  577. #ifdef DBSYMTAB
  578. if (options['g']) db_line(expr->ex_file, (unsigned int)expr->ex_line);
  579. #endif
  580. EVAL(expr, val, code, tlbl, flbl);
  581. #else /* LINT */
  582. lint_expr(expr, code ? USED : IGNORED);
  583. #endif /* LINT */
  584. }
  585. /* The FOR/WHILE/DO/SWITCH stacking mechanism:
  586. stack_stmt() has to be called at the entrance of a
  587. for, while, do or switch statement to indicate the
  588. EM labels where a subsequent break or continue causes
  589. the program to jump to.
  590. */
  591. static struct stmt_block *stmt_stack; /* top of statement stack */
  592. /* code_break() generates EM code needed at the occurrence of "break":
  593. it generates a branch instruction to the break label of the
  594. innermost statement in which break has a meaning.
  595. As "break" is legal in any of 'while', 'do', 'for' or 'switch',
  596. which are the only ones that are stacked, only the top of
  597. the stack is interesting.
  598. */
  599. code_break()
  600. {
  601. register struct stmt_block *stmt_block = stmt_stack;
  602. #ifdef DBSYMTAB
  603. if (options['g']) db_line(dot.tk_file, dot.tk_line);
  604. #endif /* DBSYMTAB */
  605. if (stmt_block)
  606. C_bra(stmt_block->st_break);
  607. else
  608. error("break not inside for, while, do or switch");
  609. }
  610. /* code_continue() generates EM code needed at the occurrence of
  611. "continue":
  612. it generates a branch instruction to the continue label of the
  613. innermost statement in which continue has a meaning.
  614. */
  615. code_continue()
  616. {
  617. register struct stmt_block *stmt_block = stmt_stack;
  618. while (stmt_block) {
  619. if (stmt_block->st_continue) {
  620. #ifdef DBSYMTAB
  621. if (options['g']) db_line(dot.tk_file, dot.tk_line);
  622. #endif /* DBSYMTAB */
  623. C_bra(stmt_block->st_continue);
  624. return;
  625. }
  626. stmt_block = stmt_block->next;
  627. }
  628. error("continue not inside for, while or do");
  629. }
  630. stack_stmt(break_label, cont_label)
  631. label break_label, cont_label;
  632. {
  633. register struct stmt_block *stmt_block = new_stmt_block();
  634. stmt_block->next = stmt_stack;
  635. stmt_block->st_break = break_label;
  636. stmt_block->st_continue = cont_label;
  637. stmt_stack = stmt_block;
  638. }
  639. unstack_stmt()
  640. {
  641. /* unstack_stmt() unstacks the data of a statement
  642. which may contain break or continue
  643. */
  644. register struct stmt_block *sbp = stmt_stack;
  645. stmt_stack = sbp->next;
  646. free_stmt_block(sbp);
  647. }
  648. static label prc_name;
  649. prc_entry(name)
  650. char *name;
  651. {
  652. if (options['p']) {
  653. C_df_dlb(prc_name = data_label());
  654. C_rom_scon(name, (arith) (strlen(name) + 1));
  655. C_lae_dlb(prc_name, (arith) 0);
  656. C_cal("procentry");
  657. C_asp(pointer_size);
  658. }
  659. }
  660. prc_exit()
  661. {
  662. if (options['p']) {
  663. C_lae_dlb(prc_name, (arith) 0);
  664. C_cal("procexit");
  665. C_asp(pointer_size);
  666. }
  667. }
  668. #ifdef DBSYMTAB
  669. db_line(file, line)
  670. char *file;
  671. unsigned int line;
  672. {
  673. static unsigned oldline;
  674. static char *oldfile;
  675. if (file != oldfile || line != oldline) {
  676. C_ms_std((char *) 0, N_SLINE, (int) line);
  677. oldline = line;
  678. oldfile = file;
  679. }
  680. }
  681. #endif /* DBSYMTAB */