ncnv.pas 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382
  1. {
  2. $Id$
  3. Copyright (c) 2000 by Florian Klaempfl
  4. Type checking and register allocation for type converting nodes
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit ncnv;
  19. {$i defines.inc}
  20. interface
  21. uses
  22. node,
  23. symtype,types,
  24. nld;
  25. type
  26. ttypeconvnode = class(tunarynode)
  27. totype : ttype;
  28. convtype : tconverttype;
  29. constructor create(node : tnode;const t : ttype);virtual;
  30. function getcopy : tnode;override;
  31. function pass_1 : tnode;override;
  32. function det_resulttype:tnode;override;
  33. function docompare(p: tnode) : boolean; override;
  34. private
  35. function resulttype_cord_to_pointer : tnode;
  36. function resulttype_string_to_string : tnode;
  37. function resulttype_char_to_string : tnode;
  38. function resulttype_int_to_real : tnode;
  39. function resulttype_real_to_real : tnode;
  40. function resulttype_cchar_to_pchar : tnode;
  41. function resulttype_arrayconstructor_to_set : tnode;
  42. function resulttype_call_helper(c : tconverttype) : tnode;
  43. protected
  44. function first_int_to_int : tnode;virtual;
  45. function first_cstring_to_pchar : tnode;virtual;
  46. function first_string_to_chararray : tnode;virtual;
  47. function first_string_to_string : tnode;virtual;
  48. function first_char_to_string : tnode;virtual;
  49. function first_nothing : tnode;virtual;
  50. function first_array_to_pointer : tnode;virtual;
  51. function first_int_to_real : tnode;virtual;
  52. function first_real_to_real : tnode;virtual;
  53. function first_pointer_to_array : tnode;virtual;
  54. function first_chararray_to_string : tnode;virtual;
  55. function first_cchar_to_pchar : tnode;virtual;
  56. function first_bool_to_int : tnode;virtual;
  57. function first_int_to_bool : tnode;virtual;
  58. function first_bool_to_bool : tnode;virtual;
  59. function first_proc_to_procvar : tnode;virtual;
  60. function first_load_smallset : tnode;virtual;
  61. function first_cord_to_pointer : tnode;virtual;
  62. function first_pchar_to_string : tnode;virtual;
  63. function first_ansistring_to_pchar : tnode;virtual;
  64. function first_arrayconstructor_to_set : tnode;virtual;
  65. function first_class_to_intf : tnode;virtual;
  66. function first_call_helper(c : tconverttype) : tnode;
  67. end;
  68. tasnode = class(tbinarynode)
  69. constructor create(l,r : tnode);virtual;
  70. function pass_1 : tnode;override;
  71. function det_resulttype:tnode;override;
  72. end;
  73. tisnode = class(tbinarynode)
  74. constructor create(l,r : tnode);virtual;
  75. function pass_1 : tnode;override;
  76. function det_resulttype:tnode;override;
  77. end;
  78. var
  79. ctypeconvnode : class of ttypeconvnode;
  80. casnode : class of tasnode;
  81. cisnode : class of tisnode;
  82. procedure inserttypeconv(var p:tnode;const t:ttype);
  83. procedure arrayconstructor_to_set(var p : tarrayconstructornode);
  84. implementation
  85. uses
  86. globtype,systems,tokens,
  87. cutils,verbose,globals,
  88. symconst,symdef,symsym,symtable,
  89. ncon,ncal,nset,nadd,
  90. {$ifdef newcg}
  91. cgbase,
  92. {$else newcg}
  93. hcodegen,
  94. {$endif newcg}
  95. htypechk,pass_1,cpubase,cpuinfo;
  96. {*****************************************************************************
  97. Helpers
  98. *****************************************************************************}
  99. procedure inserttypeconv(var p:tnode;const t:ttype);
  100. begin
  101. if not assigned(p.resulttype.def) then
  102. begin
  103. resulttypepass(p);
  104. if codegenerror then
  105. exit;
  106. end;
  107. { don't insert obsolete type conversions }
  108. if is_equal(p.resulttype.def,t.def) then
  109. begin
  110. p.resulttype:=t;
  111. end
  112. else
  113. begin
  114. p:=ctypeconvnode.create(p,t);
  115. resulttypepass(p);
  116. end;
  117. end;
  118. {*****************************************************************************
  119. Array constructor to Set Conversion
  120. *****************************************************************************}
  121. procedure arrayconstructor_to_set(var p : tarrayconstructornode);
  122. var
  123. constp : tsetconstnode;
  124. buildp,
  125. p2,p3,p4 : tnode;
  126. htype : ttype;
  127. constset : pconstset;
  128. constsetlo,
  129. constsethi : longint;
  130. procedure update_constsethi(t:ttype);
  131. begin
  132. if ((t.def^.deftype=orddef) and
  133. (porddef(t.def)^.high>=constsethi)) then
  134. begin
  135. constsethi:=porddef(t.def)^.high;
  136. if htype.def=nil then
  137. begin
  138. if (constsethi>255) or
  139. (porddef(t.def)^.low<0) then
  140. htype:=u8bittype
  141. else
  142. htype:=t;
  143. end;
  144. if constsethi>255 then
  145. constsethi:=255;
  146. end
  147. else if ((t.def^.deftype=enumdef) and
  148. (penumdef(t.def)^.max>=constsethi)) then
  149. begin
  150. if htype.def=nil then
  151. htype:=t;
  152. constsethi:=penumdef(t.def)^.max;
  153. end;
  154. end;
  155. procedure do_set(pos : longint);
  156. var
  157. mask,l : longint;
  158. begin
  159. if (pos>255) or (pos<0) then
  160. Message(parser_e_illegal_set_expr);
  161. if pos>constsethi then
  162. constsethi:=pos;
  163. if pos<constsetlo then
  164. constsetlo:=pos;
  165. l:=pos shr 3;
  166. mask:=1 shl (pos mod 8);
  167. { do we allow the same twice }
  168. if (constset^[l] and mask)<>0 then
  169. Message(parser_e_illegal_set_expr);
  170. constset^[l]:=constset^[l] or mask;
  171. end;
  172. var
  173. l : longint;
  174. lr,hr : longint;
  175. begin
  176. new(constset);
  177. FillChar(constset^,sizeof(constset^),0);
  178. htype.reset;
  179. constsetlo:=0;
  180. constsethi:=0;
  181. constp:=csetconstnode.create(nil,htype);
  182. constp.value_set:=constset;
  183. buildp:=constp;
  184. if assigned(p.left) then
  185. begin
  186. while assigned(p) do
  187. begin
  188. p4:=nil; { will contain the tree to create the set }
  189. {split a range into p2 and p3 }
  190. if p.left.nodetype=arrayconstructorrangen then
  191. begin
  192. p2:=tarrayconstructorrangenode(p.left).left;
  193. p3:=tarrayconstructorrangenode(p.left).right;
  194. tarrayconstructorrangenode(p.left).left:=nil;
  195. tarrayconstructorrangenode(p.left).right:=nil;
  196. end
  197. else
  198. begin
  199. p2:=p.left;
  200. p.left:=nil;
  201. p3:=nil;
  202. end;
  203. resulttypepass(p2);
  204. if assigned(p3) then
  205. resulttypepass(p3);
  206. if codegenerror then
  207. break;
  208. case p2.resulttype.def^.deftype of
  209. enumdef,
  210. orddef:
  211. begin
  212. getrange(p2.resulttype.def,lr,hr);
  213. if assigned(p3) then
  214. begin
  215. { this isn't good, you'll get problems with
  216. type t010 = 0..10;
  217. ts = set of t010;
  218. var s : ts;b : t010
  219. begin s:=[1,2,b]; end.
  220. if is_integer(p3^.resulttype.def) then
  221. begin
  222. inserttypeconv(p3,u8bitdef);
  223. end;
  224. }
  225. if assigned(htype.def) and not(is_equal(htype.def,p3.resulttype.def)) then
  226. begin
  227. aktfilepos:=p3.fileinfo;
  228. CGMessage(type_e_typeconflict_in_set);
  229. end
  230. else
  231. begin
  232. if (p2.nodetype=ordconstn) and (p3.nodetype=ordconstn) then
  233. begin
  234. if not(is_integer(p3.resulttype.def)) then
  235. htype:=p3.resulttype
  236. else
  237. begin
  238. inserttypeconv(p3,u8bittype);
  239. inserttypeconv(p2,u8bittype);
  240. end;
  241. for l:=tordconstnode(p2).value to tordconstnode(p3).value do
  242. do_set(l);
  243. p2.free;
  244. p3.free;
  245. end
  246. else
  247. begin
  248. update_constsethi(p2.resulttype);
  249. inserttypeconv(p2,htype);
  250. update_constsethi(p3.resulttype);
  251. inserttypeconv(p3,htype);
  252. if assigned(htype.def) then
  253. inserttypeconv(p3,htype)
  254. else
  255. inserttypeconv(p3,u8bittype);
  256. p4:=csetelementnode.create(p2,p3);
  257. end;
  258. end;
  259. end
  260. else
  261. begin
  262. { Single value }
  263. if p2.nodetype=ordconstn then
  264. begin
  265. if not(is_integer(p2.resulttype.def)) then
  266. update_constsethi(p2.resulttype)
  267. else
  268. inserttypeconv(p2,u8bittype);
  269. do_set(tordconstnode(p2).value);
  270. p2.free;
  271. end
  272. else
  273. begin
  274. update_constsethi(p2.resulttype);
  275. if assigned(htype.def) then
  276. inserttypeconv(p2,htype)
  277. else
  278. inserttypeconv(p2,u8bittype);
  279. p4:=csetelementnode.create(p2,nil);
  280. end;
  281. end;
  282. end;
  283. stringdef :
  284. begin
  285. { if we've already set elements which are constants }
  286. { throw an error }
  287. if ((htype.def=nil) and assigned(buildp)) or
  288. not(is_char(htype.def)) then
  289. CGMessage(type_e_typeconflict_in_set)
  290. else
  291. for l:=1 to length(pstring(tstringconstnode(p2).value_str)^) do
  292. do_set(ord(pstring(tstringconstnode(p2).value_str)^[l]));
  293. if htype.def=nil then
  294. htype:=cchartype;
  295. p2.free;
  296. end;
  297. else
  298. CGMessage(type_e_ordinal_expr_expected);
  299. end;
  300. { insert the set creation tree }
  301. if assigned(p4) then
  302. buildp:=caddnode.create(addn,buildp,p4);
  303. { load next and dispose current node }
  304. p2:=p;
  305. p:=tarrayconstructornode(tarrayconstructornode(p2).right);
  306. tarrayconstructornode(p2).right:=nil;
  307. p2.free;
  308. end;
  309. if (htype.def=nil) then
  310. begin
  311. htype:=u8bittype;
  312. constsethi:=255;
  313. end;
  314. end
  315. else
  316. begin
  317. { empty set [], only remove node }
  318. p.free;
  319. end;
  320. { set the initial set type }
  321. constp.resulttype.setdef(new(psetdef,init(htype,constsethi)));
  322. { determine the resulttype for the tree }
  323. resulttypepass(buildp);
  324. { set the new tree }
  325. p:=tarrayconstructornode(buildp);
  326. end;
  327. {*****************************************************************************
  328. TTYPECONVNODE
  329. *****************************************************************************}
  330. constructor ttypeconvnode.create(node : tnode;const t:ttype);
  331. begin
  332. inherited create(typeconvn,node);
  333. convtype:=tc_not_possible;
  334. totype:=t;
  335. if t.def=nil then
  336. internalerror(200103281);
  337. set_file_line(node);
  338. end;
  339. function ttypeconvnode.getcopy : tnode;
  340. var
  341. n : ttypeconvnode;
  342. begin
  343. n:=ttypeconvnode(inherited getcopy);
  344. n.convtype:=convtype;
  345. getcopy:=n;
  346. end;
  347. function ttypeconvnode.resulttype_cord_to_pointer : tnode;
  348. var
  349. t : tnode;
  350. begin
  351. result:=nil;
  352. if left.nodetype=ordconstn then
  353. begin
  354. { check if we have a valid pointer constant (JM) }
  355. if (sizeof(tordconstnode) > sizeof(tpointerord)) then
  356. if (sizeof(tpointerord) = 4) then
  357. begin
  358. if (tordconstnode(left).value < low(longint)) or
  359. (tordconstnode(left).value > high(cardinal)) then
  360. CGMessage(parser_e_range_check_error);
  361. end
  362. else if (sizeof(tpointerord) = 8) then
  363. begin
  364. if (tordconstnode(left).value < low(int64)) or
  365. (tordconstnode(left).value > high(qword)) then
  366. CGMessage(parser_e_range_check_error);
  367. end
  368. else
  369. internalerror(2001020801);
  370. t:=cpointerconstnode.create(tpointerord(tordconstnode(left).value),resulttype);
  371. resulttypepass(t);
  372. result:=t;
  373. end
  374. else
  375. internalerror(200104023);
  376. end;
  377. function ttypeconvnode.resulttype_string_to_string : tnode;
  378. begin
  379. result:=nil;
  380. if left.nodetype=stringconstn then
  381. begin
  382. tstringconstnode(left).st_type:=pstringdef(resulttype.def)^.string_typ;
  383. tstringconstnode(left).resulttype:=resulttype;
  384. result:=left;
  385. left:=nil;
  386. end;
  387. end;
  388. function ttypeconvnode.resulttype_char_to_string : tnode;
  389. var
  390. hp : tstringconstnode;
  391. begin
  392. result:=nil;
  393. if left.nodetype=ordconstn then
  394. begin
  395. hp:=cstringconstnode.createstr(chr(tordconstnode(left).value),st_default);
  396. hp.st_type:=pstringdef(resulttype.def)^.string_typ;
  397. resulttypepass(hp);
  398. result:=hp;
  399. end;
  400. end;
  401. function ttypeconvnode.resulttype_int_to_real : tnode;
  402. var
  403. t : trealconstnode;
  404. begin
  405. result:=nil;
  406. if left.nodetype=ordconstn then
  407. begin
  408. t:=crealconstnode.create(tordconstnode(left).value,resulttype);
  409. resulttypepass(t);
  410. result:=t;
  411. exit;
  412. end;
  413. end;
  414. function ttypeconvnode.resulttype_real_to_real : tnode;
  415. var
  416. t : tnode;
  417. begin
  418. result:=nil;
  419. if left.nodetype=realconstn then
  420. begin
  421. t:=crealconstnode.create(trealconstnode(left).value_real,resulttype);
  422. resulttypepass(t);
  423. result:=t;
  424. end;
  425. end;
  426. function ttypeconvnode.resulttype_cchar_to_pchar : tnode;
  427. begin
  428. result:=nil;
  429. inserttypeconv(left,cshortstringtype);
  430. { evaluate again, reset resulttype so the convert_typ
  431. will be calculated again }
  432. result:=det_resulttype;
  433. end;
  434. function ttypeconvnode.resulttype_arrayconstructor_to_set : tnode;
  435. var
  436. hp : tnode;
  437. begin
  438. result:=nil;
  439. if left.nodetype<>arrayconstructorn then
  440. internalerror(5546);
  441. { remove typeconv node }
  442. hp:=left;
  443. left:=nil;
  444. { create a set constructor tree }
  445. arrayconstructor_to_set(tarrayconstructornode(hp));
  446. { now resulttypepass the set }
  447. resulttypepass(hp);
  448. result:=hp;
  449. end;
  450. function ttypeconvnode.resulttype_call_helper(c : tconverttype) : tnode;
  451. const
  452. resulttypeconvert : array[tconverttype] of pointer = (
  453. {equal} nil,
  454. {not_possible} nil,
  455. { string_2_string } @ttypeconvnode.resulttype_string_to_string,
  456. { char_2_string } @ttypeconvnode.resulttype_char_to_string,
  457. { pchar_2_string } nil,
  458. { cchar_2_pchar } @ttypeconvnode.resulttype_cchar_to_pchar,
  459. { cstring_2_pchar } nil,
  460. { ansistring_2_pchar } nil,
  461. { string_2_chararray } nil,
  462. { chararray_2_string } nil,
  463. { array_2_pointer } nil,
  464. { pointer_2_array } nil,
  465. { int_2_int } nil,
  466. { int_2_bool } nil,
  467. { bool_2_bool } nil,
  468. { bool_2_int } nil,
  469. { real_2_real } @ttypeconvnode.resulttype_real_to_real,
  470. { int_2_real } @ttypeconvnode.resulttype_int_to_real,
  471. { proc_2_procvar } nil,
  472. { arrayconstructor_2_set } @ttypeconvnode.resulttype_arrayconstructor_to_set,
  473. { load_smallset } nil,
  474. { cord_2_pointer } @ttypeconvnode.resulttype_cord_to_pointer,
  475. { intf_2_string } nil,
  476. { intf_2_guid } nil,
  477. { class_2_intf } nil
  478. );
  479. type
  480. tprocedureofobject = function : tnode of object;
  481. var
  482. r : packed record
  483. proc : pointer;
  484. obj : pointer;
  485. end;
  486. begin
  487. result:=nil;
  488. { this is a little bit dirty but it works }
  489. { and should be quite portable too }
  490. r.proc:=resulttypeconvert[c];
  491. r.obj:=self;
  492. if assigned(r.proc) then
  493. result:=tprocedureofobject(r){$ifdef FPC}();{$endif FPC}
  494. end;
  495. function ttypeconvnode.det_resulttype:tnode;
  496. var
  497. hp : tnode;
  498. aprocdef : pprocdef;
  499. enable_range_check: boolean;
  500. begin
  501. result:=nil;
  502. resulttype:=totype;
  503. resulttypepass(left);
  504. if codegenerror then
  505. exit;
  506. { remove obsolete type conversions }
  507. if is_equal(left.resulttype.def,resulttype.def) then
  508. begin
  509. { becuase is_equal only checks the basetype for sets we need to
  510. check here if we are loading a smallset into a normalset }
  511. if (resulttype.def^.deftype=setdef) and
  512. (left.resulttype.def^.deftype=setdef) and
  513. (psetdef(resulttype.def)^.settype<>smallset) and
  514. (psetdef(left.resulttype.def)^.settype=smallset) then
  515. begin
  516. { try to define the set as a normalset if it's a constant set }
  517. if left.nodetype=setconstn then
  518. begin
  519. resulttype:=left.resulttype;
  520. psetdef(resulttype.def)^.settype:=normset
  521. end
  522. else
  523. convtype:=tc_load_smallset;
  524. exit;
  525. end
  526. else
  527. begin
  528. left.resulttype:=resulttype;
  529. result:=left;
  530. left:=nil;
  531. exit;
  532. end;
  533. end;
  534. aprocdef:=assignment_overloaded(left.resulttype.def,resulttype.def);
  535. if assigned(aprocdef) then
  536. begin
  537. procinfo^.flags:=procinfo^.flags or pi_do_call;
  538. hp:=ccallnode.create(ccallparanode.create(left,nil),
  539. overloaded_operators[_assignment],nil,nil);
  540. { tell explicitly which def we must use !! (PM) }
  541. tcallnode(hp).procdefinition:=aprocdef;
  542. left:=nil;
  543. resulttypepass(hp);
  544. result:=hp;
  545. exit;
  546. end;
  547. if isconvertable(left.resulttype.def,resulttype.def,convtype,left.nodetype,nf_explizit in flags)=0 then
  548. begin
  549. {Procedures have a resulttype.def of voiddef and functions of their
  550. own resulttype.def. They will therefore always be incompatible with
  551. a procvar. Because isconvertable cannot check for procedures we
  552. use an extra check for them.}
  553. if (m_tp_procvar in aktmodeswitches) then
  554. begin
  555. if (resulttype.def^.deftype=procvardef) and
  556. (is_procsym_load(left) or is_procsym_call(left)) then
  557. begin
  558. if is_procsym_call(left) then
  559. begin
  560. hp:=cloadnode.create(pprocsym(tcallnode(left).symtableprocentry),
  561. tcallnode(left).symtableproc);
  562. if (tcallnode(left).symtableprocentry^.owner^.symtabletype=objectsymtable) and
  563. assigned(tcallnode(left).methodpointer) then
  564. tloadnode(hp).set_mp(tcallnode(left).methodpointer.getcopy);
  565. resulttypepass(hp);
  566. left.free;
  567. left:=hp;
  568. aprocdef:=pprocdef(left.resulttype.def);
  569. end
  570. else
  571. begin
  572. if (left.nodetype<>addrn) then
  573. aprocdef:=pprocsym(tloadnode(left).symtableentry)^.definition;
  574. end;
  575. convtype:=tc_proc_2_procvar;
  576. { Now check if the procedure we are going to assign to
  577. the procvar, is compatible with the procvar's type }
  578. if assigned(aprocdef) then
  579. begin
  580. if not proc_to_procvar_equal(aprocdef,pprocvardef(resulttype.def)) then
  581. CGMessage2(type_e_incompatible_types,aprocdef^.typename,resulttype.def^.typename);
  582. result:=first_call_helper(convtype);
  583. end
  584. else
  585. CGMessage2(type_e_incompatible_types,left.resulttype.def^.typename,resulttype.def^.typename);
  586. exit;
  587. end;
  588. end;
  589. if nf_explizit in flags then
  590. begin
  591. { check if the result could be in a register }
  592. if not(pstoreddef(resulttype.def)^.is_intregable) and
  593. not(pstoreddef(resulttype.def)^.is_fpuregable) then
  594. make_not_regable(left);
  595. { boolean to byte are special because the
  596. location can be different }
  597. if is_integer(resulttype.def) and
  598. is_boolean(left.resulttype.def) then
  599. begin
  600. convtype:=tc_bool_2_int;
  601. result:=first_call_helper(convtype);
  602. exit;
  603. end;
  604. { ansistring to pchar }
  605. if is_pchar(resulttype.def) and
  606. is_ansistring(left.resulttype.def) then
  607. begin
  608. convtype:=tc_ansistring_2_pchar;
  609. result:=first_call_helper(convtype);
  610. exit;
  611. end;
  612. { do common tc_equal cast }
  613. convtype:=tc_equal;
  614. { enum to ordinal will always be s32bit }
  615. if (left.resulttype.def^.deftype=enumdef) and
  616. is_ordinal(resulttype.def) then
  617. begin
  618. if left.nodetype=ordconstn then
  619. begin
  620. hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
  621. resulttypepass(hp);
  622. result:=hp;
  623. exit;
  624. end
  625. else
  626. begin
  627. if isconvertable(s32bittype.def,resulttype.def,convtype,ordconstn,false)=0 then
  628. CGMessage2(type_e_incompatible_types,left.resulttype.def^.typename,resulttype.def^.typename);
  629. end;
  630. end
  631. { ordinal to enumeration }
  632. else
  633. if (resulttype.def^.deftype=enumdef) and
  634. is_ordinal(left.resulttype.def) then
  635. begin
  636. if left.nodetype=ordconstn then
  637. begin
  638. hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
  639. resulttypepass(hp);
  640. result:=hp;
  641. exit;
  642. end
  643. else
  644. begin
  645. if IsConvertable(left.resulttype.def,s32bittype.def,convtype,ordconstn,false)=0 then
  646. CGMessage2(type_e_incompatible_types,left.resulttype.def^.typename,resulttype.def^.typename);
  647. end;
  648. end
  649. { nil to ordinal node }
  650. else if is_ordinal(resulttype.def) and
  651. (left.nodetype=niln) then
  652. begin
  653. hp:=cordconstnode.create(0,resulttype);
  654. resulttypepass(hp);
  655. result:=hp;
  656. exit;
  657. end
  658. { constant pointer to ordinal }
  659. else if is_ordinal(resulttype.def) and
  660. (left.nodetype=pointerconstn) then
  661. begin
  662. hp:=cordconstnode.create(tpointerconstnode(left).value,resulttype);
  663. resulttypepass(hp);
  664. result:=hp;
  665. exit;
  666. end
  667. {Are we typecasting an ordconst to a char?}
  668. else
  669. if is_char(resulttype.def) and
  670. is_ordinal(left.resulttype.def) then
  671. begin
  672. if left.nodetype=ordconstn then
  673. begin
  674. hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
  675. resulttypepass(hp);
  676. result:=hp;
  677. exit;
  678. end
  679. else
  680. begin
  681. if IsConvertable(left.resulttype.def,u8bittype.def,convtype,ordconstn,false)=0 then
  682. CGMessage2(type_e_incompatible_types,left.resulttype.def^.typename,resulttype.def^.typename);
  683. end;
  684. end
  685. { Are we char to ordinal }
  686. else
  687. if is_char(left.resulttype.def) and
  688. is_ordinal(resulttype.def) then
  689. begin
  690. if left.nodetype=ordconstn then
  691. begin
  692. hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
  693. resulttypepass(hp);
  694. result:=hp;
  695. exit;
  696. end
  697. else
  698. begin
  699. if IsConvertable(u8bittype.def,resulttype.def,convtype,ordconstn,false)=0 then
  700. CGMessage2(type_e_incompatible_types,left.resulttype.def^.typename,resulttype.def^.typename);
  701. end;
  702. end
  703. { only if the same size or formal def }
  704. { why do we allow typecasting of voiddef ?? (PM) }
  705. else
  706. begin
  707. if not(
  708. (left.resulttype.def^.deftype=formaldef) or
  709. (left.resulttype.def^.size=resulttype.def^.size) or
  710. (is_void(left.resulttype.def) and
  711. (left.nodetype=derefn))
  712. ) then
  713. CGMessage(cg_e_illegal_type_conversion);
  714. if ((left.resulttype.def^.deftype=orddef) and
  715. (resulttype.def^.deftype=pointerdef)) or
  716. ((resulttype.def^.deftype=orddef) and
  717. (left.resulttype.def^.deftype=pointerdef)) then
  718. CGMessage(cg_d_pointer_to_longint_conv_not_portable);
  719. end;
  720. { the conversion into a strutured type is only }
  721. { possible, if the source is no register }
  722. if ((resulttype.def^.deftype in [recorddef,stringdef,arraydef]) or
  723. ((resulttype.def^.deftype=objectdef) and not(is_class(resulttype.def)))
  724. ) and (left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) { and
  725. it also works if the assignment is overloaded
  726. YES but this code is not executed if assignment is overloaded (PM)
  727. not assigned(assignment_overloaded(left.resulttype.def,resulttype.def))} then
  728. CGMessage(cg_e_illegal_type_conversion);
  729. end
  730. else
  731. CGMessage2(type_e_incompatible_types,left.resulttype.def^.typename,resulttype.def^.typename);
  732. end;
  733. { tp7 procvar support, when right is not a procvardef and we got a
  734. loadn of a procvar then convert to a calln, the check for the
  735. result is already done in is_convertible, also no conflict with
  736. @procvar is here because that has an extra addrn }
  737. if (m_tp_procvar in aktmodeswitches) and
  738. (resulttype.def^.deftype<>procvardef) and
  739. (left.resulttype.def^.deftype=procvardef) and
  740. (left.nodetype=loadn) then
  741. begin
  742. hp:=ccallnode.create(nil,nil,nil,nil);
  743. tcallnode(hp).set_procvar(left);
  744. resulttypepass(hp);
  745. left:=hp;
  746. end;
  747. { ordinal contants can be directly converted }
  748. if (left.nodetype=ordconstn) and is_ordinal(resulttype.def) then
  749. begin
  750. { range checking is done in cordconstnode.create (PFV) }
  751. { disable for explicit type casts (JM) }
  752. if (nf_explizit in flags) and
  753. (cs_check_range in aktlocalswitches) then
  754. begin
  755. exclude(aktlocalswitches,cs_check_range);
  756. enable_range_check := true;
  757. end
  758. else
  759. enable_range_check := false;
  760. hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
  761. resulttypepass(hp);
  762. { do sign extension if necessary (JM) }
  763. if not (cs_check_range in aktlocalswitches) and
  764. is_signed(resulttype.def) then
  765. with tordconstnode(hp) do
  766. case resulttype.def^.size of
  767. 1: value := shortint(value);
  768. 2: value := smallint(value);
  769. 4: value := longint(value);
  770. end;
  771. if enable_range_check then
  772. include(aktlocalswitches,cs_check_range);
  773. result:=hp;
  774. exit;
  775. end;
  776. { now call the resulttype helper to do constant folding }
  777. result:=resulttype_call_helper(convtype);
  778. end;
  779. function ttypeconvnode.first_cord_to_pointer : tnode;
  780. begin
  781. result:=nil;
  782. internalerror(200104043);
  783. end;
  784. function ttypeconvnode.first_int_to_int : tnode;
  785. begin
  786. first_int_to_int:=nil;
  787. if (left.location.loc<>LOC_REGISTER) and
  788. (resulttype.def^.size>left.resulttype.def^.size) then
  789. location.loc:=LOC_REGISTER;
  790. if is_64bitint(resulttype.def) then
  791. registers32:=max(registers32,2)
  792. else
  793. registers32:=max(registers32,1);
  794. end;
  795. function ttypeconvnode.first_cstring_to_pchar : tnode;
  796. begin
  797. first_cstring_to_pchar:=nil;
  798. registers32:=1;
  799. location.loc:=LOC_REGISTER;
  800. end;
  801. function ttypeconvnode.first_string_to_chararray : tnode;
  802. begin
  803. first_string_to_chararray:=nil;
  804. registers32:=1;
  805. location.loc:=LOC_REGISTER;
  806. end;
  807. function ttypeconvnode.first_string_to_string : tnode;
  808. begin
  809. first_string_to_string:=nil;
  810. if pstringdef(resulttype.def)^.string_typ<>
  811. pstringdef(left.resulttype.def)^.string_typ then
  812. begin
  813. procinfo^.flags:=procinfo^.flags or pi_do_call;
  814. end;
  815. { for simplicity lets first keep all ansistrings
  816. as LOC_MEM, could also become LOC_REGISTER }
  817. if pstringdef(resulttype.def)^.string_typ in [st_ansistring,st_widestring] then
  818. { we may use ansistrings so no fast exit here }
  819. procinfo^.no_fast_exit:=true;
  820. location.loc:=LOC_MEM;
  821. end;
  822. function ttypeconvnode.first_char_to_string : tnode;
  823. begin
  824. first_char_to_string:=nil;
  825. location.loc:=LOC_MEM;
  826. end;
  827. function ttypeconvnode.first_nothing : tnode;
  828. begin
  829. first_nothing:=nil;
  830. location.loc:=LOC_MEM;
  831. end;
  832. function ttypeconvnode.first_array_to_pointer : tnode;
  833. begin
  834. first_array_to_pointer:=nil;
  835. if registers32<1 then
  836. registers32:=1;
  837. location.loc:=LOC_REGISTER;
  838. end;
  839. function ttypeconvnode.first_int_to_real : tnode;
  840. begin
  841. first_int_to_real:=nil;
  842. if registersfpu<1 then
  843. registersfpu:=1;
  844. location.loc:=LOC_FPU;
  845. end;
  846. function ttypeconvnode.first_real_to_real : tnode;
  847. begin
  848. first_real_to_real:=nil;
  849. { comp isn't a floating type }
  850. {$ifdef i386}
  851. if (pfloatdef(resulttype.def)^.typ=s64comp) and
  852. (pfloatdef(left.resulttype.def)^.typ<>s64comp) and
  853. not (nf_explizit in flags) then
  854. CGMessage(type_w_convert_real_2_comp);
  855. {$endif}
  856. if registersfpu<1 then
  857. registersfpu:=1;
  858. location.loc:=LOC_FPU;
  859. end;
  860. function ttypeconvnode.first_pointer_to_array : tnode;
  861. begin
  862. first_pointer_to_array:=nil;
  863. if registers32<1 then
  864. registers32:=1;
  865. location.loc:=LOC_REFERENCE;
  866. end;
  867. function ttypeconvnode.first_chararray_to_string : tnode;
  868. begin
  869. first_chararray_to_string:=nil;
  870. { the only important information is the location of the }
  871. { result }
  872. { other stuff is done by firsttypeconv }
  873. location.loc:=LOC_MEM;
  874. end;
  875. function ttypeconvnode.first_cchar_to_pchar : tnode;
  876. begin
  877. first_cchar_to_pchar:=nil;
  878. internalerror(200104021);
  879. end;
  880. function ttypeconvnode.first_bool_to_int : tnode;
  881. begin
  882. first_bool_to_int:=nil;
  883. { byte(boolean) or word(wordbool) or longint(longbool) must
  884. be accepted for var parameters }
  885. if (nf_explizit in flags) and
  886. (left.resulttype.def^.size=resulttype.def^.size) and
  887. (left.location.loc in [LOC_REFERENCE,LOC_MEM,LOC_CREGISTER]) then
  888. exit;
  889. location.loc:=LOC_REGISTER;
  890. if registers32<1 then
  891. registers32:=1;
  892. end;
  893. function ttypeconvnode.first_int_to_bool : tnode;
  894. begin
  895. first_int_to_bool:=nil;
  896. { byte(boolean) or word(wordbool) or longint(longbool) must
  897. be accepted for var parameters }
  898. if (nf_explizit in flags) and
  899. (left.resulttype.def^.size=resulttype.def^.size) and
  900. (left.location.loc in [LOC_REFERENCE,LOC_MEM,LOC_CREGISTER]) then
  901. exit;
  902. location.loc:=LOC_REGISTER;
  903. { need if bool to bool !!
  904. not very nice !!
  905. insertypeconv(left,s32bittype);
  906. left.explizit:=true;
  907. firstpass(left); }
  908. if registers32<1 then
  909. registers32:=1;
  910. end;
  911. function ttypeconvnode.first_bool_to_bool : tnode;
  912. begin
  913. first_bool_to_bool:=nil;
  914. location.loc:=LOC_REGISTER;
  915. if registers32<1 then
  916. registers32:=1;
  917. end;
  918. function ttypeconvnode.first_proc_to_procvar : tnode;
  919. begin
  920. first_proc_to_procvar:=nil;
  921. if (left.location.loc<>LOC_REFERENCE) then
  922. CGMessage(cg_e_illegal_expression);
  923. registers32:=left.registers32;
  924. if registers32<1 then
  925. registers32:=1;
  926. location.loc:=LOC_REGISTER;
  927. end;
  928. function ttypeconvnode.first_load_smallset : tnode;
  929. begin
  930. first_load_smallset:=nil;
  931. end;
  932. function ttypeconvnode.first_pchar_to_string : tnode;
  933. begin
  934. first_pchar_to_string:=nil;
  935. location.loc:=LOC_REFERENCE;
  936. end;
  937. function ttypeconvnode.first_ansistring_to_pchar : tnode;
  938. begin
  939. first_ansistring_to_pchar:=nil;
  940. location.loc:=LOC_REGISTER;
  941. if registers32<1 then
  942. registers32:=1;
  943. end;
  944. function ttypeconvnode.first_arrayconstructor_to_set : tnode;
  945. begin
  946. first_arrayconstructor_to_set:=nil;
  947. internalerror(200104022);
  948. end;
  949. function ttypeconvnode.first_class_to_intf : tnode;
  950. begin
  951. first_class_to_intf:=nil;
  952. location.loc:=LOC_REFERENCE;
  953. if registers32<1 then
  954. registers32:=1;
  955. end;
  956. function ttypeconvnode.first_call_helper(c : tconverttype) : tnode;
  957. const
  958. firstconvert : array[tconverttype] of pointer = (
  959. @ttypeconvnode.first_nothing, {equal}
  960. @ttypeconvnode.first_nothing, {not_possible}
  961. @ttypeconvnode.first_string_to_string,
  962. @ttypeconvnode.first_char_to_string,
  963. @ttypeconvnode.first_pchar_to_string,
  964. @ttypeconvnode.first_cchar_to_pchar,
  965. @ttypeconvnode.first_cstring_to_pchar,
  966. @ttypeconvnode.first_ansistring_to_pchar,
  967. @ttypeconvnode.first_string_to_chararray,
  968. @ttypeconvnode.first_chararray_to_string,
  969. @ttypeconvnode.first_array_to_pointer,
  970. @ttypeconvnode.first_pointer_to_array,
  971. @ttypeconvnode.first_int_to_int,
  972. @ttypeconvnode.first_int_to_bool,
  973. @ttypeconvnode.first_bool_to_bool,
  974. @ttypeconvnode.first_bool_to_int,
  975. @ttypeconvnode.first_real_to_real,
  976. @ttypeconvnode.first_int_to_real,
  977. @ttypeconvnode.first_proc_to_procvar,
  978. @ttypeconvnode.first_arrayconstructor_to_set,
  979. @ttypeconvnode.first_load_smallset,
  980. @ttypeconvnode.first_cord_to_pointer,
  981. @ttypeconvnode.first_nothing,
  982. @ttypeconvnode.first_nothing,
  983. @ttypeconvnode.first_class_to_intf
  984. );
  985. type
  986. tprocedureofobject = function : tnode of object;
  987. var
  988. r : packed record
  989. proc : pointer;
  990. obj : pointer;
  991. end;
  992. begin
  993. { this is a little bit dirty but it works }
  994. { and should be quite portable too }
  995. r.proc:=firstconvert[c];
  996. r.obj:=self;
  997. first_call_helper:=tprocedureofobject(r){$ifdef FPC}();{$endif FPC}
  998. end;
  999. function ttypeconvnode.pass_1 : tnode;
  1000. begin
  1001. result:=nil;
  1002. firstpass(left);
  1003. if codegenerror then
  1004. exit;
  1005. { load the value_str from the left part }
  1006. registers32:=left.registers32;
  1007. registersfpu:=left.registersfpu;
  1008. {$ifdef SUPPORT_MMX}
  1009. registersmmx:=left.registersmmx;
  1010. {$endif}
  1011. set_location(location,left.location);
  1012. if nf_explizit in flags then
  1013. begin
  1014. { check if the result could be in a register }
  1015. if not(pstoreddef(resulttype.def)^.is_intregable) and
  1016. not(pstoreddef(resulttype.def)^.is_fpuregable) then
  1017. make_not_regable(left);
  1018. end;
  1019. if convtype=tc_equal then
  1020. begin
  1021. { remove typeconv node if left is a const. For other nodes we can't
  1022. remove it because the secondpass can still depend on the old type (PFV) }
  1023. if is_constnode(left) then
  1024. begin
  1025. left.resulttype:=resulttype;
  1026. result:=left;
  1027. left:=nil;
  1028. end;
  1029. end
  1030. else
  1031. begin
  1032. result:=first_call_helper(convtype);
  1033. end;
  1034. end;
  1035. {*****************************************************************************
  1036. TISNODE
  1037. *****************************************************************************}
  1038. constructor tisnode.create(l,r : tnode);
  1039. begin
  1040. inherited create(isn,l,r);
  1041. end;
  1042. function tisnode.det_resulttype:tnode;
  1043. begin
  1044. result:=nil;
  1045. resulttypepass(left);
  1046. resulttypepass(right);
  1047. set_varstate(left,true);
  1048. set_varstate(right,true);
  1049. if codegenerror then
  1050. exit;
  1051. if (right.resulttype.def^.deftype=classrefdef) then
  1052. begin
  1053. { left must be a class }
  1054. if is_class(left.resulttype.def) then
  1055. begin
  1056. { the operands must be related }
  1057. if (not(pobjectdef(left.resulttype.def)^.is_related(
  1058. pobjectdef(pclassrefdef(right.resulttype.def)^.pointertype.def)))) and
  1059. (not(pobjectdef(pclassrefdef(right.resulttype.def)^.pointertype.def)^.is_related(
  1060. pobjectdef(left.resulttype.def)))) then
  1061. CGMessage(type_e_mismatch);
  1062. end
  1063. else
  1064. CGMessage(type_e_mismatch);
  1065. end
  1066. else
  1067. CGMessage(type_e_mismatch);
  1068. resulttype:=booltype;
  1069. end;
  1070. function tisnode.pass_1 : tnode;
  1071. begin
  1072. result:=nil;
  1073. firstpass(left);
  1074. firstpass(right);
  1075. if codegenerror then
  1076. exit;
  1077. left_right_max;
  1078. location.loc:=LOC_FLAGS;
  1079. end;
  1080. {*****************************************************************************
  1081. TASNODE
  1082. *****************************************************************************}
  1083. constructor tasnode.create(l,r : tnode);
  1084. begin
  1085. inherited create(asn,l,r);
  1086. end;
  1087. function tasnode.det_resulttype:tnode;
  1088. begin
  1089. result:=nil;
  1090. resulttypepass(right);
  1091. resulttypepass(left);
  1092. set_varstate(right,true);
  1093. set_varstate(left,true);
  1094. if codegenerror then
  1095. exit;
  1096. if (right.resulttype.def^.deftype=classrefdef) then
  1097. begin
  1098. { left must be a class }
  1099. if is_class(left.resulttype.def) then
  1100. begin
  1101. { the operands must be related }
  1102. if (not(pobjectdef(left.resulttype.def)^.is_related(
  1103. pobjectdef(pclassrefdef(right.resulttype.def)^.pointertype.def)))) and
  1104. (not(pobjectdef(pclassrefdef(right.resulttype.def)^.pointertype.def)^.is_related(
  1105. pobjectdef(left.resulttype.def)))) then
  1106. CGMessage(type_e_mismatch);
  1107. end
  1108. else
  1109. CGMessage(type_e_mismatch);
  1110. resulttype:=pclassrefdef(right.resulttype.def)^.pointertype;
  1111. end
  1112. else
  1113. CGMessage(type_e_mismatch);
  1114. end;
  1115. function tasnode.pass_1 : tnode;
  1116. begin
  1117. result:=nil;
  1118. firstpass(right);
  1119. firstpass(left);
  1120. if codegenerror then
  1121. exit;
  1122. left_right_max;
  1123. set_location(location,left.location);
  1124. end;
  1125. function ttypeconvnode.docompare(p: tnode) : boolean;
  1126. begin
  1127. docompare :=
  1128. inherited docompare(p) and
  1129. (convtype = ttypeconvnode(p).convtype);
  1130. end;
  1131. begin
  1132. ctypeconvnode:=ttypeconvnode;
  1133. casnode:=tasnode;
  1134. cisnode:=tisnode;
  1135. end.
  1136. {
  1137. $Log$
  1138. Revision 1.23 2001-04-04 22:42:39 peter
  1139. * move constant folding into det_resulttype
  1140. Revision 1.22 2001/04/02 21:20:30 peter
  1141. * resulttype rewrite
  1142. Revision 1.21 2001/03/08 17:44:47 jonas
  1143. * fixed web bug 1430
  1144. Revision 1.20 2001/02/21 11:49:50 jonas
  1145. * evaluate typecasts of const pointers to ordinals inline ('merged')
  1146. Revision 1.19 2001/02/20 18:37:10 peter
  1147. * removed unused code
  1148. Revision 1.18 2001/02/20 13:14:18 marco
  1149. * Fix from Peter for passing a procedure of method to a other method in a method
  1150. Revision 1.17 2001/02/08 13:09:03 jonas
  1151. * fixed web bug 1396: tpointerord is now a cardinal instead of a longint,
  1152. but added a hack in ncnv so that pointer(-1) still works
  1153. Revision 1.16 2000/12/31 11:14:10 jonas
  1154. + implemented/fixed docompare() mathods for all nodes (not tested)
  1155. + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
  1156. and constant strings/chars together
  1157. * n386add.pas: don't copy temp strings (of size 256) to another temp string
  1158. when adding
  1159. Revision 1.15 2000/12/08 12:41:01 jonas
  1160. * fixed bug in sign extension patch
  1161. Revision 1.14 2000/12/07 17:19:42 jonas
  1162. * new constant handling: from now on, hex constants >$7fffffff are
  1163. parsed as unsigned constants (otherwise, $80000000 got sign extended
  1164. and became $ffffffff80000000), all constants in the longint range
  1165. become longints, all constants >$7fffffff and <=cardinal($ffffffff)
  1166. are cardinals and the rest are int64's.
  1167. * added lots of longint typecast to prevent range check errors in the
  1168. compiler and rtl
  1169. * type casts of symbolic ordinal constants are now preserved
  1170. * fixed bug where the original resulttype.def wasn't restored correctly
  1171. after doing a 64bit rangecheck
  1172. Revision 1.13 2000/11/29 00:30:32 florian
  1173. * unused units removed from uses clause
  1174. * some changes for widestrings
  1175. Revision 1.12 2000/11/20 16:06:04 jonas
  1176. + allow evaluation of 64bit constant expressions at compile time
  1177. * disable range checking for explicit typecasts of constant expressions
  1178. Revision 1.11 2000/11/12 23:24:11 florian
  1179. * interfaces are basically running
  1180. Revision 1.10 2000/11/04 14:25:20 florian
  1181. + merged Attila's changes for interfaces, not tested yet
  1182. Revision 1.9 2000/10/31 22:02:48 peter
  1183. * symtable splitted, no real code changes
  1184. Revision 1.8 2000/10/14 21:52:55 peter
  1185. * fixed memory leaks
  1186. Revision 1.7 2000/10/14 10:14:50 peter
  1187. * moehrendorf oct 2000 rewrite
  1188. Revision 1.6 2000/10/01 19:48:24 peter
  1189. * lot of compile updates for cg11
  1190. Revision 1.5 2000/09/28 19:49:52 florian
  1191. *** empty log message ***
  1192. Revision 1.4 2000/09/27 18:14:31 florian
  1193. * fixed a lot of syntax errors in the n*.pas stuff
  1194. Revision 1.3 2000/09/26 20:06:13 florian
  1195. * hmm, still a lot of work to get things compilable
  1196. Revision 1.2 2000/09/26 14:59:34 florian
  1197. * more conversion work done
  1198. Revision 1.1 2000/09/25 15:37:14 florian
  1199. * more fixes
  1200. }