tcinl.pas 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389
  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. 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^.left^.resulttype)) then
  863. CGMessage1(type_e_integer_expr_expected,hpp^.left^.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^.left^.resulttype)) then
  872. CGMessage1(type_e_integer_expr_expected,hpp^.left^.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.64 2000-01-07 01:14:45 peter
  1219. * updated copyright to 2000
  1220. Revision 1.63 1999/12/30 15:02:10 peter
  1221. * fixed crash with undefined variable
  1222. Revision 1.62 1999/12/02 12:38:45 florian
  1223. + added support for succ/pred(<qword/int64>)
  1224. Revision 1.61 1999/11/30 10:40:58 peter
  1225. + ttype, tsymlist
  1226. Revision 1.60 1999/11/18 15:34:49 pierre
  1227. * Notes/Hints for local syms changed to
  1228. Set_varstate function
  1229. Revision 1.59 1999/11/17 17:05:07 pierre
  1230. * Notes/hints changes
  1231. Revision 1.58 1999/11/06 14:34:30 peter
  1232. * truncated log to 20 revs
  1233. Revision 1.57 1999/10/29 15:28:51 peter
  1234. * fixed assert, the tree is now disposed in firstpass if assertions
  1235. are off.
  1236. Revision 1.56 1999/10/26 12:30:46 peter
  1237. * const parameter is now checked
  1238. * better and generic check if a node can be used for assigning
  1239. * export fixes
  1240. * procvar equal works now (it never had worked at least from 0.99.8)
  1241. * defcoll changed to linkedlist with pparaitem so it can easily be
  1242. walked both directions
  1243. Revision 1.55 1999/10/22 14:37:31 peter
  1244. * error when properties are passed to var parameters
  1245. Revision 1.54 1999/10/21 16:41:41 florian
  1246. * problems with readln fixed: esi wasn't restored correctly when
  1247. reading ordinal fields of objects futher the register allocation
  1248. didn't take care of the extra register when reading ordinal values
  1249. * enumerations can now be used in constant indexes of properties
  1250. Revision 1.53 1999/09/28 20:48:27 florian
  1251. * fixed bug 610
  1252. + added $D- for TP in symtable.pas else it can't be compiled anymore
  1253. (too much symbols :()
  1254. Revision 1.52 1999/09/27 23:45:01 peter
  1255. * procinfo is now a pointer
  1256. * support for result setting in sub procedure
  1257. Revision 1.51 1999/09/15 20:35:46 florian
  1258. * small fix to operator overloading when in MMX mode
  1259. + the compiler uses now fldz and fld1 if possible
  1260. + some fixes to floating point registers
  1261. + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  1262. * .... ???
  1263. Revision 1.50 1999/09/07 14:05:11 pierre
  1264. * halt removed in do_lowhigh
  1265. Revision 1.49 1999/08/28 15:34:21 florian
  1266. * bug 519 fixed
  1267. Revision 1.48 1999/08/23 23:41:04 pierre
  1268. * in_inc_x register allocation corrected
  1269. Revision 1.47 1999/08/06 12:43:13 jonas
  1270. * fix for regvars with the val code
  1271. Revision 1.46 1999/08/05 16:53:23 peter
  1272. * V_Fatal=1, all other V_ are also increased
  1273. * Check for local procedure when assigning procvar
  1274. * fixed comment parsing because directives
  1275. * oldtp mode directives better supported
  1276. * added some messages to errore.msg
  1277. Revision 1.45 1999/08/04 00:23:40 florian
  1278. * renamed i386asm and i386base to cpuasm and cpubase
  1279. Revision 1.44 1999/08/03 22:03:32 peter
  1280. * moved bitmask constants to sets
  1281. * some other type/const renamings
  1282. Revision 1.43 1999/07/30 12:28:43 peter
  1283. * fixed crash with unknown id and colon parameter in write
  1284. Revision 1.42 1999/07/18 14:47:35 florian
  1285. * bug 487 fixed, (inc(<property>) isn't allowed)
  1286. * more fixes to compile with Delphi
  1287. Revision 1.41 1999/07/05 20:25:40 peter
  1288. * merged
  1289. Revision 1.40 1999/07/05 20:13:18 peter
  1290. * removed temp defines
  1291. Revision 1.39 1999/07/03 14:14:31 florian
  1292. + start of val(int64/qword)
  1293. * longbool, wordbool constants weren't written, fixed
  1294. Revision 1.38 1999/07/01 15:49:22 florian
  1295. * int64/qword type release
  1296. + lo/hi for int64/qword
  1297. }