pass_1.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  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 cg11}
  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,nflw,
  383. cpubase,cpuasm
  384. {$ifdef newcg}
  385. ,cgbase
  386. ,tgcpu
  387. {$else newcg}
  388. ,hcodegen
  389. {$ifdef i386}
  390. ,tgeni386
  391. {$endif}
  392. {$ifdef m68k}
  393. ,tgen68k
  394. {$endif}
  395. {$endif}
  396. ;
  397. {*****************************************************************************
  398. TFIRSTNOTHING
  399. *****************************************************************************}
  400. constructor tnothingnode.create;
  401. begin
  402. inherited create(nothingn);
  403. end;
  404. function tnothingnode.pass_1 : tnode;
  405. begin
  406. pass_1:=nil;
  407. resulttype:=voiddef;
  408. end;
  409. {*****************************************************************************
  410. TFIRSTERROR
  411. *****************************************************************************}
  412. constructor terrornode.create;
  413. begin
  414. inherited create(errorn);
  415. end;
  416. function terrornode.pass_1 : tnode;
  417. begin
  418. pass_1:=nil;
  419. include(flags,nf_error);
  420. codegenerror:=true;
  421. resulttype:=generrordef;
  422. end;
  423. {*****************************************************************************
  424. TSTATEMENTNODE
  425. *****************************************************************************}
  426. constructor tstatementnode.create(l,r : tnode);
  427. begin
  428. inherited create(statementn,l,r);
  429. end;
  430. function tstatementnode.pass_1 : tnode;
  431. begin
  432. pass_1:=nil;
  433. { left is the next statement in the list }
  434. resulttype:=voiddef;
  435. { no temps over several statements }
  436. {$ifdef newcg}
  437. tg.cleartempgen;
  438. {$else newcg}
  439. cleartempgen;
  440. {$endif newcg}
  441. { right is the statement itself calln assignn or a complex one }
  442. {must_be_valid:=true; obsolete PM }
  443. firstpass(right);
  444. if (not (cs_extsyntax in aktmoduleswitches)) and
  445. assigned(right.resulttype) and
  446. (right.resulttype<>pdef(voiddef)) then
  447. CGMessage(cg_e_illegal_expression);
  448. if codegenerror then
  449. exit;
  450. registers32:=right.registers32;
  451. registersfpu:=right.registersfpu;
  452. {$ifdef SUPPORT_MMX}
  453. registersmmx:=right.registersmmx;
  454. {$endif SUPPORT_MMX}
  455. { left is the next in the list }
  456. firstpass(left);
  457. if codegenerror then
  458. exit;
  459. if right.registers32>registers32 then
  460. registers32:=right.registers32;
  461. if right.registersfpu>registersfpu then
  462. registersfpu:=right.registersfpu;
  463. {$ifdef SUPPORT_MMX}
  464. if right.registersmmx>registersmmx then
  465. registersmmx:=right.registersmmx;
  466. {$endif}
  467. end;
  468. {*****************************************************************************
  469. TBLOCKNODE
  470. *****************************************************************************}
  471. constructor tblocknode.create(l,r : tnode);
  472. begin
  473. inherited create(blockn,l,r);
  474. end;
  475. function tblocknode.pass_1 : tnode;
  476. var
  477. hp : tstatementnode;
  478. count : longint;
  479. begin
  480. pass_1:=nil;
  481. count:=0;
  482. hp:=tstatementnode(left);
  483. while assigned(hp) do
  484. begin
  485. if cs_regalloc in aktglobalswitches then
  486. begin
  487. { node transformations }
  488. { concat function result to exit }
  489. { this is wrong for string or other complex
  490. result types !!! }
  491. if ret_in_acc(procinfo^.returntype.def) and
  492. assigned(hp.left) and
  493. assigned(tstatementnode(hp.left).right) and
  494. (tstatementnode(hp.left).right.nodetype=exitn) and
  495. (hp.right.nodetype=assignn) and
  496. { !!!! this tbinarynode should be tassignmentnode }
  497. (tbinarynode(hp.right).left.nodetype=funcretn) then
  498. begin
  499. if assigned(texitnode(tstatementnode(hp.left).right).left) then
  500. CGMessage(cg_n_inefficient_code)
  501. else
  502. begin
  503. texitnode(tstatementnode(hp.left).right).left:=tstatementnode(hp.right).right;
  504. tstatementnode(hp.right).right:=nil;
  505. hp.right.free;
  506. hp.right:=nil;
  507. end;
  508. end
  509. { warning if unreachable code occurs and elimate this }
  510. else if (hp.right.nodetype in
  511. [exitn,breakn,continuen,goton]) and
  512. { statement node (JM) }
  513. assigned(hp.left) and
  514. { kind of statement! (JM) }
  515. assigned(tstatementnode(hp.left).right) and
  516. (tstatementnode(hp.left).right.nodetype<>labeln) then
  517. begin
  518. { use correct line number }
  519. aktfilepos:=hp.left.fileinfo;
  520. hp.left.free;
  521. hp.left:=nil;
  522. CGMessage(cg_w_unreachable_code);
  523. { old lines }
  524. aktfilepos:=hp.right.fileinfo;
  525. end;
  526. end;
  527. if assigned(hp.right) then
  528. begin
  529. {$ifdef newcg}
  530. tg.cleartempgen;
  531. {$else newcg}
  532. cleartempgen;
  533. {$endif newcg}
  534. codegenerror:=false;
  535. firstpass(hp.right);
  536. if (not (cs_extsyntax in aktmoduleswitches)) and
  537. assigned(hp.right.resulttype) and
  538. (hp.right.resulttype<>pdef(voiddef)) then
  539. CGMessage(cg_e_illegal_expression);
  540. {if codegenerror then
  541. exit;}
  542. hp.registers32:=hp.right.registers32;
  543. hp.registersfpu:=hp.right.registersfpu;
  544. {$ifdef SUPPORT_MMX}
  545. hp.registersmmx:=hp.right.registersmmx;
  546. {$endif SUPPORT_MMX}
  547. end
  548. else
  549. hp.registers32:=0;
  550. if hp.registers32>registers32 then
  551. registers32:=hp.registers32;
  552. if hp.registersfpu>registersfpu then
  553. registersfpu:=hp.registersfpu;
  554. {$ifdef SUPPORT_MMX}
  555. if hp.registersmmx>registersmmx then
  556. registersmmx:=hp.registersmmx;
  557. {$endif}
  558. inc(count);
  559. hp:=tstatementnode(hp.left);
  560. end;
  561. end;
  562. {*****************************************************************************
  563. TASMNODE
  564. *****************************************************************************}
  565. constructor tasmnode.create;
  566. begin
  567. inherited create(asmn);
  568. end;
  569. function tasmnode.pass_1 : tnode;
  570. begin
  571. pass_1:=nil;
  572. procinfo^.flags:=procinfo^.flags or pi_uses_asm;
  573. end;
  574. {*****************************************************************************
  575. Global procedures
  576. *****************************************************************************}
  577. procedure firstpass(var p : tnode);
  578. var
  579. oldcodegenerror : boolean;
  580. oldlocalswitches : tlocalswitches;
  581. oldpos : tfileposinfo;
  582. hp : tnode;
  583. {$ifdef extdebug}
  584. str1,str2 : string;
  585. oldp : tnode;
  586. not_first : boolean;
  587. {$endif extdebug}
  588. begin
  589. {$ifdef extdebug}
  590. inc(total_of_firstpass);
  591. if (p.firstpasscount>0) and only_one_pass then
  592. exit;
  593. {$endif extdebug}
  594. oldcodegenerror:=codegenerror;
  595. oldpos:=aktfilepos;
  596. oldlocalswitches:=aktlocalswitches;
  597. {$ifdef extdebug}
  598. if p.firstpasscount>0 then
  599. begin
  600. move(p^,str1[1],sizeof(ttree));
  601. str1[0]:=char(sizeof(ttree));
  602. new(oldp);
  603. oldp^:=p^;
  604. not_first:=true;
  605. inc(firstpass_several);
  606. end
  607. else
  608. not_first:=false;
  609. {$endif extdebug}
  610. if not(nf_error in p.flags) then
  611. begin
  612. codegenerror:=false;
  613. aktfilepos:=p.fileinfo;
  614. aktlocalswitches:=p.localswitches;
  615. hp:=p.pass_1;
  616. { should the node be replaced? }
  617. if assigned(hp) then
  618. begin
  619. p.free;
  620. p:=hp;
  621. end;
  622. aktlocalswitches:=oldlocalswitches;
  623. aktfilepos:=oldpos;
  624. if codegenerror then
  625. include(p.flags,nf_error);
  626. codegenerror:=codegenerror or oldcodegenerror;
  627. end
  628. else
  629. codegenerror:=true;
  630. {$ifdef extdebug}
  631. if not_first then
  632. begin
  633. { dirty trick to compare two ttree's (PM) }
  634. move(p^,str2[1],sizeof(ttree));
  635. str2[0]:=char(sizeof(ttree));
  636. if str1<>str2 then
  637. begin
  638. comment(v_debug,'tree changed after first counting pass '
  639. +tostr(longint(p.treetype)));
  640. compare_trees(oldp,p);
  641. end;
  642. dispose(oldp);
  643. end;
  644. if count_ref then
  645. inc(p.firstpasscount);
  646. {$endif extdebug}
  647. end;
  648. function do_firstpass(var p : tnode) : boolean;
  649. begin
  650. aktexceptblock:=nil;
  651. codegenerror:=false;
  652. firstpass(p);
  653. do_firstpass:=codegenerror;
  654. end;
  655. begin
  656. cnothingnode:=tnothingnode;
  657. cerrornode:=terrornode;
  658. casmnode:=tasmnode;
  659. cstatementnode:=tstatementnode;
  660. cblocknode:=tblocknode;
  661. end.
  662. {$endif cg11}
  663. {
  664. $Log$
  665. Revision 1.6 2000-09-28 19:49:52 florian
  666. *** empty log message ***
  667. Revision 1.5 2000/09/24 21:15:34 florian
  668. * some errors fix to get more stuff compilable
  669. Revision 1.4 2000/09/24 15:06:21 peter
  670. * use defines.inc
  671. Revision 1.3 2000/09/19 23:09:07 pierre
  672. * problems wih extdebug cond. solved
  673. Revision 1.2 2000/07/13 11:32:44 michael
  674. + removed logs
  675. }