code.c 17 KB

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