nflw.pas 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Type checking and register allocation for nodes that influence
  5. the flow
  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 nflw;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. node,cpubase,
  24. aasmbase,aasmtai,aasmcpu,symnot,
  25. symtype,symbase,symdef,symsym;
  26. type
  27. { flags used by loop nodes }
  28. tloopflag = (
  29. { set if it is a for ... downto ... do loop }
  30. lnf_backward,
  31. { Do we need to parse childs to set var state? }
  32. lnf_varstate,
  33. { Do a test at the begin of the loop?}
  34. lnf_testatbegin,
  35. { Negate the loop test? }
  36. lnf_checknegate,
  37. { Should the value of the loop variable on exit be correct. }
  38. lnf_dont_mind_loopvar_on_exit);
  39. tloopflags = set of tloopflag;
  40. const
  41. { loop flags which must match to consider loop nodes equal regarding the flags }
  42. loopflagsequal = [lnf_backward];
  43. type
  44. tloopnode = class(tbinarynode)
  45. t1,t2 : tnode;
  46. loopflags : tloopflags;
  47. constructor create(tt : tnodetype;l,r,_t1,_t2 : tnode);virtual;
  48. destructor destroy;override;
  49. function getcopy : tnode;override;
  50. constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
  51. procedure ppuwrite(ppufile:tcompilerppufile);override;
  52. procedure buildderefimpl;override;
  53. procedure derefimpl;override;
  54. procedure insertintolist(l : tnodelist);override;
  55. procedure printnodetree(var t:text);override;
  56. function docompare(p: tnode): boolean; override;
  57. end;
  58. twhilerepeatnode = class(tloopnode)
  59. constructor create(l,r,_t1:Tnode;tab,cn:boolean);virtual;
  60. function det_resulttype:tnode;override;
  61. function pass_1 : tnode;override;
  62. {$ifdef state_tracking}
  63. function track_state_pass(exec_known:boolean):boolean;override;
  64. {$endif}
  65. end;
  66. twhilerepeatnodeclass = class of twhilerepeatnode;
  67. tifnode = class(tloopnode)
  68. constructor create(l,r,_t1 : tnode);virtual;
  69. function det_resulttype:tnode;override;
  70. function pass_1 : tnode;override;
  71. end;
  72. tifnodeclass = class of tifnode;
  73. tfornode = class(tloopnode)
  74. loopvar_notid:cardinal;
  75. constructor create(l,r,_t1,_t2 : tnode;back : boolean);virtual;
  76. procedure loop_var_access(not_type:Tnotification_flag;symbol:Tsym);
  77. function det_resulttype:tnode;override;
  78. function pass_1 : tnode;override;
  79. end;
  80. tfornodeclass = class of tfornode;
  81. texitnode = class(tunarynode)
  82. constructor create(l:tnode);virtual;
  83. constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
  84. procedure ppuwrite(ppufile:tcompilerppufile);override;
  85. function det_resulttype:tnode;override;
  86. function pass_1 : tnode;override;
  87. end;
  88. texitnodeclass = class of texitnode;
  89. tbreaknode = class(tnode)
  90. constructor create;virtual;
  91. function det_resulttype:tnode;override;
  92. function pass_1 : tnode;override;
  93. end;
  94. tbreaknodeclass = class of tbreaknode;
  95. tcontinuenode = class(tnode)
  96. constructor create;virtual;
  97. function det_resulttype:tnode;override;
  98. function pass_1 : tnode;override;
  99. end;
  100. tcontinuenodeclass = class of tcontinuenode;
  101. tgotonode = class(tnode)
  102. labsym : tlabelsym;
  103. labsymderef : tderef;
  104. exceptionblock : integer;
  105. { internlab : tinterngotolabel;}
  106. constructor create(p : tlabelsym);virtual;
  107. { constructor createintern(g:tinterngotolabel);}
  108. constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
  109. procedure ppuwrite(ppufile:tcompilerppufile);override;
  110. procedure buildderefimpl;override;
  111. procedure derefimpl;override;
  112. function getcopy : tnode;override;
  113. function det_resulttype:tnode;override;
  114. function pass_1 : tnode;override;
  115. function docompare(p: tnode): boolean; override;
  116. end;
  117. tgotonodeclass = class of tgotonode;
  118. tlabelnode = class(tunarynode)
  119. labelnr : tasmlabel;
  120. labsym : tlabelsym;
  121. labsymderef : tderef;
  122. exceptionblock : integer;
  123. constructor createcase(p : tasmlabel;l:tnode);virtual;
  124. constructor create(p : tlabelsym;l:tnode);virtual;
  125. constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
  126. procedure ppuwrite(ppufile:tcompilerppufile);override;
  127. procedure buildderefimpl;override;
  128. procedure derefimpl;override;
  129. function getcopy : tnode;override;
  130. function det_resulttype:tnode;override;
  131. function pass_1 : tnode;override;
  132. function docompare(p: tnode): boolean; override;
  133. end;
  134. tlabelnodeclass = class of tlabelnode;
  135. traisenode = class(tbinarynode)
  136. frametree : tnode;
  137. constructor create(l,taddr,tframe:tnode);virtual;
  138. constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
  139. procedure ppuwrite(ppufile:tcompilerppufile);override;
  140. procedure buildderefimpl;override;
  141. procedure derefimpl;override;
  142. function getcopy : tnode;override;
  143. procedure insertintolist(l : tnodelist);override;
  144. function det_resulttype:tnode;override;
  145. function pass_1 : tnode;override;
  146. function docompare(p: tnode): boolean; override;
  147. end;
  148. traisenodeclass = class of traisenode;
  149. ttryexceptnode = class(tloopnode)
  150. constructor create(l,r,_t1 : tnode);virtual;
  151. function det_resulttype:tnode;override;
  152. function pass_1 : tnode;override;
  153. end;
  154. ttryexceptnodeclass = class of ttryexceptnode;
  155. ttryfinallynode = class(tloopnode)
  156. implicitframe : boolean;
  157. constructor create(l,r:tnode);virtual;
  158. constructor create_implicit(l,r,_t1:tnode);virtual;
  159. function det_resulttype:tnode;override;
  160. function pass_1 : tnode;override;
  161. end;
  162. ttryfinallynodeclass = class of ttryfinallynode;
  163. tonnode = class(tbinarynode)
  164. exceptsymtable : tsymtable;
  165. excepttype : tobjectdef;
  166. constructor create(l,r:tnode);virtual;
  167. destructor destroy;override;
  168. constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
  169. function det_resulttype:tnode;override;
  170. function pass_1 : tnode;override;
  171. function getcopy : tnode;override;
  172. function docompare(p: tnode): boolean; override;
  173. end;
  174. tonnodeclass = class of tonnode;
  175. { for compatibilty }
  176. function genloopnode(t : tnodetype;l,r,n1 : tnode;back : boolean) : tnode;
  177. var
  178. cwhilerepeatnode : twhilerepeatnodeclass;
  179. cifnode : tifnodeclass;
  180. cfornode : tfornodeclass;
  181. cexitnode : texitnodeclass;
  182. cbreaknode : tbreaknodeclass;
  183. ccontinuenode : tcontinuenodeclass;
  184. cgotonode : tgotonodeclass;
  185. clabelnode : tlabelnodeclass;
  186. craisenode : traisenodeclass;
  187. ctryexceptnode : ttryexceptnodeclass;
  188. ctryfinallynode : ttryfinallynodeclass;
  189. connode : tonnodeclass;
  190. implementation
  191. uses
  192. globtype,systems,
  193. cutils,verbose,globals,
  194. symconst,paramgr,defcmp,defutil,htypechk,pass_1,
  195. ncal,nadd,ncon,nmem,nld,ncnv,nbas,cgobj,
  196. {$ifdef state_tracking}
  197. nstate,
  198. {$endif}
  199. cgbase,procinfo
  200. ;
  201. function genloopnode(t : tnodetype;l,r,n1 : tnode;back : boolean) : tnode;
  202. var
  203. p : tnode;
  204. begin
  205. case t of
  206. ifn:
  207. p:=cifnode.create(l,r,n1);
  208. whilerepeatn:
  209. if back then
  210. {Repeat until.}
  211. p:=cwhilerepeatnode.create(l,r,n1,false,true)
  212. else
  213. {While do.}
  214. p:=cwhilerepeatnode.create(l,r,n1,true,false);
  215. forn:
  216. p:=cfornode.create(l,r,n1,nil,back);
  217. end;
  218. resulttypepass(p);
  219. genloopnode:=p;
  220. end;
  221. {****************************************************************************
  222. TLOOPNODE
  223. *****************************************************************************}
  224. constructor tloopnode.create(tt : tnodetype;l,r,_t1,_t2 : tnode);
  225. begin
  226. inherited create(tt,l,r);
  227. t1:=_t1;
  228. t2:=_t2;
  229. fileinfo:=l.fileinfo;
  230. end;
  231. destructor tloopnode.destroy;
  232. begin
  233. t1.free;
  234. t2.free;
  235. inherited destroy;
  236. end;
  237. constructor tloopnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
  238. begin
  239. inherited ppuload(t,ppufile);
  240. t1:=ppuloadnode(ppufile);
  241. t2:=ppuloadnode(ppufile);
  242. end;
  243. procedure tloopnode.ppuwrite(ppufile:tcompilerppufile);
  244. begin
  245. inherited ppuwrite(ppufile);
  246. ppuwritenode(ppufile,t1);
  247. ppuwritenode(ppufile,t2);
  248. end;
  249. procedure tloopnode.buildderefimpl;
  250. begin
  251. inherited buildderefimpl;
  252. if assigned(t1) then
  253. t1.buildderefimpl;
  254. if assigned(t2) then
  255. t2.buildderefimpl;
  256. end;
  257. procedure tloopnode.derefimpl;
  258. begin
  259. inherited derefimpl;
  260. if assigned(t1) then
  261. t1.derefimpl;
  262. if assigned(t2) then
  263. t2.derefimpl;
  264. end;
  265. function tloopnode.getcopy : tnode;
  266. var
  267. p : tloopnode;
  268. begin
  269. p:=tloopnode(inherited getcopy);
  270. if assigned(t1) then
  271. p.t1:=t1.getcopy
  272. else
  273. p.t1:=nil;
  274. if assigned(t2) then
  275. p.t2:=t2.getcopy
  276. else
  277. p.t2:=nil;
  278. p.loopflags:=loopflags;
  279. getcopy:=p;
  280. end;
  281. procedure tloopnode.insertintolist(l : tnodelist);
  282. begin
  283. end;
  284. procedure tloopnode.printnodetree(var t:text);
  285. begin
  286. write(t,printnodeindention,'(');
  287. printnodeindent;
  288. printnodeinfo(t);
  289. writeln(t);
  290. printnode(t,left);
  291. printnode(t,right);
  292. printnode(t,t1);
  293. printnode(t,t2);
  294. printnodeunindent;
  295. writeln(t,printnodeindention,')');
  296. end;
  297. function tloopnode.docompare(p: tnode): boolean;
  298. begin
  299. docompare :=
  300. inherited docompare(p) and
  301. (loopflags*loopflagsequal=tloopnode(p).loopflags*loopflagsequal) and
  302. t1.isequal(tloopnode(p).t1) and
  303. t2.isequal(tloopnode(p).t2);
  304. end;
  305. {****************************************************************************
  306. TWHILEREPEATNODE
  307. *****************************************************************************}
  308. constructor Twhilerepeatnode.create(l,r,_t1:Tnode;tab,cn:boolean);
  309. begin
  310. inherited create(whilerepeatn,l,r,_t1,nil);
  311. if tab then
  312. include(loopflags, lnf_testatbegin);
  313. if cn then
  314. include(loopflags,lnf_checknegate);
  315. end;
  316. function twhilerepeatnode.det_resulttype:tnode;
  317. var
  318. t:Tunarynode;
  319. begin
  320. result:=nil;
  321. resulttype:=voidtype;
  322. resulttypepass(left);
  323. {A not node can be removed.}
  324. if left.nodetype=notn then
  325. begin
  326. t:=Tunarynode(left);
  327. left:=Tunarynode(left).left;
  328. t.left:=nil;
  329. t.destroy;
  330. {Symdif operator, in case you are wondering:}
  331. loopflags:=loopflags >< [lnf_checknegate];
  332. end;
  333. { loop instruction }
  334. if assigned(right) then
  335. resulttypepass(right);
  336. set_varstate(left,vs_used,true);
  337. if codegenerror then
  338. exit;
  339. if not is_boolean(left.resulttype.def) then
  340. CGMessage1(type_e_boolean_expr_expected,left.resulttype.def.typename);
  341. { optimize constant expressions }
  342. if (left.nodetype=ordconstn) then
  343. begin
  344. { while false do }
  345. if (lnf_testatbegin in loopflags) and
  346. (tordconstnode(left).value=0) then
  347. begin
  348. if assigned(right) then
  349. CGMessagePos(right.fileinfo,cg_w_unreachable_code);
  350. result:=cnothingnode.create;
  351. end
  352. else
  353. { repeat until true }
  354. if not(lnf_testatbegin in loopflags) and
  355. (tordconstnode(left).value=1) then
  356. begin
  357. result:=right;
  358. right:=nil;
  359. end;
  360. end;
  361. end;
  362. function twhilerepeatnode.pass_1 : tnode;
  363. var
  364. old_t_times : longint;
  365. begin
  366. result:=nil;
  367. expectloc:=LOC_VOID;
  368. old_t_times:=cg.t_times;
  369. { calc register weight }
  370. if not(cs_littlesize in aktglobalswitches ) then
  371. cg.t_times:=cg.t_times*8;
  372. firstpass(left);
  373. if codegenerror then
  374. exit;
  375. registersint:=left.registersint;
  376. registersfpu:=left.registersfpu;
  377. {$ifdef SUPPORT_MMX}
  378. registersmmx:=left.registersmmx;
  379. {$endif SUPPORT_MMX}
  380. { loop instruction }
  381. if assigned(right) then
  382. begin
  383. firstpass(right);
  384. if codegenerror then
  385. exit;
  386. if registersint<right.registersint then
  387. registersint:=right.registersint;
  388. if registersfpu<right.registersfpu then
  389. registersfpu:=right.registersfpu;
  390. {$ifdef SUPPORT_MMX}
  391. if registersmmx<right.registersmmx then
  392. registersmmx:=right.registersmmx;
  393. {$endif SUPPORT_MMX}
  394. end;
  395. cg.t_times:=old_t_times;
  396. end;
  397. {$ifdef state_tracking}
  398. function Twhilerepeatnode.track_state_pass(exec_known:boolean):boolean;
  399. var condition:Tnode;
  400. code:Tnode;
  401. done:boolean;
  402. value:boolean;
  403. change:boolean;
  404. firsttest:boolean;
  405. factval:Tnode;
  406. begin
  407. track_state_pass:=false;
  408. done:=false;
  409. firsttest:=true;
  410. {For repeat until statements, first do a pass through the code.}
  411. if not(lnf_testatbegin in flags) then
  412. begin
  413. code:=right.getcopy;
  414. if code.track_state_pass(exec_known) then
  415. track_state_pass:=true;
  416. code.destroy;
  417. end;
  418. repeat
  419. condition:=left.getcopy;
  420. code:=right.getcopy;
  421. change:=condition.track_state_pass(exec_known);
  422. factval:=aktstate.find_fact(left);
  423. if factval<>nil then
  424. begin
  425. condition.destroy;
  426. condition:=factval.getcopy;
  427. change:=true;
  428. end;
  429. if change then
  430. begin
  431. track_state_pass:=true;
  432. {Force new resulttype pass.}
  433. condition.resulttype.def:=nil;
  434. do_resulttypepass(condition);
  435. end;
  436. if is_constboolnode(condition) then
  437. begin
  438. {Try to turn a while loop into a repeat loop.}
  439. if firsttest then
  440. exclude(flags,testatbegin);
  441. value:=(Tordconstnode(condition).value<>0) xor checknegate;
  442. if value then
  443. begin
  444. if code.track_state_pass(exec_known) then
  445. track_state_pass:=true;
  446. end
  447. else
  448. done:=true;
  449. end
  450. else
  451. begin
  452. {Remove any modified variables from the state.}
  453. code.track_state_pass(false);
  454. done:=true;
  455. end;
  456. code.destroy;
  457. condition.destroy;
  458. firsttest:=false;
  459. until done;
  460. {The loop condition is also known, for example:
  461. while i<10 do
  462. begin
  463. ...
  464. end;
  465. When the loop is done, we do know that i<10 = false.
  466. }
  467. condition:=left.getcopy;
  468. if condition.track_state_pass(exec_known) then
  469. begin
  470. track_state_pass:=true;
  471. {Force new resulttype pass.}
  472. condition.resulttype.def:=nil;
  473. do_resulttypepass(condition);
  474. end;
  475. if not is_constboolnode(condition) then
  476. aktstate.store_fact(condition,
  477. cordconstnode.create(byte(checknegate),booltype,true))
  478. else
  479. condition.destroy;
  480. end;
  481. {$endif}
  482. {*****************************************************************************
  483. TIFNODE
  484. *****************************************************************************}
  485. constructor tifnode.create(l,r,_t1 : tnode);
  486. begin
  487. inherited create(ifn,l,r,_t1,nil);
  488. end;
  489. function tifnode.det_resulttype:tnode;
  490. begin
  491. result:=nil;
  492. resulttype:=voidtype;
  493. resulttypepass(left);
  494. { if path }
  495. if assigned(right) then
  496. resulttypepass(right);
  497. { else path }
  498. if assigned(t1) then
  499. resulttypepass(t1);
  500. set_varstate(left,vs_used,true);
  501. if codegenerror then
  502. exit;
  503. if not is_boolean(left.resulttype.def) then
  504. Message1(type_e_boolean_expr_expected,left.resulttype.def.typename);
  505. { optimize constant expressions }
  506. if left.nodetype=ordconstn then
  507. begin
  508. if tordconstnode(left).value=1 then
  509. begin
  510. if assigned(right) then
  511. result:=right
  512. else
  513. result:=cnothingnode.create;
  514. right:=nil;
  515. if assigned(t1) then
  516. CGMessagePos(t1.fileinfo,cg_w_unreachable_code);
  517. end
  518. else
  519. begin
  520. if assigned(t1) then
  521. result:=t1
  522. else
  523. result:=cnothingnode.create;
  524. t1:=nil;
  525. if assigned(right) then
  526. CGMessagePos(right.fileinfo,cg_w_unreachable_code);
  527. end;
  528. end;
  529. end;
  530. function tifnode.pass_1 : tnode;
  531. var
  532. old_t_times : longint;
  533. begin
  534. result:=nil;
  535. expectloc:=LOC_VOID;
  536. old_t_times:=cg.t_times;
  537. firstpass(left);
  538. registersint:=left.registersint;
  539. registersfpu:=left.registersfpu;
  540. {$ifdef SUPPORT_MMX}
  541. registersmmx:=left.registersmmx;
  542. {$endif SUPPORT_MMX}
  543. { determines registers weigths }
  544. if not(cs_littlesize in aktglobalswitches) then
  545. cg.t_times:=cg.t_times div 2;
  546. if cg.t_times=0 then
  547. cg.t_times:=1;
  548. { if path }
  549. if assigned(right) then
  550. begin
  551. firstpass(right);
  552. if registersint<right.registersint then
  553. registersint:=right.registersint;
  554. if registersfpu<right.registersfpu then
  555. registersfpu:=right.registersfpu;
  556. {$ifdef SUPPORT_MMX}
  557. if registersmmx<right.registersmmx then
  558. registersmmx:=right.registersmmx;
  559. {$endif SUPPORT_MMX}
  560. end;
  561. { else path }
  562. if assigned(t1) then
  563. begin
  564. firstpass(t1);
  565. if registersint<t1.registersint then
  566. registersint:=t1.registersint;
  567. if registersfpu<t1.registersfpu then
  568. registersfpu:=t1.registersfpu;
  569. {$ifdef SUPPORT_MMX}
  570. if registersmmx<t1.registersmmx then
  571. registersmmx:=t1.registersmmx;
  572. {$endif SUPPORT_MMX}
  573. end;
  574. { leave if we've got an error in one of the paths }
  575. if codegenerror then
  576. exit;
  577. cg.t_times:=old_t_times;
  578. end;
  579. {*****************************************************************************
  580. TFORNODE
  581. *****************************************************************************}
  582. constructor tfornode.create(l,r,_t1,_t2 : tnode;back : boolean);
  583. begin
  584. inherited create(forn,l,r,_t1,_t2);
  585. if back then
  586. include(loopflags,lnf_backward);
  587. include(loopflags,lnf_testatbegin);
  588. end;
  589. procedure Tfornode.loop_var_access(not_type:Tnotification_flag;
  590. symbol:Tsym);
  591. begin
  592. {If there is a read access, the value of the loop counter is important;
  593. at the end of the loop the loop variable should contain the value it
  594. had in the last iteration.}
  595. if not_type=vn_onwrite then
  596. begin
  597. writeln('Loopvar does not matter on exit');
  598. end
  599. else
  600. begin
  601. exclude(loopflags,lnf_dont_mind_loopvar_on_exit);
  602. writeln('Loopvar does matter on exit');
  603. end;
  604. Tabstractvarsym(symbol).unregister_notification(loopvar_notid);
  605. end;
  606. function tfornode.det_resulttype:tnode;
  607. begin
  608. result:=nil;
  609. resulttype:=voidtype;
  610. {Can we spare the first comparision?}
  611. if (right.nodetype=ordconstn) and
  612. (Tassignmentnode(left).right.nodetype=ordconstn) and
  613. (
  614. (
  615. (lnf_backward in loopflags) and
  616. (Tordconstnode(Tassignmentnode(left).right).value>=Tordconstnode(right).value)
  617. ) or
  618. (
  619. not(lnf_backward in loopflags) and
  620. (Tordconstnode(Tassignmentnode(left).right).value<=Tordconstnode(right).value)
  621. )
  622. ) then
  623. exclude(loopflags,lnf_testatbegin);
  624. { save counter var }
  625. t2:=tassignmentnode(left).left.getcopy;
  626. resulttypepass(left);
  627. set_varstate(left,vs_used,true);
  628. if assigned(t1) then
  629. begin
  630. resulttypepass(t1);
  631. if codegenerror then
  632. exit;
  633. end;
  634. { process count var }
  635. resulttypepass(t2);
  636. set_varstate(t2,vs_used,false);
  637. if codegenerror then
  638. exit;
  639. resulttypepass(right);
  640. set_varstate(right,vs_used,true);
  641. inserttypeconv(right,t2.resulttype);
  642. end;
  643. function tfornode.pass_1 : tnode;
  644. var
  645. old_t_times : longint;
  646. begin
  647. result:=nil;
  648. expectloc:=LOC_VOID;
  649. { Calc register weight }
  650. old_t_times:=cg.t_times;
  651. if not(cs_littlesize in aktglobalswitches) then
  652. cg.t_times:=cg.t_times*8;
  653. firstpass(left);
  654. if assigned(t1) then
  655. begin
  656. firstpass(t1);
  657. if codegenerror then
  658. exit;
  659. end;
  660. registersint:=t1.registersint;
  661. registersfpu:=t1.registersfpu;
  662. {$ifdef SUPPORT_MMX}
  663. registersmmx:=left.registersmmx;
  664. {$endif SUPPORT_MMX}
  665. if left.registersint>registersint then
  666. registersint:=left.registersint;
  667. if left.registersfpu>registersfpu then
  668. registersfpu:=left.registersfpu;
  669. {$ifdef SUPPORT_MMX}
  670. if left.registersmmx>registersmmx then
  671. registersmmx:=left.registersmmx;
  672. {$endif SUPPORT_MMX}
  673. { process count var }
  674. firstpass(t2);
  675. if codegenerror then
  676. exit;
  677. if t2.registersint>registersint then
  678. registersint:=t2.registersint;
  679. if t2.registersfpu>registersfpu then
  680. registersfpu:=t2.registersfpu;
  681. {$ifdef SUPPORT_MMX}
  682. if t2.registersmmx>registersmmx then
  683. registersmmx:=t2.registersmmx;
  684. {$endif SUPPORT_MMX}
  685. firstpass(right);
  686. {$ifdef loopvar_dont_mind}
  687. { Check count var, record fields are also allowed in tp7 }
  688. include(loopflags,lnf_dont_mind_loopvar_on_exit);
  689. hp:=t2;
  690. while (hp.nodetype=subscriptn) or
  691. ((hp.nodetype=vecn) and
  692. is_constintnode(tvecnode(hp).right)) do
  693. hp:=tunarynode(hp).left;
  694. if (hp.nodetype=loadn) and (Tloadnode(hp).symtableentry.typ=varsym) then
  695. loopvar_notid:=Tvarsym(Tloadnode(hp).symtableentry).
  696. register_notification([vn_onread,vn_onwrite],@loop_var_access);
  697. {$endif}
  698. if right.registersint>registersint then
  699. registersint:=right.registersint;
  700. if right.registersfpu>registersfpu then
  701. registersfpu:=right.registersfpu;
  702. {$ifdef SUPPORT_MMX}
  703. if right.registersmmx>registersmmx then
  704. registersmmx:=right.registersmmx;
  705. {$endif SUPPORT_MMX}
  706. { we need at least one register for comparisons PM }
  707. if registersint=0 then
  708. inc(registersint);
  709. cg.t_times:=old_t_times;
  710. end;
  711. {*****************************************************************************
  712. TEXITNODE
  713. *****************************************************************************}
  714. constructor texitnode.create(l:tnode);
  715. begin
  716. inherited create(exitn,l);
  717. end;
  718. constructor texitnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
  719. begin
  720. inherited ppuload(t,ppufile);
  721. end;
  722. procedure texitnode.ppuwrite(ppufile:tcompilerppufile);
  723. begin
  724. inherited ppuwrite(ppufile);
  725. end;
  726. function texitnode.det_resulttype:tnode;
  727. begin
  728. result:=nil;
  729. if assigned(left) then
  730. begin
  731. { add assignment to funcretsym }
  732. inserttypeconv(left,current_procinfo.procdef.rettype);
  733. left:=cassignmentnode.create(
  734. cloadnode.create(current_procinfo.procdef.funcretsym,current_procinfo.procdef.funcretsym.owner),
  735. left);
  736. resulttypepass(left);
  737. set_varstate(left,vs_used,true);
  738. end;
  739. resulttype:=voidtype;
  740. end;
  741. function texitnode.pass_1 : tnode;
  742. begin
  743. result:=nil;
  744. expectloc:=LOC_VOID;
  745. if assigned(left) then
  746. begin
  747. firstpass(left);
  748. if codegenerror then
  749. exit;
  750. registersint:=left.registersint;
  751. registersfpu:=left.registersfpu;
  752. {$ifdef SUPPORT_MMX}
  753. registersmmx:=left.registersmmx;
  754. {$endif SUPPORT_MMX}
  755. end;
  756. end;
  757. {*****************************************************************************
  758. TBREAKNODE
  759. *****************************************************************************}
  760. constructor tbreaknode.create;
  761. begin
  762. inherited create(breakn);
  763. end;
  764. function tbreaknode.det_resulttype:tnode;
  765. begin
  766. result:=nil;
  767. resulttype:=voidtype;
  768. end;
  769. function tbreaknode.pass_1 : tnode;
  770. begin
  771. result:=nil;
  772. expectloc:=LOC_VOID;
  773. end;
  774. {*****************************************************************************
  775. TCONTINUENODE
  776. *****************************************************************************}
  777. constructor tcontinuenode.create;
  778. begin
  779. inherited create(continuen);
  780. end;
  781. function tcontinuenode.det_resulttype:tnode;
  782. begin
  783. result:=nil;
  784. resulttype:=voidtype;
  785. end;
  786. function tcontinuenode.pass_1 : tnode;
  787. begin
  788. result:=nil;
  789. expectloc:=LOC_VOID;
  790. end;
  791. {*****************************************************************************
  792. TGOTONODE
  793. *****************************************************************************}
  794. constructor tgotonode.create(p : tlabelsym);
  795. begin
  796. inherited create(goton);
  797. exceptionblock:=aktexceptblock;
  798. labsym:=p;
  799. end;
  800. constructor tgotonode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
  801. begin
  802. inherited ppuload(t,ppufile);
  803. ppufile.getderef(labsymderef);
  804. exceptionblock:=ppufile.getbyte;
  805. end;
  806. procedure tgotonode.ppuwrite(ppufile:tcompilerppufile);
  807. begin
  808. inherited ppuwrite(ppufile);
  809. ppufile.putderef(labsymderef);
  810. ppufile.putbyte(exceptionblock);
  811. end;
  812. procedure tgotonode.buildderefimpl;
  813. begin
  814. inherited buildderefimpl;
  815. labsymderef.build(labsym);
  816. end;
  817. procedure tgotonode.derefimpl;
  818. begin
  819. inherited derefimpl;
  820. labsym:=tlabelsym(labsymderef.resolve);
  821. end;
  822. function tgotonode.det_resulttype:tnode;
  823. begin
  824. result:=nil;
  825. resulttype:=voidtype;
  826. end;
  827. function tgotonode.pass_1 : tnode;
  828. begin
  829. result:=nil;
  830. expectloc:=LOC_VOID;
  831. { check if }
  832. if assigned(labsym) and
  833. assigned(labsym.code) and
  834. (exceptionblock<>tlabelnode(labsym.code).exceptionblock) then
  835. CGMessage(cg_e_goto_inout_of_exception_block);
  836. end;
  837. function tgotonode.getcopy : tnode;
  838. var
  839. p : tgotonode;
  840. begin
  841. p:=tgotonode(inherited getcopy);
  842. p.labsym:=labsym;
  843. p.exceptionblock:=exceptionblock;
  844. result:=p;
  845. end;
  846. function tgotonode.docompare(p: tnode): boolean;
  847. begin
  848. docompare := false;
  849. end;
  850. {*****************************************************************************
  851. TLABELNODE
  852. *****************************************************************************}
  853. constructor tlabelnode.createcase(p : tasmlabel;l:tnode);
  854. begin
  855. inherited create(labeln,l);
  856. { it shouldn't be possible to jump to case labels using goto }
  857. exceptionblock:=-1;
  858. labsym:=nil;
  859. labelnr:=p;
  860. end;
  861. constructor tlabelnode.create(p : tlabelsym;l:tnode);
  862. begin
  863. inherited create(labeln,l);
  864. exceptionblock:=aktexceptblock;
  865. labsym:=p;
  866. labelnr:=p.lab;
  867. { save the current labelnode in the labelsym }
  868. p.code:=self;
  869. end;
  870. constructor tlabelnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
  871. begin
  872. inherited ppuload(t,ppufile);
  873. ppufile.getderef(labsymderef);
  874. labelnr:=tasmlabel(ppufile.getasmsymbol);
  875. exceptionblock:=ppufile.getbyte;
  876. end;
  877. procedure tlabelnode.ppuwrite(ppufile:tcompilerppufile);
  878. begin
  879. inherited ppuwrite(ppufile);
  880. ppufile.putderef(labsymderef);
  881. ppufile.putasmsymbol(labelnr);
  882. ppufile.putbyte(exceptionblock);
  883. end;
  884. procedure tlabelnode.buildderefimpl;
  885. begin
  886. inherited buildderefimpl;
  887. labsymderef.build(labsym);
  888. end;
  889. procedure tlabelnode.derefimpl;
  890. begin
  891. inherited derefimpl;
  892. labsym:=tlabelsym(labsymderef.resolve);
  893. objectlibrary.derefasmsymbol(tasmsymbol(labelnr));
  894. end;
  895. function tlabelnode.det_resulttype:tnode;
  896. begin
  897. result:=nil;
  898. { left could still be unassigned }
  899. if assigned(left) then
  900. resulttypepass(left);
  901. resulttype:=voidtype;
  902. end;
  903. function tlabelnode.pass_1 : tnode;
  904. begin
  905. result:=nil;
  906. expectloc:=LOC_VOID;
  907. if assigned(left) then
  908. begin
  909. firstpass(left);
  910. registersint:=left.registersint;
  911. registersfpu:=left.registersfpu;
  912. {$ifdef SUPPORT_MMX}
  913. registersmmx:=left.registersmmx;
  914. {$endif SUPPORT_MMX}
  915. end;
  916. end;
  917. function tlabelnode.getcopy : tnode;
  918. var
  919. p : tlabelnode;
  920. begin
  921. p:=tlabelnode(inherited getcopy);
  922. p.labelnr:=labelnr;
  923. p.exceptionblock:=exceptionblock;
  924. p.labsym:=labsym;
  925. result:=p;
  926. end;
  927. function tlabelnode.docompare(p: tnode): boolean;
  928. begin
  929. docompare := false;
  930. end;
  931. {*****************************************************************************
  932. TRAISENODE
  933. *****************************************************************************}
  934. constructor traisenode.create(l,taddr,tframe:tnode);
  935. begin
  936. inherited create(raisen,l,taddr);
  937. frametree:=tframe;
  938. end;
  939. constructor traisenode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
  940. begin
  941. inherited ppuload(t,ppufile);
  942. frametree:=ppuloadnode(ppufile);
  943. end;
  944. procedure traisenode.ppuwrite(ppufile:tcompilerppufile);
  945. begin
  946. inherited ppuwrite(ppufile);
  947. ppuwritenode(ppufile,frametree);
  948. end;
  949. procedure traisenode.buildderefimpl;
  950. begin
  951. inherited buildderefimpl;
  952. if assigned(frametree) then
  953. frametree.buildderefimpl;
  954. end;
  955. procedure traisenode.derefimpl;
  956. begin
  957. inherited derefimpl;
  958. if assigned(frametree) then
  959. frametree.derefimpl;
  960. end;
  961. function traisenode.getcopy : tnode;
  962. var
  963. n : traisenode;
  964. begin
  965. n:=traisenode(inherited getcopy);
  966. if assigned(frametree) then
  967. n.frametree:=frametree.getcopy
  968. else
  969. n.frametree:=nil;
  970. getcopy:=n;
  971. end;
  972. procedure traisenode.insertintolist(l : tnodelist);
  973. begin
  974. end;
  975. function traisenode.det_resulttype:tnode;
  976. begin
  977. result:=nil;
  978. resulttype:=voidtype;
  979. if assigned(left) then
  980. begin
  981. { first para must be a _class_ }
  982. resulttypepass(left);
  983. set_varstate(left,vs_used,true);
  984. if codegenerror then
  985. exit;
  986. if not(is_class(left.resulttype.def)) then
  987. CGMessage1(type_e_class_type_expected,left.resulttype.def.typename);
  988. { insert needed typeconvs for addr,frame }
  989. if assigned(right) then
  990. begin
  991. { addr }
  992. resulttypepass(right);
  993. inserttypeconv(right,voidpointertype);
  994. { frame }
  995. if assigned(frametree) then
  996. begin
  997. resulttypepass(frametree);
  998. inserttypeconv(frametree,voidpointertype);
  999. end;
  1000. end;
  1001. end;
  1002. end;
  1003. function traisenode.pass_1 : tnode;
  1004. begin
  1005. result:=nil;
  1006. include(current_procinfo.flags,pi_do_call);
  1007. expectloc:=LOC_VOID;
  1008. if assigned(left) then
  1009. begin
  1010. { first para must be a _class_ }
  1011. firstpass(left);
  1012. { insert needed typeconvs for addr,frame }
  1013. if assigned(right) then
  1014. begin
  1015. { addr }
  1016. firstpass(right);
  1017. { frame }
  1018. if assigned(frametree) then
  1019. firstpass(frametree);
  1020. end;
  1021. left_right_max;
  1022. end;
  1023. end;
  1024. function traisenode.docompare(p: tnode): boolean;
  1025. begin
  1026. docompare := false;
  1027. end;
  1028. {*****************************************************************************
  1029. TTRYEXCEPTNODE
  1030. *****************************************************************************}
  1031. constructor ttryexceptnode.create(l,r,_t1 : tnode);
  1032. begin
  1033. inherited create(tryexceptn,l,r,_t1,nil);
  1034. end;
  1035. function ttryexceptnode.det_resulttype:tnode;
  1036. begin
  1037. result:=nil;
  1038. resulttypepass(left);
  1039. { on statements }
  1040. if assigned(right) then
  1041. resulttypepass(right);
  1042. { else block }
  1043. if assigned(t1) then
  1044. resulttypepass(t1);
  1045. resulttype:=voidtype;
  1046. end;
  1047. function ttryexceptnode.pass_1 : tnode;
  1048. begin
  1049. result:=nil;
  1050. include(current_procinfo.flags,pi_do_call);
  1051. expectloc:=LOC_VOID;
  1052. firstpass(left);
  1053. { on statements }
  1054. if assigned(right) then
  1055. begin
  1056. firstpass(right);
  1057. registersint:=max(registersint,right.registersint);
  1058. registersfpu:=max(registersfpu,right.registersfpu);
  1059. {$ifdef SUPPORT_MMX}
  1060. registersmmx:=max(registersmmx,right.registersmmx);
  1061. {$endif SUPPORT_MMX}
  1062. end;
  1063. { else block }
  1064. if assigned(t1) then
  1065. begin
  1066. firstpass(t1);
  1067. registersint:=max(registersint,t1.registersint);
  1068. registersfpu:=max(registersfpu,t1.registersfpu);
  1069. {$ifdef SUPPORT_MMX}
  1070. registersmmx:=max(registersmmx,t1.registersmmx);
  1071. {$endif SUPPORT_MMX}
  1072. end;
  1073. end;
  1074. {*****************************************************************************
  1075. TTRYFINALLYNODE
  1076. *****************************************************************************}
  1077. constructor ttryfinallynode.create(l,r:tnode);
  1078. begin
  1079. inherited create(tryfinallyn,l,r,nil,nil);
  1080. implicitframe:=false;
  1081. end;
  1082. constructor ttryfinallynode.create_implicit(l,r,_t1:tnode);
  1083. begin
  1084. inherited create(tryfinallyn,l,r,_t1,nil);
  1085. implicitframe:=true;
  1086. end;
  1087. function ttryfinallynode.det_resulttype:tnode;
  1088. begin
  1089. result:=nil;
  1090. include(current_procinfo.flags,pi_do_call);
  1091. resulttype:=voidtype;
  1092. resulttypepass(left);
  1093. set_varstate(left,vs_used,true);
  1094. resulttypepass(right);
  1095. set_varstate(right,vs_used,true);
  1096. { special finally block only executed when there was an exception }
  1097. if assigned(t1) then
  1098. begin
  1099. resulttypepass(t1);
  1100. set_varstate(t1,vs_used,true);
  1101. end;
  1102. end;
  1103. function ttryfinallynode.pass_1 : tnode;
  1104. begin
  1105. result:=nil;
  1106. expectloc:=LOC_VOID;
  1107. firstpass(left);
  1108. firstpass(right);
  1109. left_right_max;
  1110. if assigned(t1) then
  1111. begin
  1112. firstpass(t1);
  1113. registersint:=max(registersint,t1.registersint);
  1114. registersfpu:=max(registersfpu,t1.registersfpu);
  1115. {$ifdef SUPPORT_MMX}
  1116. registersmmx:=max(registersmmx,t1.registersmmx);
  1117. {$endif SUPPORT_MMX}
  1118. end;
  1119. end;
  1120. {*****************************************************************************
  1121. TONNODE
  1122. *****************************************************************************}
  1123. constructor tonnode.create(l,r:tnode);
  1124. begin
  1125. inherited create(onn,l,r);
  1126. exceptsymtable:=nil;
  1127. excepttype:=nil;
  1128. end;
  1129. destructor tonnode.destroy;
  1130. begin
  1131. { copied nodes don't need to release the symtable }
  1132. if assigned(exceptsymtable) then
  1133. exceptsymtable.free;
  1134. inherited destroy;
  1135. end;
  1136. constructor tonnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
  1137. begin
  1138. inherited ppuload(t,ppufile);
  1139. exceptsymtable:=nil;
  1140. excepttype:=nil;
  1141. end;
  1142. function tonnode.getcopy : tnode;
  1143. var
  1144. n : tonnode;
  1145. begin
  1146. n:=tonnode(inherited getcopy);
  1147. n.exceptsymtable:=exceptsymtable.getcopy;
  1148. n.excepttype:=excepttype;
  1149. result:=n;
  1150. end;
  1151. function tonnode.det_resulttype:tnode;
  1152. begin
  1153. result:=nil;
  1154. resulttype:=voidtype;
  1155. if not(is_class(excepttype)) then
  1156. CGMessage1(type_e_class_type_expected,excepttype.typename);
  1157. if assigned(left) then
  1158. resulttypepass(left);
  1159. if assigned(right) then
  1160. resulttypepass(right);
  1161. end;
  1162. function tonnode.pass_1 : tnode;
  1163. begin
  1164. result:=nil;
  1165. include(current_procinfo.flags,pi_do_call);
  1166. expectloc:=LOC_VOID;
  1167. registersint:=0;
  1168. registersfpu:=0;
  1169. {$ifdef SUPPORT_MMX}
  1170. registersmmx:=0;
  1171. {$endif SUPPORT_MMX}
  1172. if assigned(left) then
  1173. begin
  1174. firstpass(left);
  1175. registersint:=left.registersint;
  1176. registersfpu:=left.registersfpu;
  1177. {$ifdef SUPPORT_MMX}
  1178. registersmmx:=left.registersmmx;
  1179. {$endif SUPPORT_MMX}
  1180. end;
  1181. if assigned(right) then
  1182. begin
  1183. firstpass(right);
  1184. registersint:=max(registersint,right.registersint);
  1185. registersfpu:=max(registersfpu,right.registersfpu);
  1186. {$ifdef SUPPORT_MMX}
  1187. registersmmx:=max(registersmmx,right.registersmmx);
  1188. {$endif SUPPORT_MMX}
  1189. end;
  1190. end;
  1191. function tonnode.docompare(p: tnode): boolean;
  1192. begin
  1193. docompare := false;
  1194. end;
  1195. begin
  1196. cwhilerepeatnode:=twhilerepeatnode;
  1197. cifnode:=tifnode;
  1198. cfornode:=tfornode;
  1199. cexitnode:=texitnode;
  1200. cgotonode:=tgotonode;
  1201. clabelnode:=tlabelnode;
  1202. craisenode:=traisenode;
  1203. ctryexceptnode:=ttryexceptnode;
  1204. ctryfinallynode:=ttryfinallynode;
  1205. connode:=tonnode;
  1206. end.
  1207. {
  1208. $Log$
  1209. Revision 1.106 2005-01-16 14:44:03 peter
  1210. * fix unreachable code check for repeat loop
  1211. Revision 1.105 2005/01/16 10:50:32 peter
  1212. * give warning for unreachable code in while/if statements
  1213. Revision 1.104 2005/01/03 17:55:57 florian
  1214. + first batch of patches to support tdef.getcopy fully
  1215. Revision 1.103 2004/12/26 16:22:01 peter
  1216. * fix lineinfo for with blocks
  1217. Revision 1.102 2004/11/08 22:09:59 peter
  1218. * tvarsym splitted
  1219. Revision 1.101 2004/10/15 09:14:17 mazen
  1220. - remove $IFDEF DELPHI and related code
  1221. - remove $IFDEF FPCPROCVAR and related code
  1222. Revision 1.100 2004/09/13 20:28:26 peter
  1223. * for loop variable assignment is not allowed anymore
  1224. Revision 1.99 2004/08/30 12:09:45 michael
  1225. + Patch from peter to fix bug 3272
  1226. Revision 1.98 2004/06/20 08:55:29 florian
  1227. * logs truncated
  1228. Revision 1.97 2004/06/16 20:07:08 florian
  1229. * dwarf branch merged
  1230. Revision 1.96 2004/05/23 15:04:13 peter
  1231. * remvoe writeln
  1232. Revision 1.95.2.1 2004/04/28 19:55:51 peter
  1233. * new warning for ordinal-pointer when size is different
  1234. * fixed some cg_e_ messages to the correct section type_e_ or parser_e_
  1235. Revision 1.95 2004/03/18 16:19:03 peter
  1236. * fixed operator overload allowing for pointer-string
  1237. * replaced some type_e_mismatch with more informational messages
  1238. Revision 1.94 2004/02/05 01:24:08 florian
  1239. * several fixes to compile x86-64 system
  1240. }