pass_1.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. {$ifndef cg11}
  2. {
  3. $Id$
  4. Copyright (c) 1998-2000 by Florian Klaempfl
  5. This unit implements the first pass of the code generator
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit pass_1;
  20. {$i defines.inc}
  21. interface
  22. uses
  23. tree;
  24. procedure firstpass(var p : ptree);
  25. function do_firstpass(var p : ptree) : boolean;
  26. implementation
  27. uses
  28. globtype,systems,
  29. cutils,cobjects,verbose,globals,
  30. aasm,symtable,types,
  31. htypechk,
  32. tcadd,tccal,tccnv,tccon,tcflw,
  33. tcinl,tcld,tcmat,tcmem,tcset,cpubase,cpuasm
  34. {$ifdef newcg}
  35. ,cgbase
  36. ,tgcpu
  37. {$else newcg}
  38. ,hcodegen
  39. {$ifdef i386}
  40. ,tgeni386
  41. {$endif}
  42. {$ifdef m68k}
  43. ,tgen68k
  44. {$endif}
  45. {$endif}
  46. ;
  47. {*****************************************************************************
  48. FirstPass
  49. *****************************************************************************}
  50. type
  51. firstpassproc = procedure(var p : ptree);
  52. procedure firstnothing(var p : ptree);
  53. begin
  54. p^.resulttype:=voiddef;
  55. end;
  56. procedure firsterror(var p : ptree);
  57. begin
  58. p^.error:=true;
  59. codegenerror:=true;
  60. p^.resulttype:=generrordef;
  61. end;
  62. procedure firststatement(var p : ptree);
  63. begin
  64. { left is the next statement in the list }
  65. p^.resulttype:=voiddef;
  66. { no temps over several statements }
  67. {$ifdef newcg}
  68. tg.cleartempgen;
  69. {$else newcg}
  70. cleartempgen;
  71. {$endif newcg}
  72. { right is the statement itself calln assignn or a complex one }
  73. {must_be_valid:=true; obsolete PM }
  74. firstpass(p^.right);
  75. if (not (cs_extsyntax in aktmoduleswitches)) and
  76. assigned(p^.right^.resulttype) and
  77. (p^.right^.resulttype<>pdef(voiddef)) then
  78. CGMessage(cg_e_illegal_expression);
  79. if codegenerror then
  80. exit;
  81. p^.registers32:=p^.right^.registers32;
  82. p^.registersfpu:=p^.right^.registersfpu;
  83. {$ifdef SUPPORT_MMX}
  84. p^.registersmmx:=p^.right^.registersmmx;
  85. {$endif SUPPORT_MMX}
  86. { left is the next in the list }
  87. firstpass(p^.left);
  88. if codegenerror then
  89. exit;
  90. if p^.right^.registers32>p^.registers32 then
  91. p^.registers32:=p^.right^.registers32;
  92. if p^.right^.registersfpu>p^.registersfpu then
  93. p^.registersfpu:=p^.right^.registersfpu;
  94. {$ifdef SUPPORT_MMX}
  95. if p^.right^.registersmmx>p^.registersmmx then
  96. p^.registersmmx:=p^.right^.registersmmx;
  97. {$endif}
  98. end;
  99. procedure firstblock(var p : ptree);
  100. var
  101. hp : ptree;
  102. count : longint;
  103. begin
  104. count:=0;
  105. hp:=p^.left;
  106. while assigned(hp) do
  107. begin
  108. if cs_regalloc in aktglobalswitches then
  109. begin
  110. { Codeumstellungen }
  111. { Funktionsresultate an exit anh„ngen }
  112. { this is wrong for string or other complex
  113. result types !!! }
  114. if ret_in_acc(procinfo^.returntype.def) and
  115. assigned(hp^.left) and
  116. assigned(hp^.left^.right) and
  117. (hp^.left^.right^.treetype=exitn) and
  118. (hp^.right^.treetype=assignn) and
  119. (hp^.right^.left^.treetype=funcretn) then
  120. begin
  121. if assigned(hp^.left^.right^.left) then
  122. CGMessage(cg_n_inefficient_code)
  123. else
  124. begin
  125. hp^.left^.right^.left:=hp^.right^.right;
  126. hp^.right^.right:=nil;
  127. disposetree(hp^.right);
  128. hp^.right:=nil;
  129. end;
  130. end
  131. { warning if unreachable code occurs and elimate this }
  132. else if (hp^.right^.treetype in
  133. [exitn,breakn,continuen,goton]) and
  134. { statement node (JM) }
  135. assigned(hp^.left) and
  136. { kind of statement! (JM) }
  137. assigned(hp^.left^.right) and
  138. (hp^.left^.right^.treetype<>labeln) then
  139. begin
  140. { use correct line number }
  141. aktfilepos:=hp^.left^.fileinfo;
  142. disposetree(hp^.left);
  143. hp^.left:=nil;
  144. CGMessage(cg_w_unreachable_code);
  145. { old lines }
  146. aktfilepos:=hp^.right^.fileinfo;
  147. end;
  148. end;
  149. if assigned(hp^.right) then
  150. begin
  151. {$ifdef newcg}
  152. tg.cleartempgen;
  153. {$else newcg}
  154. cleartempgen;
  155. {$endif newcg}
  156. codegenerror:=false;
  157. firstpass(hp^.right);
  158. if (not (cs_extsyntax in aktmoduleswitches)) and
  159. assigned(hp^.right^.resulttype) and
  160. (hp^.right^.resulttype<>pdef(voiddef)) then
  161. CGMessage(cg_e_illegal_expression);
  162. {if codegenerror then
  163. exit;}
  164. hp^.registers32:=hp^.right^.registers32;
  165. hp^.registersfpu:=hp^.right^.registersfpu;
  166. {$ifdef SUPPORT_MMX}
  167. hp^.registersmmx:=hp^.right^.registersmmx;
  168. {$endif SUPPORT_MMX}
  169. end
  170. else
  171. hp^.registers32:=0;
  172. if hp^.registers32>p^.registers32 then
  173. p^.registers32:=hp^.registers32;
  174. if hp^.registersfpu>p^.registersfpu then
  175. p^.registersfpu:=hp^.registersfpu;
  176. {$ifdef SUPPORT_MMX}
  177. if hp^.registersmmx>p^.registersmmx then
  178. p^.registersmmx:=hp^.registersmmx;
  179. {$endif}
  180. inc(count);
  181. hp:=hp^.left;
  182. end;
  183. end;
  184. procedure firstasm(var p : ptree);
  185. begin
  186. procinfo^.flags:=procinfo^.flags or pi_uses_asm;
  187. end;
  188. procedure firstpass(var p : ptree);
  189. const
  190. procedures : array[ttreetyp] of firstpassproc =
  191. (firstadd, {addn}
  192. firstadd, {muln}
  193. firstadd, {subn}
  194. firstmoddiv, {divn}
  195. firstadd, {symdifn}
  196. firstmoddiv, {modn}
  197. firstassignment, {assignn}
  198. firstload, {loadn}
  199. firstrange, {range}
  200. firstadd, {ltn}
  201. firstadd, {lten}
  202. firstadd, {gtn}
  203. firstadd, {gten}
  204. firstadd, {equaln}
  205. firstadd, {unequaln}
  206. firstin, {inn}
  207. firstadd, {orn}
  208. firstadd, {xorn}
  209. firstshlshr, {shrn}
  210. firstshlshr, {shln}
  211. firstadd, {slashn}
  212. firstadd, {andn}
  213. firstsubscript, {subscriptn}
  214. firstderef, {derefn}
  215. firstaddr, {addrn}
  216. firstdoubleaddr, {doubleaddrn}
  217. firstordconst, {ordconstn}
  218. firsttypeconv, {typeconvn}
  219. firstcalln, {calln}
  220. firstnothing, {callparan}
  221. firstrealconst, {realconstn}
  222. firstfixconst, {fixconstn}
  223. firstunaryminus, {unaryminusn}
  224. firstasm, {asmn}
  225. firstvec, {vecn}
  226. firstpointerconst,{pointerconstn}
  227. firststringconst, {stringconstn}
  228. firstfuncret, {funcretn}
  229. firstself, {selfn}
  230. firstnot, {notn}
  231. firstinline, {inlinen}
  232. firstniln, {niln}
  233. firsterror, {errorn}
  234. firsttype, {typen}
  235. firsthnew, {hnewn}
  236. firsthdispose, {hdisposen}
  237. firstnew, {newn}
  238. firstsimplenewdispose, {simpledisposen}
  239. firstsetelement, {setelementn}
  240. firstsetconst, {setconstn}
  241. firstblock, {blockn}
  242. firststatement, {statementn}
  243. firstnothing, {loopn}
  244. firstif, {ifn}
  245. firstnothing, {breakn}
  246. firstnothing, {continuen}
  247. first_while_repeat, {repeatn}
  248. first_while_repeat, {whilen}
  249. firstfor, {forn}
  250. firstexit, {exitn}
  251. firstwith, {withn}
  252. firstcase, {casen}
  253. firstlabel, {labeln}
  254. firstgoto, {goton}
  255. firstsimplenewdispose, {simplenewn}
  256. firsttryexcept, {tryexceptn}
  257. firstraise, {raisen}
  258. firstnothing, {switchesn}
  259. firsttryfinally, {tryfinallyn}
  260. firston, {onn}
  261. firstis, {isn}
  262. firstas, {asn}
  263. firsterror, {caretn}
  264. firstnothing, {failn}
  265. firstadd, {starstarn}
  266. firstprocinline, {procinlinen}
  267. firstarrayconstruct, {arrayconstructn}
  268. firstarrayconstructrange, {arrayconstructrangen}
  269. firstnothing, {nothingn}
  270. firstloadvmt {loadvmtn}
  271. );
  272. var
  273. oldcodegenerror : boolean;
  274. oldlocalswitches : tlocalswitches;
  275. oldpos : tfileposinfo;
  276. {$ifdef extdebug}
  277. str1,str2 : string;
  278. oldp : ptree;
  279. not_first : boolean;
  280. {$endif extdebug}
  281. begin
  282. {$ifdef extdebug}
  283. inc(total_of_firstpass);
  284. if (p^.firstpasscount>0) and only_one_pass then
  285. exit;
  286. {$endif extdebug}
  287. oldcodegenerror:=codegenerror;
  288. oldpos:=aktfilepos;
  289. oldlocalswitches:=aktlocalswitches;
  290. {$ifdef extdebug}
  291. if p^.firstpasscount>0 then
  292. begin
  293. move(p^,str1[1],sizeof(ttree));
  294. str1[0]:=char(sizeof(ttree));
  295. new(oldp);
  296. oldp^:=p^;
  297. not_first:=true;
  298. inc(firstpass_several);
  299. end
  300. else
  301. not_first:=false;
  302. {$endif extdebug}
  303. if not p^.error then
  304. begin
  305. codegenerror:=false;
  306. aktfilepos:=p^.fileinfo;
  307. aktlocalswitches:=p^.localswitches;
  308. procedures[p^.treetype](p);
  309. aktlocalswitches:=oldlocalswitches;
  310. aktfilepos:=oldpos;
  311. p^.error:=codegenerror;
  312. codegenerror:=codegenerror or oldcodegenerror;
  313. end
  314. else
  315. codegenerror:=true;
  316. {$ifdef extdebug}
  317. if not_first then
  318. begin
  319. { dirty trick to compare two ttree's (PM) }
  320. move(p^,str2[1],sizeof(ttree));
  321. str2[0]:=char(sizeof(ttree));
  322. if str1<>str2 then
  323. begin
  324. comment(v_debug,'tree changed after first counting pass '
  325. +tostr(longint(p^.treetype)));
  326. compare_trees(oldp,p);
  327. end;
  328. dispose(oldp);
  329. end;
  330. if count_ref then
  331. inc(p^.firstpasscount);
  332. {$endif extdebug}
  333. end;
  334. function do_firstpass(var p : ptree) : boolean;
  335. begin
  336. aktexceptblock:=nil;
  337. codegenerror:=false;
  338. firstpass(p);
  339. do_firstpass:=codegenerror;
  340. end;
  341. end.
  342. {$else tnode}
  343. unit pass_1;
  344. {$i defines.inc}
  345. interface
  346. uses
  347. node;
  348. procedure firstpass(var p : tnode);
  349. function do_firstpass(var p : tnode) : boolean;
  350. type
  351. tnothingnode = class(tnode)
  352. constructor create;virtual;
  353. function pass_1 : tnode;override;
  354. end;
  355. terrornode = class(tnode)
  356. constructor create;virtual;
  357. function pass_1 : tnode;override;
  358. end;
  359. tasmnode = class(tnode)
  360. constructor create;virtual;
  361. function pass_1 : tnode;override;
  362. end;
  363. tstatementnode = class(tbinarynode)
  364. constructor create(l,r : tnode);virtual;
  365. function pass_1 : tnode;override;
  366. end;
  367. tblocknode = class(tbinarynode)
  368. constructor create(l,r : tnode);virtual;
  369. function pass_1 : tnode;override;
  370. end;
  371. var
  372. cnothingnode : class of tnothingnode;
  373. cerrornode : class of terrornode;
  374. casmnode : class of tasmnode;
  375. cstatementnode : class of tstatementnode;
  376. cblocknode : class of tblocknode;
  377. implementation
  378. uses
  379. globtype,systems,
  380. cutils,cobjects,verbose,globals,
  381. aasm,symtable,types,
  382. htypechk,
  383. cpubase,cpuasm,
  384. nflw
  385. {$ifdef newcg}
  386. ,cgbase
  387. ,tgcpu
  388. {$else newcg}
  389. ,hcodegen
  390. {$ifdef i386}
  391. ,tgeni386
  392. {$endif}
  393. {$ifdef m68k}
  394. ,tgen68k
  395. {$endif}
  396. {$endif}
  397. ;
  398. {*****************************************************************************
  399. TFIRSTNOTHING
  400. *****************************************************************************}
  401. constructor tnothingnode.create;
  402. begin
  403. inherited create(nothingn);
  404. end;
  405. function tnothingnode.pass_1 : tnode;
  406. begin
  407. pass_1:=nil;
  408. resulttype:=voiddef;
  409. end;
  410. {*****************************************************************************
  411. TFIRSTERROR
  412. *****************************************************************************}
  413. constructor terrornode.create;
  414. begin
  415. inherited create(errorn);
  416. end;
  417. function terrornode.pass_1 : tnode;
  418. begin
  419. pass_1:=nil;
  420. include(flags,nf_error);
  421. codegenerror:=true;
  422. resulttype:=generrordef;
  423. end;
  424. {*****************************************************************************
  425. TSTATEMENTNODE
  426. *****************************************************************************}
  427. constructor tstatementnode.create(l,r : tnode);
  428. begin
  429. inherited create(statementn,l,r);
  430. end;
  431. function tstatementnode.pass_1 : tnode;
  432. begin
  433. pass_1:=nil;
  434. { left is the next statement in the list }
  435. resulttype:=voiddef;
  436. { no temps over several statements }
  437. {$ifdef newcg}
  438. tg.cleartempgen;
  439. {$else newcg}
  440. cleartempgen;
  441. {$endif newcg}
  442. { right is the statement itself calln assignn or a complex one }
  443. {must_be_valid:=true; obsolete PM }
  444. firstpass(right);
  445. if (not (cs_extsyntax in aktmoduleswitches)) and
  446. assigned(right.resulttype) and
  447. (right.resulttype<>pdef(voiddef)) then
  448. CGMessage(cg_e_illegal_expression);
  449. if codegenerror then
  450. exit;
  451. registers32:=right.registers32;
  452. registersfpu:=right.registersfpu;
  453. {$ifdef SUPPORT_MMX}
  454. registersmmx:=right.registersmmx;
  455. {$endif SUPPORT_MMX}
  456. { left is the next in the list }
  457. firstpass(left);
  458. if codegenerror then
  459. exit;
  460. if right.registers32>registers32 then
  461. registers32:=right.registers32;
  462. if right.registersfpu>registersfpu then
  463. registersfpu:=right.registersfpu;
  464. {$ifdef SUPPORT_MMX}
  465. if right.registersmmx>registersmmx then
  466. registersmmx:=right.registersmmx;
  467. {$endif}
  468. end;
  469. {*****************************************************************************
  470. TBLOCKNODE
  471. *****************************************************************************}
  472. constructor tblocknode.create(l,r : tnode);
  473. begin
  474. inherited create(blockn,l,r);
  475. end;
  476. function tblocknode.pass_1 : tnode;
  477. var
  478. hp : tstatementnode;
  479. count : longint;
  480. begin
  481. pass_1:=nil;
  482. count:=0;
  483. hp:=tstatementnode(left);
  484. while assigned(hp) do
  485. begin
  486. if cs_regalloc in aktglobalswitches then
  487. begin
  488. { node transformations }
  489. { concat function result to exit }
  490. { this is wrong for string or other complex
  491. result types !!! }
  492. if ret_in_acc(procinfo^.returntype.def) and
  493. assigned(hp.left) and
  494. assigned(tstatementnode(hp.left).right) and
  495. (tstatementnode(hp.left).right.nodetype=exitn) and
  496. (hp.right.nodetype=assignn) and
  497. { !!!! this tbinarynode should be tassignmentnode }
  498. (tbinarynode(hp.right).left.nodetype=funcretn) then
  499. begin
  500. if assigned(texitnode(tstatementnode(hp.left).right).left) then
  501. CGMessage(cg_n_inefficient_code)
  502. else
  503. begin
  504. texitnode(tstatementnode(hp.left).right).left:=tstatementnode(hp.right).right;
  505. tstatementnode(hp.right).right:=nil;
  506. hp.right.free;
  507. hp.right:=nil;
  508. end;
  509. end
  510. { warning if unreachable code occurs and elimate this }
  511. else if (hp.right.nodetype in
  512. [exitn,breakn,continuen,goton]) and
  513. { statement node (JM) }
  514. assigned(hp.left) and
  515. { kind of statement! (JM) }
  516. assigned(tstatementnode(hp.left).right) and
  517. (tstatementnode(hp.left).right.nodetype<>labeln) then
  518. begin
  519. { use correct line number }
  520. aktfilepos:=hp.left.fileinfo;
  521. hp.left.free;
  522. hp.left:=nil;
  523. CGMessage(cg_w_unreachable_code);
  524. { old lines }
  525. aktfilepos:=hp.right.fileinfo;
  526. end;
  527. end;
  528. if assigned(hp.right) then
  529. begin
  530. {$ifdef newcg}
  531. tg.cleartempgen;
  532. {$else newcg}
  533. cleartempgen;
  534. {$endif newcg}
  535. codegenerror:=false;
  536. firstpass(hp.right);
  537. if (not (cs_extsyntax in aktmoduleswitches)) and
  538. assigned(hp.right.resulttype) and
  539. (hp.right.resulttype<>pdef(voiddef)) then
  540. CGMessage(cg_e_illegal_expression);
  541. {if codegenerror then
  542. exit;}
  543. hp.registers32:=hp.right.registers32;
  544. hp.registersfpu:=hp.right.registersfpu;
  545. {$ifdef SUPPORT_MMX}
  546. hp.registersmmx:=hp.right.registersmmx;
  547. {$endif SUPPORT_MMX}
  548. end
  549. else
  550. hp.registers32:=0;
  551. if hp.registers32>registers32 then
  552. registers32:=hp.registers32;
  553. if hp.registersfpu>registersfpu then
  554. registersfpu:=hp.registersfpu;
  555. {$ifdef SUPPORT_MMX}
  556. if hp.registersmmx>registersmmx then
  557. registersmmx:=hp.registersmmx;
  558. {$endif}
  559. inc(count);
  560. hp:=tstatementnode(hp.left);
  561. end;
  562. end;
  563. {*****************************************************************************
  564. TASMNODE
  565. *****************************************************************************}
  566. constructor tasmnode.create;
  567. begin
  568. inherited create(asmn);
  569. end;
  570. function tasmnode.pass_1 : tnode;
  571. begin
  572. pass_1:=nil;
  573. procinfo^.flags:=procinfo^.flags or pi_uses_asm;
  574. end;
  575. {*****************************************************************************
  576. Global procedures
  577. *****************************************************************************}
  578. procedure firstpass(var p : tnode);
  579. var
  580. oldcodegenerror : boolean;
  581. oldlocalswitches : tlocalswitches;
  582. oldpos : tfileposinfo;
  583. hp : tnode;
  584. {$ifdef extdebug}
  585. str1,str2 : string;
  586. oldp : tnode;
  587. not_first : boolean;
  588. {$endif extdebug}
  589. begin
  590. {$ifdef extdebug}
  591. inc(total_of_firstpass);
  592. if (p.firstpasscount>0) and only_one_pass then
  593. exit;
  594. {$endif extdebug}
  595. oldcodegenerror:=codegenerror;
  596. oldpos:=aktfilepos;
  597. oldlocalswitches:=aktlocalswitches;
  598. {$ifdef extdebug}
  599. if p.firstpasscount>0 then
  600. begin
  601. move(p^,str1[1],sizeof(ttree));
  602. str1[0]:=char(sizeof(ttree));
  603. new(oldp);
  604. oldp^:=p^;
  605. not_first:=true;
  606. inc(firstpass_several);
  607. end
  608. else
  609. not_first:=false;
  610. {$endif extdebug}
  611. if not(nf_error in p.flags) then
  612. begin
  613. codegenerror:=false;
  614. aktfilepos:=p.fileinfo;
  615. aktlocalswitches:=p.localswitches;
  616. hp:=p.pass_1;
  617. { should the node be replaced? }
  618. if assigned(hp) then
  619. begin
  620. p.free;
  621. p:=hp;
  622. end;
  623. aktlocalswitches:=oldlocalswitches;
  624. aktfilepos:=oldpos;
  625. if codegenerror then
  626. include(p.flags,nf_error);
  627. codegenerror:=codegenerror or oldcodegenerror;
  628. end
  629. else
  630. codegenerror:=true;
  631. {$ifdef extdebug}
  632. if not_first then
  633. begin
  634. { dirty trick to compare two ttree's (PM) }
  635. move(p^,str2[1],sizeof(ttree));
  636. str2[0]:=char(sizeof(ttree));
  637. if str1<>str2 then
  638. begin
  639. comment(v_debug,'tree changed after first counting pass '
  640. +tostr(longint(p.treetype)));
  641. compare_trees(oldp,p);
  642. end;
  643. dispose(oldp);
  644. end;
  645. if count_ref then
  646. inc(p.firstpasscount);
  647. {$endif extdebug}
  648. end;
  649. function do_firstpass(var p : tnode) : boolean;
  650. begin
  651. aktexceptblock:=nil;
  652. codegenerror:=false;
  653. firstpass(p);
  654. do_firstpass:=codegenerror;
  655. end;
  656. begin
  657. cnothingnode:=tnothingnode;
  658. cerrornode:=terrornode;
  659. casmnode:=tasmnode;
  660. cstatementnode:=tstatementnode;
  661. cblocknode:=tblocknode;
  662. end.
  663. {$endif cg11}
  664. {
  665. $Log$
  666. Revision 1.8 2000-10-01 19:48:25 peter
  667. * lot of compile updates for cg11
  668. Revision 1.7 2000/09/30 16:08:45 peter
  669. * more cg11 updates
  670. Revision 1.6 2000/09/28 19:49:52 florian
  671. *** empty log message ***
  672. Revision 1.5 2000/09/24 21:15:34 florian
  673. * some errors fix to get more stuff compilable
  674. Revision 1.4 2000/09/24 15:06:21 peter
  675. * use defines.inc
  676. Revision 1.3 2000/09/19 23:09:07 pierre
  677. * problems wih extdebug cond. solved
  678. Revision 1.2 2000/07/13 11:32:44 michael
  679. + removed logs
  680. }