tcinl.pas 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Type checking and register allocation for inline 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 tcinl;
  19. interface
  20. uses
  21. tree;
  22. procedure firstinline(var p : ptree);
  23. implementation
  24. uses
  25. cobjects,verbose,globals,systems,
  26. globtype,
  27. symconst,symtable,aasm,types,
  28. htypechk,pass_1,
  29. tccal,cpubase
  30. {$ifdef newcg}
  31. ,cgbase
  32. ,tgobj
  33. ,tgcpu
  34. {$else newcg}
  35. ,hcodegen
  36. {$ifdef i386}
  37. ,tgeni386
  38. {$endif}
  39. {$endif newcg}
  40. ;
  41. {*****************************************************************************
  42. FirstInLine
  43. *****************************************************************************}
  44. {$ifdef fpc}
  45. {$maxfpuregisters 0}
  46. {$endif fpc}
  47. procedure firstinline(var p : ptree);
  48. var
  49. vl,vl2 : longint;
  50. vr : bestreal;
  51. p1,hp,hpp : ptree;
  52. {$ifndef NOCOLONCHECK}
  53. frac_para,length_para : ptree;
  54. {$endif ndef NOCOLONCHECK}
  55. extra_register,
  56. isreal,
  57. dowrite,
  58. file_is_typed : boolean;
  59. procedure do_lowhigh(adef : pdef);
  60. var
  61. v : longint;
  62. enum : penumsym;
  63. begin
  64. case Adef^.deftype of
  65. orddef:
  66. begin
  67. if p^.inlinenumber=in_low_x then
  68. v:=porddef(Adef)^.low
  69. else
  70. v:=porddef(Adef)^.high;
  71. hp:=genordinalconstnode(v,adef);
  72. firstpass(hp);
  73. disposetree(p);
  74. p:=hp;
  75. end;
  76. enumdef:
  77. begin
  78. enum:=Penumdef(Adef)^.firstenum;
  79. if p^.inlinenumber=in_high_x then
  80. while enum^.nextenum<>nil do
  81. enum:=enum^.nextenum;
  82. hp:=genenumnode(enum);
  83. disposetree(p);
  84. p:=hp;
  85. end;
  86. else
  87. internalerror(87);
  88. end;
  89. end;
  90. function getconstrealvalue : bestreal;
  91. begin
  92. case p^.left^.treetype of
  93. ordconstn:
  94. getconstrealvalue:=p^.left^.value;
  95. realconstn:
  96. getconstrealvalue:=p^.left^.value_real;
  97. else
  98. internalerror(309992);
  99. end;
  100. end;
  101. procedure setconstrealvalue(r : bestreal);
  102. var
  103. hp : ptree;
  104. begin
  105. hp:=genrealconstnode(r,bestrealdef^);
  106. disposetree(p);
  107. p:=hp;
  108. firstpass(p);
  109. end;
  110. procedure handleextendedfunction;
  111. begin
  112. p^.location.loc:=LOC_FPU;
  113. p^.resulttype:=s80floatdef;
  114. { redo firstpass for varstate status PM }
  115. set_varstate(p^.left,true);
  116. if (p^.left^.resulttype^.deftype<>floatdef) or
  117. (pfloatdef(p^.left^.resulttype)^.typ<>s80real) then
  118. begin
  119. p^.left:=gentypeconvnode(p^.left,s80floatdef);
  120. firstpass(p^.left);
  121. end;
  122. p^.registers32:=p^.left^.registers32;
  123. p^.registersfpu:=p^.left^.registersfpu;
  124. {$ifdef SUPPORT_MMX}
  125. p^.registersmmx:=p^.left^.registersmmx;
  126. {$endif SUPPORT_MMX}
  127. end;
  128. begin
  129. { if we handle writeln; p^.left contains no valid address }
  130. if assigned(p^.left) then
  131. begin
  132. if p^.left^.treetype=callparan then
  133. firstcallparan(p^.left,nil,false)
  134. else
  135. firstpass(p^.left);
  136. left_right_max(p);
  137. set_location(p^.location,p^.left^.location);
  138. end;
  139. inc(parsing_para_level);
  140. { handle intern constant functions in separate case }
  141. if p^.inlineconst then
  142. begin
  143. hp:=nil;
  144. { no parameters? }
  145. if not assigned(p^.left) then
  146. begin
  147. case p^.inlinenumber of
  148. in_const_pi :
  149. hp:=genrealconstnode(pi,bestrealdef^);
  150. else
  151. internalerror(89);
  152. end;
  153. end
  154. else
  155. { process constant expression with parameter }
  156. begin
  157. vl:=0;
  158. vl2:=0; { second parameter Ex: ptr(vl,vl2) }
  159. vr:=0;
  160. isreal:=false;
  161. case p^.left^.treetype of
  162. realconstn :
  163. begin
  164. isreal:=true;
  165. vr:=p^.left^.value_real;
  166. end;
  167. ordconstn :
  168. vl:=p^.left^.value;
  169. callparan :
  170. begin
  171. { both exists, else it was not generated }
  172. vl:=p^.left^.left^.value;
  173. vl2:=p^.left^.right^.left^.value;
  174. end;
  175. else
  176. CGMessage(cg_e_illegal_expression);
  177. end;
  178. case p^.inlinenumber of
  179. in_const_trunc :
  180. begin
  181. if isreal then
  182. begin
  183. if (vr>=2147483648.0) or (vr<=-2147483649.0) then
  184. begin
  185. CGMessage(parser_e_range_check_error);
  186. hp:=genordinalconstnode(1,s32bitdef)
  187. end
  188. else
  189. hp:=genordinalconstnode(trunc(vr),s32bitdef)
  190. end
  191. else
  192. hp:=genordinalconstnode(trunc(vl),s32bitdef);
  193. end;
  194. in_const_round :
  195. begin
  196. if isreal then
  197. begin
  198. if (vr>=2147483647.5) or (vr<=-2147483648.5) then
  199. begin
  200. CGMessage(parser_e_range_check_error);
  201. hp:=genordinalconstnode(1,s32bitdef)
  202. end
  203. else
  204. hp:=genordinalconstnode(round(vr),s32bitdef)
  205. end
  206. else
  207. hp:=genordinalconstnode(round(vl),s32bitdef);
  208. end;
  209. in_const_frac :
  210. begin
  211. if isreal then
  212. hp:=genrealconstnode(frac(vr),bestrealdef^)
  213. else
  214. hp:=genrealconstnode(frac(vl),bestrealdef^);
  215. end;
  216. in_const_int :
  217. begin
  218. if isreal then
  219. hp:=genrealconstnode(int(vr),bestrealdef^)
  220. else
  221. hp:=genrealconstnode(int(vl),bestrealdef^);
  222. end;
  223. in_const_abs :
  224. begin
  225. if isreal then
  226. hp:=genrealconstnode(abs(vr),bestrealdef^)
  227. else
  228. hp:=genordinalconstnode(abs(vl),p^.left^.resulttype);
  229. end;
  230. in_const_sqr :
  231. begin
  232. if isreal then
  233. hp:=genrealconstnode(sqr(vr),bestrealdef^)
  234. else
  235. hp:=genordinalconstnode(sqr(vl),p^.left^.resulttype);
  236. end;
  237. in_const_odd :
  238. begin
  239. if isreal then
  240. CGMessage1(type_e_integer_expr_expected,p^.left^.resulttype^.typename)
  241. else
  242. hp:=genordinalconstnode(byte(odd(vl)),booldef);
  243. end;
  244. in_const_swap_word :
  245. begin
  246. if isreal then
  247. CGMessage1(type_e_integer_expr_expected,p^.left^.resulttype^.typename)
  248. else
  249. hp:=genordinalconstnode((vl and $ff) shl 8+(vl shr 8),p^.left^.resulttype);
  250. end;
  251. in_const_swap_long :
  252. begin
  253. if isreal then
  254. CGMessage(type_e_mismatch)
  255. else
  256. hp:=genordinalconstnode((vl and $ffff) shl 16+(vl shr 16),p^.left^.resulttype);
  257. end;
  258. in_const_ptr :
  259. begin
  260. if isreal then
  261. CGMessage(type_e_mismatch)
  262. else
  263. hp:=genordinalconstnode((vl2 shl 16) or vl,voidpointerdef);
  264. end;
  265. in_const_sqrt :
  266. begin
  267. if isreal then
  268. begin
  269. if vr<0.0 then
  270. CGMessage(type_e_wrong_math_argument)
  271. else
  272. hp:=genrealconstnode(sqrt(vr),bestrealdef^)
  273. end
  274. else
  275. begin
  276. if vl<0 then
  277. CGMessage(type_e_wrong_math_argument)
  278. else
  279. hp:=genrealconstnode(sqrt(vl),bestrealdef^);
  280. end;
  281. end;
  282. in_const_arctan :
  283. begin
  284. if isreal then
  285. hp:=genrealconstnode(arctan(vr),bestrealdef^)
  286. else
  287. hp:=genrealconstnode(arctan(vl),bestrealdef^);
  288. end;
  289. in_const_cos :
  290. begin
  291. if isreal then
  292. hp:=genrealconstnode(cos(vr),bestrealdef^)
  293. else
  294. hp:=genrealconstnode(cos(vl),bestrealdef^);
  295. end;
  296. in_const_sin :
  297. begin
  298. if isreal then
  299. hp:=genrealconstnode(sin(vr),bestrealdef^)
  300. else
  301. hp:=genrealconstnode(sin(vl),bestrealdef^);
  302. end;
  303. in_const_exp :
  304. begin
  305. if isreal then
  306. hp:=genrealconstnode(exp(vr),bestrealdef^)
  307. else
  308. hp:=genrealconstnode(exp(vl),bestrealdef^);
  309. end;
  310. in_const_ln :
  311. begin
  312. if isreal then
  313. begin
  314. if vr<=0.0 then
  315. CGMessage(type_e_wrong_math_argument)
  316. else
  317. hp:=genrealconstnode(ln(vr),bestrealdef^)
  318. end
  319. else
  320. begin
  321. if vl<=0 then
  322. CGMessage(type_e_wrong_math_argument)
  323. else
  324. hp:=genrealconstnode(ln(vl),bestrealdef^);
  325. end;
  326. end;
  327. else
  328. internalerror(88);
  329. end;
  330. end;
  331. disposetree(p);
  332. if hp=nil then
  333. hp:=genzeronode(errorn);
  334. firstpass(hp);
  335. p:=hp;
  336. end
  337. else
  338. begin
  339. case p^.inlinenumber of
  340. in_lo_qword,
  341. in_hi_qword,
  342. in_lo_long,
  343. in_hi_long,
  344. in_lo_word,
  345. in_hi_word:
  346. begin
  347. set_varstate(p^.left,true);
  348. if p^.registers32<1 then
  349. p^.registers32:=1;
  350. if p^.inlinenumber in [in_lo_word,in_hi_word] then
  351. p^.resulttype:=u8bitdef
  352. else if p^.inlinenumber in [in_lo_qword,in_hi_qword] then
  353. begin
  354. p^.resulttype:=u32bitdef;
  355. if (m_tp in aktmodeswitches) or
  356. (m_delphi in aktmodeswitches) then
  357. CGMessage(type_w_maybe_wrong_hi_lo);
  358. end
  359. else
  360. begin
  361. p^.resulttype:=u16bitdef;
  362. if (m_tp in aktmodeswitches) or
  363. (m_delphi in aktmodeswitches) then
  364. CGMessage(type_w_maybe_wrong_hi_lo);
  365. end;
  366. p^.location.loc:=LOC_REGISTER;
  367. if not is_integer(p^.left^.resulttype) then
  368. CGMessage(type_e_mismatch)
  369. else
  370. begin
  371. if p^.left^.treetype=ordconstn then
  372. begin
  373. case p^.inlinenumber of
  374. in_lo_word : hp:=genordinalconstnode(p^.left^.value and $ff,p^.left^.resulttype);
  375. in_hi_word : hp:=genordinalconstnode(p^.left^.value shr 8,p^.left^.resulttype);
  376. in_lo_long : hp:=genordinalconstnode(p^.left^.value and $ffff,p^.left^.resulttype);
  377. in_hi_long : hp:=genordinalconstnode(p^.left^.value shr 16,p^.left^.resulttype);
  378. in_lo_qword : hp:=genordinalconstnode(p^.left^.value and $ffffffff,p^.left^.resulttype);
  379. in_hi_qword : hp:=genordinalconstnode(p^.left^.value shr 32,p^.left^.resulttype);
  380. end;
  381. disposetree(p);
  382. firstpass(hp);
  383. p:=hp;
  384. end;
  385. end;
  386. end;
  387. in_sizeof_x:
  388. begin
  389. set_varstate(p^.left,false);
  390. if push_high_param(p^.left^.resulttype) then
  391. begin
  392. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  393. hp:=gennode(addn,genloadnode(pvarsym(srsym),p^.left^.symtable),
  394. genordinalconstnode(1,s32bitdef));
  395. if (p^.left^.resulttype^.deftype=arraydef) and
  396. (parraydef(p^.left^.resulttype)^.elesize<>1) then
  397. hp:=gennode(muln,hp,genordinalconstnode(parraydef(p^.left^.resulttype)^.elesize,s32bitdef));
  398. disposetree(p);
  399. p:=hp;
  400. firstpass(p);
  401. end;
  402. if p^.registers32<1 then
  403. p^.registers32:=1;
  404. p^.resulttype:=s32bitdef;
  405. p^.location.loc:=LOC_REGISTER;
  406. end;
  407. in_typeof_x:
  408. begin
  409. set_varstate(p^.left,false);
  410. if p^.registers32<1 then
  411. p^.registers32:=1;
  412. p^.location.loc:=LOC_REGISTER;
  413. p^.resulttype:=voidpointerdef;
  414. end;
  415. in_ord_x:
  416. begin
  417. set_varstate(p^.left,true);
  418. if (p^.left^.treetype=ordconstn) then
  419. begin
  420. hp:=genordinalconstnode(p^.left^.value,s32bitdef);
  421. disposetree(p);
  422. p:=hp;
  423. firstpass(p);
  424. end
  425. else
  426. begin
  427. { otherwise you get a crash if you try ord on an expression containing }
  428. { an undeclared variable (JM) }
  429. if not assigned(p^.left^.resulttype) then
  430. exit;
  431. if (p^.left^.resulttype^.deftype=orddef) then
  432. if (porddef(p^.left^.resulttype)^.typ in [uchar,bool8bit]) then
  433. begin
  434. if porddef(p^.left^.resulttype)^.typ=bool8bit then
  435. begin
  436. hp:=gentypeconvnode(p^.left,u8bitdef);
  437. putnode(p);
  438. p:=hp;
  439. p^.convtyp:=tc_bool_2_int;
  440. p^.explizit:=true;
  441. firstpass(p);
  442. end
  443. else
  444. begin
  445. hp:=gentypeconvnode(p^.left,u8bitdef);
  446. putnode(p);
  447. p:=hp;
  448. p^.explizit:=true;
  449. firstpass(p);
  450. end;
  451. end
  452. { can this happen ? }
  453. else if (porddef(p^.left^.resulttype)^.typ=uvoid) then
  454. CGMessage(type_e_mismatch)
  455. else
  456. { all other orddef need no transformation }
  457. begin
  458. hp:=p^.left;
  459. putnode(p);
  460. p:=hp;
  461. end
  462. else if (p^.left^.resulttype^.deftype=enumdef) then
  463. begin
  464. hp:=gentypeconvnode(p^.left,s32bitdef);
  465. putnode(p);
  466. p:=hp;
  467. p^.explizit:=true;
  468. firstpass(p);
  469. end
  470. else
  471. begin
  472. { can anything else be ord() ?}
  473. CGMessage(type_e_mismatch);
  474. end;
  475. end;
  476. end;
  477. in_chr_byte:
  478. begin
  479. set_varstate(p^.left,true);
  480. hp:=gentypeconvnode(p^.left,cchardef);
  481. putnode(p);
  482. p:=hp;
  483. p^.explizit:=true;
  484. firstpass(p);
  485. end;
  486. in_length_string:
  487. begin
  488. set_varstate(p^.left,true);
  489. if is_ansistring(p^.left^.resulttype) then
  490. p^.resulttype:=s32bitdef
  491. else
  492. p^.resulttype:=u8bitdef;
  493. { we don't need string conversations here }
  494. if (p^.left^.treetype=typeconvn) and
  495. (p^.left^.left^.resulttype^.deftype=stringdef) then
  496. begin
  497. hp:=p^.left^.left;
  498. putnode(p^.left);
  499. p^.left:=hp;
  500. end;
  501. { check the type, must be string or char }
  502. if (p^.left^.resulttype^.deftype<>stringdef) and
  503. (not is_char(p^.left^.resulttype)) then
  504. CGMessage(type_e_mismatch);
  505. { evaluates length of constant strings direct }
  506. if (p^.left^.treetype=stringconstn) then
  507. begin
  508. hp:=genordinalconstnode(p^.left^.length,s32bitdef);
  509. disposetree(p);
  510. firstpass(hp);
  511. p:=hp;
  512. end
  513. { length of char is one allways }
  514. else if is_constcharnode(p^.left) then
  515. begin
  516. hp:=genordinalconstnode(1,s32bitdef);
  517. disposetree(p);
  518. firstpass(hp);
  519. p:=hp;
  520. end;
  521. end;
  522. in_assigned_x:
  523. begin
  524. set_varstate(p^.left,true);
  525. p^.resulttype:=booldef;
  526. p^.location.loc:=LOC_FLAGS;
  527. end;
  528. in_ofs_x,
  529. in_seg_x :
  530. set_varstate(p^.left,false);
  531. in_pred_x,
  532. in_succ_x:
  533. begin
  534. p^.resulttype:=p^.left^.resulttype;
  535. if is_64bitint(p^.resulttype) then
  536. begin
  537. if (p^.registers32<2) then
  538. p^.registers32:=2
  539. end
  540. else
  541. begin
  542. if (p^.registers32<1) then
  543. p^.registers32:=1;
  544. end;
  545. p^.location.loc:=LOC_REGISTER;
  546. set_varstate(p^.left,true);
  547. if not is_ordinal(p^.resulttype) then
  548. CGMessage(type_e_ordinal_expr_expected)
  549. else
  550. begin
  551. if (p^.resulttype^.deftype=enumdef) and
  552. (penumdef(p^.resulttype)^.has_jumps) then
  553. CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible)
  554. else
  555. if p^.left^.treetype=ordconstn then
  556. begin
  557. if p^.inlinenumber=in_succ_x then
  558. hp:=genordinalconstnode(p^.left^.value+1,p^.left^.resulttype)
  559. else
  560. hp:=genordinalconstnode(p^.left^.value-1,p^.left^.resulttype);
  561. disposetree(p);
  562. firstpass(hp);
  563. p:=hp;
  564. end;
  565. end;
  566. end;
  567. in_inc_x,
  568. in_dec_x:
  569. begin
  570. p^.resulttype:=voiddef;
  571. if assigned(p^.left) then
  572. begin
  573. firstcallparan(p^.left,nil,true);
  574. set_varstate(p^.left,true);
  575. if codegenerror then
  576. exit;
  577. { first param must be var }
  578. valid_for_assign(p^.left^.left,false);
  579. { check type }
  580. if (p^.left^.resulttype^.deftype in [enumdef,pointerdef]) or
  581. is_ordinal(p^.left^.resulttype) then
  582. begin
  583. { two paras ? }
  584. if assigned(p^.left^.right) then
  585. begin
  586. { insert a type conversion }
  587. { the second param is always longint }
  588. p^.left^.right^.left:=gentypeconvnode(p^.left^.right^.left,s32bitdef);
  589. { check the type conversion }
  590. firstpass(p^.left^.right^.left);
  591. { need we an additional register ? }
  592. if not(is_constintnode(p^.left^.right^.left)) and
  593. (p^.left^.right^.left^.location.loc in [LOC_MEM,LOC_REFERENCE]) and
  594. (p^.left^.right^.left^.registers32<=1) then
  595. inc(p^.registers32);
  596. { do we need an additional register to restore the first parameter? }
  597. if p^.left^.right^.left^.registers32>=p^.registers32 then
  598. inc(p^.registers32);
  599. if assigned(p^.left^.right^.right) then
  600. CGMessage(cg_e_illegal_expression);
  601. end;
  602. end
  603. else
  604. CGMessage(type_e_ordinal_expr_expected);
  605. end
  606. else
  607. CGMessage(type_e_mismatch);
  608. end;
  609. in_read_x,
  610. in_readln_x,
  611. in_write_x,
  612. in_writeln_x :
  613. begin
  614. { needs a call }
  615. procinfo^.flags:=procinfo^.flags or pi_do_call;
  616. p^.resulttype:=voiddef;
  617. { true, if readln needs an extra register }
  618. extra_register:=false;
  619. { we must know if it is a typed file or not }
  620. { but we must first do the firstpass for it }
  621. file_is_typed:=false;
  622. if assigned(p^.left) then
  623. begin
  624. dowrite:=(p^.inlinenumber in [in_write_x,in_writeln_x]);
  625. firstcallparan(p^.left,nil,true);
  626. set_varstate(p^.left,dowrite);
  627. { now we can check }
  628. hp:=p^.left;
  629. while assigned(hp^.right) do
  630. hp:=hp^.right;
  631. { if resulttype is not assigned, then automatically }
  632. { file is not typed. }
  633. if assigned(hp) and assigned(hp^.resulttype) then
  634. Begin
  635. if (hp^.resulttype^.deftype=filedef) and
  636. (pfiledef(hp^.resulttype)^.filetyp=ft_typed) then
  637. begin
  638. file_is_typed:=true;
  639. { test the type }
  640. hpp:=p^.left;
  641. while (hpp<>hp) do
  642. begin
  643. if (hpp^.left^.treetype=typen) then
  644. CGMessage(type_e_cant_read_write_type);
  645. if not is_equal(hpp^.resulttype,pfiledef(hp^.resulttype)^.typedfiletype.def) then
  646. CGMessage(type_e_mismatch);
  647. { generate the high() value for the shortstring }
  648. if ((not dowrite) and is_shortstring(hpp^.left^.resulttype)) or
  649. (is_chararray(hpp^.left^.resulttype)) then
  650. gen_high_tree(hpp,true);
  651. hpp:=hpp^.right;
  652. end;
  653. end;
  654. end; { endif assigned(hp) }
  655. { insert type conversions for write(ln) }
  656. if (not file_is_typed) then
  657. begin
  658. hp:=p^.left;
  659. while assigned(hp) do
  660. begin
  661. if (hp^.left^.treetype=typen) then
  662. CGMessage(type_e_cant_read_write_type);
  663. if assigned(hp^.left^.resulttype) then
  664. begin
  665. isreal:=false;
  666. { support writeln(procvar) }
  667. if (hp^.left^.resulttype^.deftype=procvardef) then
  668. begin
  669. p1:=gencallnode(nil,nil);
  670. p1^.right:=hp^.left;
  671. p1^.resulttype:=pprocvardef(hp^.left^.resulttype)^.rettype.def;
  672. firstpass(p1);
  673. hp^.left:=p1;
  674. end;
  675. case hp^.left^.resulttype^.deftype of
  676. filedef :
  677. begin
  678. { only allowed as first parameter }
  679. if assigned(hp^.right) then
  680. CGMessage(type_e_cant_read_write_type);
  681. end;
  682. stringdef :
  683. begin
  684. { generate the high() value for the shortstring }
  685. if (not dowrite) and
  686. is_shortstring(hp^.left^.resulttype) then
  687. gen_high_tree(hp,true);
  688. end;
  689. pointerdef :
  690. begin
  691. if not is_pchar(hp^.left^.resulttype) then
  692. CGMessage(type_e_cant_read_write_type);
  693. end;
  694. floatdef :
  695. begin
  696. isreal:=true;
  697. end;
  698. orddef :
  699. begin
  700. case porddef(hp^.left^.resulttype)^.typ of
  701. uchar,
  702. u32bit,s32bit,
  703. u64bit,s64bit:
  704. ;
  705. u8bit,s8bit,
  706. u16bit,s16bit :
  707. if dowrite then
  708. hp^.left:=gentypeconvnode(hp^.left,s32bitdef);
  709. bool8bit,
  710. bool16bit,
  711. bool32bit :
  712. if dowrite then
  713. hp^.left:=gentypeconvnode(hp^.left,booldef)
  714. else
  715. CGMessage(type_e_cant_read_write_type);
  716. else
  717. CGMessage(type_e_cant_read_write_type);
  718. end;
  719. if not(dowrite) and
  720. not(is_64bitint(hp^.left^.resulttype)) then
  721. extra_register:=true;
  722. end;
  723. arraydef :
  724. begin
  725. if is_chararray(hp^.left^.resulttype) then
  726. gen_high_tree(hp,true)
  727. else
  728. CGMessage(type_e_cant_read_write_type);
  729. end;
  730. else
  731. CGMessage(type_e_cant_read_write_type);
  732. end;
  733. { some format options ? }
  734. if hp^.is_colon_para then
  735. begin
  736. if hp^.right^.is_colon_para then
  737. begin
  738. frac_para:=hp;
  739. length_para:=hp^.right;
  740. hp:=hp^.right;
  741. hpp:=hp^.right;
  742. end
  743. else
  744. begin
  745. length_para:=hp;
  746. frac_para:=nil;
  747. hpp:=hp^.right;
  748. end;
  749. { can be nil if you use "write(e:0:6)" while e is undeclared (JM) }
  750. if assigned(hpp^.left^.resulttype) then
  751. isreal:=(hpp^.left^.resulttype^.deftype=floatdef)
  752. else exit;
  753. if (not is_integer(length_para^.left^.resulttype)) then
  754. CGMessage1(type_e_integer_expr_expected,length_para^.left^.resulttype^.typename)
  755. else
  756. length_para^.left:=gentypeconvnode(length_para^.left,s32bitdef);
  757. if assigned(frac_para) then
  758. begin
  759. if isreal then
  760. begin
  761. if (not is_integer(frac_para^.left^.resulttype)) then
  762. CGMessage1(type_e_integer_expr_expected,frac_para^.left^.resulttype^.typename)
  763. else
  764. frac_para^.left:=gentypeconvnode(frac_para^.left,s32bitdef);
  765. end
  766. else
  767. CGMessage(parser_e_illegal_colon_qualifier);
  768. end;
  769. { do the checking for the colon'd arg }
  770. hp:=length_para;
  771. end;
  772. end;
  773. hp:=hp^.right;
  774. end;
  775. end;
  776. { pass all parameters again for the typeconversions }
  777. if codegenerror then
  778. exit;
  779. firstcallparan(p^.left,nil,true);
  780. set_varstate(p^.left,true);
  781. { calc registers }
  782. left_right_max(p);
  783. if extra_register then
  784. inc(p^.registers32);
  785. end;
  786. end;
  787. in_settextbuf_file_x :
  788. begin
  789. { warning here p^.left is the callparannode
  790. not the argument directly }
  791. { p^.left^.left is text var }
  792. { p^.left^.right^.left is the buffer var }
  793. { firstcallparan(p^.left,nil);
  794. already done in firstcalln }
  795. { now we know the type of buffer }
  796. getsymonlyin(systemunit,'SETTEXTBUF');
  797. hp:=gencallnode(pprocsym(srsym),systemunit);
  798. hp^.left:=gencallparanode(
  799. genordinalconstnode(p^.left^.left^.resulttype^.size,s32bitdef),p^.left);
  800. putnode(p);
  801. p:=hp;
  802. firstpass(p);
  803. end;
  804. { the firstpass of the arg has been done in firstcalln ? }
  805. in_reset_typedfile,
  806. in_rewrite_typedfile :
  807. begin
  808. procinfo^.flags:=procinfo^.flags or pi_do_call;
  809. firstpass(p^.left);
  810. set_varstate(p^.left,true);
  811. p^.resulttype:=voiddef;
  812. end;
  813. in_str_x_string :
  814. begin
  815. procinfo^.flags:=procinfo^.flags or pi_do_call;
  816. p^.resulttype:=voiddef;
  817. { check the amount of parameters }
  818. if not(assigned(p^.left)) or
  819. not(assigned(p^.left^.right)) then
  820. begin
  821. CGMessage(parser_e_wrong_parameter_size);
  822. exit;
  823. end;
  824. { first pass just the string for first local use }
  825. hp:=p^.left^.right;
  826. p^.left^.right:=nil;
  827. firstcallparan(p^.left,nil,true);
  828. set_varstate(p^.left,false);
  829. { remove warning when result is passed }
  830. set_funcret_is_valid(p^.left^.left);
  831. p^.left^.right:=hp;
  832. firstcallparan(p^.left^.right,nil,true);
  833. set_varstate(p^.left^.right,true);
  834. hp:=p^.left;
  835. { valid string ? }
  836. if not assigned(hp) or
  837. (hp^.left^.resulttype^.deftype<>stringdef) or
  838. (hp^.right=nil) then
  839. CGMessage(cg_e_illegal_expression);
  840. { we need a var parameter }
  841. valid_for_assign(hp^.left,false);
  842. { generate the high() value for the shortstring }
  843. if is_shortstring(hp^.left^.resulttype) then
  844. gen_high_tree(hp,true);
  845. { !!!! check length of string }
  846. while assigned(hp^.right) do
  847. hp:=hp^.right;
  848. { check and convert the first param }
  849. if hp^.is_colon_para then
  850. CGMessage(cg_e_illegal_expression);
  851. isreal:=false;
  852. case hp^.resulttype^.deftype of
  853. orddef :
  854. begin
  855. case porddef(hp^.left^.resulttype)^.typ of
  856. u32bit,s32bit,
  857. s64bit,u64bit:
  858. ;
  859. u8bit,s8bit,
  860. u16bit,s16bit:
  861. hp^.left:=gentypeconvnode(hp^.left,s32bitdef);
  862. else
  863. CGMessage(type_e_integer_or_real_expr_expected);
  864. end;
  865. end;
  866. floatdef :
  867. begin
  868. isreal:=true;
  869. end;
  870. else
  871. CGMessage(type_e_integer_or_real_expr_expected);
  872. end;
  873. { some format options ? }
  874. hpp:=p^.left^.right;
  875. if assigned(hpp) and hpp^.is_colon_para then
  876. begin
  877. firstpass(hpp^.left);
  878. set_varstate(hpp^.left,true);
  879. if (not is_integer(hpp^.left^.resulttype)) then
  880. CGMessage1(type_e_integer_expr_expected,hpp^.left^.resulttype^.typename)
  881. else
  882. hpp^.left:=gentypeconvnode(hpp^.left,s32bitdef);
  883. hpp:=hpp^.right;
  884. if assigned(hpp) and hpp^.is_colon_para then
  885. begin
  886. if isreal then
  887. begin
  888. if (not is_integer(hpp^.left^.resulttype)) then
  889. CGMessage1(type_e_integer_expr_expected,hpp^.left^.resulttype^.typename)
  890. else
  891. begin
  892. firstpass(hpp^.left);
  893. set_varstate(hpp^.left,true);
  894. hpp^.left:=gentypeconvnode(hpp^.left,s32bitdef);
  895. end;
  896. end
  897. else
  898. CGMessage(parser_e_illegal_colon_qualifier);
  899. end;
  900. end;
  901. { pass all parameters again for the typeconversions }
  902. if codegenerror then
  903. exit;
  904. firstcallparan(p^.left,nil,true);
  905. { calc registers }
  906. left_right_max(p);
  907. end;
  908. in_val_x :
  909. begin
  910. procinfo^.flags:=procinfo^.flags or pi_do_call;
  911. p^.resulttype:=voiddef;
  912. { check the amount of parameters }
  913. if not(assigned(p^.left)) or
  914. not(assigned(p^.left^.right)) then
  915. begin
  916. CGMessage(parser_e_wrong_parameter_size);
  917. exit;
  918. end;
  919. If Assigned(p^.left^.right^.right) Then
  920. {there is a "code" parameter}
  921. Begin
  922. { first pass just the code parameter for first local use}
  923. hp := p^.left^.right;
  924. p^.left^.right := nil;
  925. make_not_regable(p^.left^.left);
  926. firstcallparan(p^.left, nil,true);
  927. set_varstate(p^.left,false);
  928. if codegenerror then exit;
  929. p^.left^.right := hp;
  930. {code has to be a var parameter}
  931. if valid_for_assign(p^.left^.left,false) then
  932. begin
  933. if (p^.left^.left^.resulttype^.deftype <> orddef) or
  934. not(porddef(p^.left^.left^.resulttype)^.typ in
  935. [u16bit,s16bit,u32bit,s32bit]) then
  936. CGMessage(type_e_mismatch);
  937. end;
  938. hpp := p^.left^.right
  939. End
  940. Else hpp := p^.left;
  941. {now hpp = the destination value tree}
  942. { first pass just the destination parameter for first local use}
  943. hp:=hpp^.right;
  944. hpp^.right:=nil;
  945. {hpp = destination}
  946. make_not_regable(hpp^.left);
  947. firstcallparan(hpp,nil,true);
  948. set_varstate(hpp,false);
  949. if codegenerror then
  950. exit;
  951. { remove warning when result is passed }
  952. set_funcret_is_valid(hpp^.left);
  953. hpp^.right := hp;
  954. if valid_for_assign(hpp^.left,false) then
  955. begin
  956. If Not((hpp^.left^.resulttype^.deftype = floatdef) or
  957. ((hpp^.left^.resulttype^.deftype = orddef) And
  958. (POrdDef(hpp^.left^.resulttype)^.typ in
  959. [u32bit,s32bit,
  960. u8bit,s8bit,u16bit,s16bit,s64bit,u64bit]))) Then
  961. CGMessage(type_e_mismatch);
  962. end;
  963. {hp = source (String)}
  964. { count_ref := false; WHY ?? }
  965. firstcallparan(hp,nil,true);
  966. set_varstate(hp,true);
  967. if codegenerror then
  968. exit;
  969. { if not a stringdef then insert a type conv which
  970. does the other type checking }
  971. If (hp^.left^.resulttype^.deftype<>stringdef) then
  972. begin
  973. hp^.left:=gentypeconvnode(hp^.left,cshortstringdef);
  974. firstpass(hp);
  975. end;
  976. { calc registers }
  977. left_right_max(p);
  978. { val doesn't calculate the registers really }
  979. { correct, we need one register extra (FK) }
  980. if is_64bitint(hpp^.left^.resulttype) then
  981. inc(p^.registers32,2)
  982. else
  983. inc(p^.registers32,1);
  984. end;
  985. in_include_x_y,
  986. in_exclude_x_y:
  987. begin
  988. p^.resulttype:=voiddef;
  989. if assigned(p^.left) then
  990. begin
  991. firstcallparan(p^.left,nil,true);
  992. set_varstate(p^.left,true);
  993. p^.registers32:=p^.left^.registers32;
  994. p^.registersfpu:=p^.left^.registersfpu;
  995. {$ifdef SUPPORT_MMX}
  996. p^.registersmmx:=p^.left^.registersmmx;
  997. {$endif SUPPORT_MMX}
  998. { remove warning when result is passed }
  999. set_funcret_is_valid(p^.left^.left);
  1000. { first param must be var }
  1001. valid_for_assign(p^.left^.left,false);
  1002. { check type }
  1003. if (p^.left^.resulttype^.deftype=setdef) then
  1004. begin
  1005. { two paras ? }
  1006. if assigned(p^.left^.right) then
  1007. begin
  1008. { insert a type conversion }
  1009. { to the type of the set elements }
  1010. p^.left^.right^.left:=gentypeconvnode(
  1011. p^.left^.right^.left,
  1012. psetdef(p^.left^.resulttype)^.elementtype.def);
  1013. { check the type conversion }
  1014. firstpass(p^.left^.right^.left);
  1015. { only three parameters are allowed }
  1016. if assigned(p^.left^.right^.right) then
  1017. CGMessage(cg_e_illegal_expression);
  1018. end;
  1019. end
  1020. else
  1021. CGMessage(type_e_mismatch);
  1022. end
  1023. else
  1024. CGMessage(type_e_mismatch);
  1025. end;
  1026. in_low_x,
  1027. in_high_x:
  1028. begin
  1029. set_varstate(p^.left,false);
  1030. if p^.left^.treetype in [typen,loadn,subscriptn] then
  1031. begin
  1032. case p^.left^.resulttype^.deftype of
  1033. orddef,enumdef:
  1034. begin
  1035. do_lowhigh(p^.left^.resulttype);
  1036. firstpass(p);
  1037. end;
  1038. setdef:
  1039. begin
  1040. do_lowhigh(Psetdef(p^.left^.resulttype)^.elementtype.def);
  1041. firstpass(p);
  1042. end;
  1043. arraydef:
  1044. begin
  1045. if p^.inlinenumber=in_low_x then
  1046. begin
  1047. hp:=genordinalconstnode(Parraydef(p^.left^.resulttype)^.lowrange,
  1048. Parraydef(p^.left^.resulttype)^.rangetype.def);
  1049. disposetree(p);
  1050. p:=hp;
  1051. firstpass(p);
  1052. end
  1053. else
  1054. begin
  1055. if is_open_array(p^.left^.resulttype) or
  1056. is_array_of_const(p^.left^.resulttype) then
  1057. begin
  1058. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  1059. hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
  1060. disposetree(p);
  1061. p:=hp;
  1062. firstpass(p);
  1063. end
  1064. else
  1065. begin
  1066. hp:=genordinalconstnode(Parraydef(p^.left^.resulttype)^.highrange,
  1067. Parraydef(p^.left^.resulttype)^.rangetype.def);
  1068. disposetree(p);
  1069. p:=hp;
  1070. firstpass(p);
  1071. end;
  1072. end;
  1073. end;
  1074. stringdef:
  1075. begin
  1076. if p^.inlinenumber=in_low_x then
  1077. begin
  1078. hp:=genordinalconstnode(0,u8bitdef);
  1079. disposetree(p);
  1080. p:=hp;
  1081. firstpass(p);
  1082. end
  1083. else
  1084. begin
  1085. if is_open_string(p^.left^.resulttype) then
  1086. begin
  1087. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  1088. hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
  1089. disposetree(p);
  1090. p:=hp;
  1091. firstpass(p);
  1092. end
  1093. else
  1094. begin
  1095. hp:=genordinalconstnode(Pstringdef(p^.left^.resulttype)^.len,u8bitdef);
  1096. disposetree(p);
  1097. p:=hp;
  1098. firstpass(p);
  1099. end;
  1100. end;
  1101. end;
  1102. else
  1103. CGMessage(type_e_mismatch);
  1104. end;
  1105. end
  1106. else
  1107. CGMessage(type_e_varid_or_typeid_expected);
  1108. end;
  1109. in_cos_extended:
  1110. begin
  1111. if p^.left^.treetype in [ordconstn,realconstn] then
  1112. setconstrealvalue(cos(getconstrealvalue))
  1113. else
  1114. handleextendedfunction;
  1115. end;
  1116. in_sin_extended:
  1117. begin
  1118. if p^.left^.treetype in [ordconstn,realconstn] then
  1119. setconstrealvalue(sin(getconstrealvalue))
  1120. else
  1121. handleextendedfunction;
  1122. end;
  1123. in_arctan_extended:
  1124. begin
  1125. if p^.left^.treetype in [ordconstn,realconstn] then
  1126. setconstrealvalue(arctan(getconstrealvalue))
  1127. else
  1128. handleextendedfunction;
  1129. end;
  1130. in_pi:
  1131. if block_type=bt_const then
  1132. setconstrealvalue(pi)
  1133. else
  1134. begin
  1135. p^.location.loc:=LOC_FPU;
  1136. p^.resulttype:=s80floatdef;
  1137. end;
  1138. in_abs_extended:
  1139. begin
  1140. if p^.left^.treetype in [ordconstn,realconstn] then
  1141. setconstrealvalue(abs(getconstrealvalue))
  1142. else
  1143. handleextendedfunction;
  1144. end;
  1145. in_sqr_extended:
  1146. begin
  1147. if p^.left^.treetype in [ordconstn,realconstn] then
  1148. setconstrealvalue(sqr(getconstrealvalue))
  1149. else
  1150. handleextendedfunction;
  1151. end;
  1152. in_sqrt_extended:
  1153. begin
  1154. if p^.left^.treetype in [ordconstn,realconstn] then
  1155. begin
  1156. vr:=getconstrealvalue;
  1157. if vr<0.0 then
  1158. begin
  1159. CGMessage(type_e_wrong_math_argument);
  1160. setconstrealvalue(0);
  1161. end
  1162. else
  1163. setconstrealvalue(sqrt(vr));
  1164. end
  1165. else
  1166. handleextendedfunction;
  1167. end;
  1168. in_ln_extended:
  1169. begin
  1170. if p^.left^.treetype in [ordconstn,realconstn] then
  1171. begin
  1172. vr:=getconstrealvalue;
  1173. if vr<=0.0 then
  1174. begin
  1175. CGMessage(type_e_wrong_math_argument);
  1176. setconstrealvalue(0);
  1177. end
  1178. else
  1179. setconstrealvalue(ln(vr));
  1180. end
  1181. else
  1182. handleextendedfunction;
  1183. end;
  1184. {$ifdef SUPPORT_MMX}
  1185. in_mmx_pcmpeqb..in_mmx_pcmpgtw:
  1186. begin
  1187. end;
  1188. {$endif SUPPORT_MMX}
  1189. in_assert_x_y :
  1190. begin
  1191. p^.resulttype:=voiddef;
  1192. if assigned(p^.left) then
  1193. begin
  1194. firstcallparan(p^.left,nil,true);
  1195. set_varstate(p^.left,true);
  1196. p^.registers32:=p^.left^.registers32;
  1197. p^.registersfpu:=p^.left^.registersfpu;
  1198. {$ifdef SUPPORT_MMX}
  1199. p^.registersmmx:=p^.left^.registersmmx;
  1200. {$endif SUPPORT_MMX}
  1201. { check type }
  1202. if is_boolean(p^.left^.resulttype) then
  1203. begin
  1204. { must always be a string }
  1205. p^.left^.right^.left:=gentypeconvnode(p^.left^.right^.left,cshortstringdef);
  1206. firstpass(p^.left^.right^.left);
  1207. end
  1208. else
  1209. CGMessage(type_e_mismatch);
  1210. end
  1211. else
  1212. CGMessage(type_e_mismatch);
  1213. { We've checked the whole statement for correctness, now we
  1214. can remove it if assertions are off }
  1215. if not(cs_do_assertion in aktlocalswitches) then
  1216. begin
  1217. disposetree(p^.left);
  1218. putnode(p);
  1219. { we need a valid node, so insert a nothingn }
  1220. p:=genzeronode(nothingn);
  1221. end;
  1222. end;
  1223. else
  1224. internalerror(8);
  1225. end;
  1226. end;
  1227. { generate an error if no resulttype is set }
  1228. if not assigned(p^.resulttype) then
  1229. p^.resulttype:=generrordef;
  1230. dec(parsing_para_level);
  1231. end;
  1232. {$ifdef fpc}
  1233. {$maxfpuregisters default}
  1234. {$endif fpc}
  1235. end.
  1236. {
  1237. $Log$
  1238. Revision 1.69 2000-02-18 13:52:38 jonas
  1239. * fixed crash when using undeclared variable in ord construct
  1240. Revision 1.68 2000/02/17 15:39:29 jonas
  1241. * fixed crashing bug when trying to write an undefined fp var with
  1242. formatting parameters
  1243. Revision 1.67 2000/02/17 14:53:43 florian
  1244. * some updates for the newcg
  1245. Revision 1.66 2000/02/13 14:21:51 jonas
  1246. * modifications to make the compiler functional when compiled with
  1247. -Or
  1248. Revision 1.65 2000/02/09 13:23:07 peter
  1249. * log truncated
  1250. Revision 1.64 2000/01/07 01:14:45 peter
  1251. * updated copyright to 2000
  1252. Revision 1.63 1999/12/30 15:02:10 peter
  1253. * fixed crash with undefined variable
  1254. Revision 1.62 1999/12/02 12:38:45 florian
  1255. + added support for succ/pred(<qword/int64>)
  1256. Revision 1.61 1999/11/30 10:40:58 peter
  1257. + ttype, tsymlist
  1258. Revision 1.60 1999/11/18 15:34:49 pierre
  1259. * Notes/Hints for local syms changed to
  1260. Set_varstate function
  1261. Revision 1.59 1999/11/17 17:05:07 pierre
  1262. * Notes/hints changes
  1263. Revision 1.58 1999/11/06 14:34:30 peter
  1264. * truncated log to 20 revs
  1265. Revision 1.57 1999/10/29 15:28:51 peter
  1266. * fixed assert, the tree is now disposed in firstpass if assertions
  1267. are off.
  1268. Revision 1.56 1999/10/26 12:30:46 peter
  1269. * const parameter is now checked
  1270. * better and generic check if a node can be used for assigning
  1271. * export fixes
  1272. * procvar equal works now (it never had worked at least from 0.99.8)
  1273. * defcoll changed to linkedlist with pparaitem so it can easily be
  1274. walked both directions
  1275. Revision 1.55 1999/10/22 14:37:31 peter
  1276. * error when properties are passed to var parameters
  1277. Revision 1.54 1999/10/21 16:41:41 florian
  1278. * problems with readln fixed: esi wasn't restored correctly when
  1279. reading ordinal fields of objects futher the register allocation
  1280. didn't take care of the extra register when reading ordinal values
  1281. * enumerations can now be used in constant indexes of properties
  1282. Revision 1.53 1999/09/28 20:48:27 florian
  1283. * fixed bug 610
  1284. + added $D- for TP in symtable.pas else it can't be compiled anymore
  1285. (too much symbols :()
  1286. Revision 1.52 1999/09/27 23:45:01 peter
  1287. * procinfo is now a pointer
  1288. * support for result setting in sub procedure
  1289. Revision 1.51 1999/09/15 20:35:46 florian
  1290. * small fix to operator overloading when in MMX mode
  1291. + the compiler uses now fldz and fld1 if possible
  1292. + some fixes to floating point registers
  1293. + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  1294. * .... ???
  1295. Revision 1.50 1999/09/07 14:05:11 pierre
  1296. * halt removed in do_lowhigh
  1297. Revision 1.49 1999/08/28 15:34:21 florian
  1298. * bug 519 fixed
  1299. Revision 1.48 1999/08/23 23:41:04 pierre
  1300. * in_inc_x register allocation corrected
  1301. Revision 1.47 1999/08/06 12:43:13 jonas
  1302. * fix for regvars with the val code
  1303. Revision 1.46 1999/08/05 16:53:23 peter
  1304. * V_Fatal=1, all other V_ are also increased
  1305. * Check for local procedure when assigning procvar
  1306. * fixed comment parsing because directives
  1307. * oldtp mode directives better supported
  1308. * added some messages to errore.msg
  1309. Revision 1.45 1999/08/04 00:23:40 florian
  1310. * renamed i386asm and i386base to cpuasm and cpubase
  1311. }