tcinl.pas 56 KB

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