tccal.pas 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. Type checking and register allocation for call 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 tccal;
  19. interface
  20. uses
  21. symtable,tree;
  22. procedure gen_high_tree(p:ptree;openstring:boolean);
  23. procedure firstcallparan(var p : ptree;defcoll : pparaitem);
  24. procedure firstcalln(var p : ptree);
  25. procedure firstprocinline(var p : ptree);
  26. implementation
  27. uses
  28. globtype,systems,
  29. cobjects,verbose,globals,
  30. symconst,aasm,types,
  31. hcodegen,htypechk,pass_1,cpubase
  32. {$ifdef i386}
  33. ,tgeni386
  34. {$endif}
  35. {$ifdef m68k}
  36. ,tgen68k
  37. {$endif m68k}
  38. ;
  39. {*****************************************************************************
  40. FirstCallParaN
  41. *****************************************************************************}
  42. procedure gen_high_tree(p:ptree;openstring:boolean);
  43. var
  44. len : longint;
  45. st : psymtable;
  46. loadconst : boolean;
  47. begin
  48. if assigned(p^.hightree) then
  49. exit;
  50. len:=-1;
  51. loadconst:=true;
  52. case p^.left^.resulttype^.deftype of
  53. arraydef :
  54. begin
  55. if is_open_array(p^.left^.resulttype) or
  56. is_array_of_const(p^.left^.resulttype) then
  57. begin
  58. st:=p^.left^.symtable;
  59. getsymonlyin(st,'high'+pvarsym(p^.left^.symtableentry)^.name);
  60. p^.hightree:=genloadnode(pvarsym(srsym),st);
  61. loadconst:=false;
  62. end
  63. else
  64. begin
  65. { this is an empty constructor }
  66. len:=parraydef(p^.left^.resulttype)^.highrange-
  67. parraydef(p^.left^.resulttype)^.lowrange;
  68. end;
  69. end;
  70. stringdef :
  71. begin
  72. if openstring then
  73. begin
  74. if is_open_string(p^.left^.resulttype) then
  75. begin
  76. st:=p^.left^.symtable;
  77. getsymonlyin(st,'high'+pvarsym(p^.left^.symtableentry)^.name);
  78. p^.hightree:=genloadnode(pvarsym(srsym),st);
  79. loadconst:=false;
  80. end
  81. else
  82. len:=pstringdef(p^.left^.resulttype)^.len;
  83. end
  84. else
  85. { passing a string to an array of char }
  86. begin
  87. if (p^.left^.treetype=stringconstn) then
  88. begin
  89. len:=str_length(p^.left);
  90. if len>0 then
  91. dec(len);
  92. end
  93. else
  94. begin
  95. p^.hightree:=gennode(subn,geninlinenode(in_length_string,false,getcopy(p^.left)),
  96. genordinalconstnode(1,s32bitdef));
  97. firstpass(p^.hightree);
  98. p^.hightree:=gentypeconvnode(p^.hightree,s32bitdef);
  99. loadconst:=false;
  100. end;
  101. end;
  102. end;
  103. else
  104. len:=0;
  105. end;
  106. if loadconst then
  107. p^.hightree:=genordinalconstnode(len,s32bitdef);
  108. firstpass(p^.hightree);
  109. end;
  110. procedure firstcallparan(var p : ptree;defcoll : pparaitem);
  111. var
  112. old_get_para_resulttype : boolean;
  113. old_array_constructor : boolean;
  114. store_valid : boolean;
  115. oldtype : pdef;
  116. {convtyp : tconverttype;}
  117. begin
  118. inc(parsing_para_level);
  119. if assigned(p^.right) then
  120. begin
  121. if defcoll=nil then
  122. firstcallparan(p^.right,nil)
  123. else
  124. firstcallparan(p^.right,pparaitem(defcoll^.next));
  125. p^.registers32:=p^.right^.registers32;
  126. p^.registersfpu:=p^.right^.registersfpu;
  127. {$ifdef SUPPORT_MMX}
  128. p^.registersmmx:=p^.right^.registersmmx;
  129. {$endif}
  130. end;
  131. if defcoll=nil then
  132. begin
  133. old_array_constructor:=allow_array_constructor;
  134. old_get_para_resulttype:=get_para_resulttype;
  135. get_para_resulttype:=true;
  136. allow_array_constructor:=true;
  137. if not(assigned(p^.resulttype)) or
  138. (p^.left^.treetype=typeconvn) then
  139. firstpass(p^.left);
  140. get_para_resulttype:=old_get_para_resulttype;
  141. allow_array_constructor:=old_array_constructor;
  142. if codegenerror then
  143. begin
  144. dec(parsing_para_level);
  145. exit;
  146. end;
  147. p^.resulttype:=p^.left^.resulttype;
  148. end
  149. { if we know the routine which is called, then the type }
  150. { conversions are inserted }
  151. else
  152. begin
  153. { Do we need arrayconstructor -> set conversion, then insert
  154. it here before the arrayconstructor node breaks the tree
  155. with its conversions of enum->ord }
  156. if (p^.left^.treetype=arrayconstructn) and
  157. (defcoll^.data^.deftype=setdef) then
  158. p^.left:=gentypeconvnode(p^.left,defcoll^.data);
  159. if count_ref then
  160. begin
  161. { not completly proper, but avoids some warnings }
  162. if (p^.left^.treetype=funcretn) and (defcoll^.paratyp=vs_var) then
  163. procinfo^.funcret_is_valid:=true;
  164. store_valid:=must_be_valid;
  165. { protected has nothing to do with read/write
  166. if (defcoll^.paratyp=vs_var) then
  167. test_protected(p^.left);
  168. }
  169. must_be_valid:=(defcoll^.paratyp<>vs_var);
  170. { only process typeconvn and arrayconstructn, else it will
  171. break other trees }
  172. old_array_constructor:=allow_array_constructor;
  173. old_get_para_resulttype:=get_para_resulttype;
  174. allow_array_constructor:=true;
  175. get_para_resulttype:=false;
  176. if (p^.left^.treetype in [arrayconstructn,typeconvn]) then
  177. firstpass(p^.left);
  178. get_para_resulttype:=old_get_para_resulttype;
  179. allow_array_constructor:=old_array_constructor;
  180. must_be_valid:=store_valid;
  181. end;
  182. { check if local proc/func is assigned to procvar }
  183. if p^.left^.resulttype^.deftype=procvardef then
  184. test_local_to_procvar(pprocvardef(p^.left^.resulttype),defcoll^.data);
  185. { property is not allowed as var parameter }
  186. if (defcoll^.paratyp=vs_var) and
  187. (p^.left^.isproperty) then
  188. CGMessagePos(p^.left^.fileinfo,type_e_argument_cant_be_assigned);
  189. { generate the high() value tree }
  190. if push_high_param(defcoll^.data) then
  191. gen_high_tree(p,is_open_string(defcoll^.data));
  192. if not(is_shortstring(p^.left^.resulttype) and
  193. is_shortstring(defcoll^.data)) and
  194. (defcoll^.data^.deftype<>formaldef) then
  195. begin
  196. if (defcoll^.paratyp=vs_var) and
  197. { allows conversion from word to integer and
  198. byte to shortint }
  199. (not(
  200. (p^.left^.resulttype^.deftype=orddef) and
  201. (defcoll^.data^.deftype=orddef) and
  202. (p^.left^.resulttype^.size=defcoll^.data^.size)
  203. ) and
  204. { an implicit pointer conversion is allowed }
  205. not(
  206. (p^.left^.resulttype^.deftype=pointerdef) and
  207. (defcoll^.data^.deftype=pointerdef)
  208. ) and
  209. { child classes can be also passed }
  210. not(
  211. (p^.left^.resulttype^.deftype=objectdef) and
  212. (defcoll^.data^.deftype=objectdef) and
  213. pobjectdef(p^.left^.resulttype)^.is_related(pobjectdef(defcoll^.data))
  214. ) and
  215. { passing a single element to a openarray of the same type }
  216. not(
  217. (is_open_array(defcoll^.data) and
  218. is_equal(parraydef(defcoll^.data)^.definition,p^.left^.resulttype))
  219. ) and
  220. { an implicit file conversion is also allowed }
  221. { from a typed file to an untyped one }
  222. not(
  223. (p^.left^.resulttype^.deftype=filedef) and
  224. (defcoll^.data^.deftype=filedef) and
  225. (pfiledef(defcoll^.data)^.filetype = ft_untyped) and
  226. (pfiledef(p^.left^.resulttype)^.filetype = ft_typed)
  227. ) and
  228. not(is_equal(p^.left^.resulttype,defcoll^.data))) then
  229. begin
  230. CGMessagePos2(p^.left^.fileinfo,parser_e_call_by_ref_without_typeconv,
  231. p^.left^.resulttype^.typename,defcoll^.data^.typename);
  232. end;
  233. { process cargs arrayconstructor }
  234. if is_array_constructor(p^.left^.resulttype) then
  235. begin
  236. if is_array_of_const(defcoll^.data) then
  237. begin
  238. if assigned(aktcallprocsym) and
  239. (pocall_cdecl in aktcallprocsym^.definition^.proccalloptions) and
  240. (po_external in aktcallprocsym^.definition^.procoptions) then
  241. p^.left^.cargs:=true;
  242. { force variant array }
  243. p^.left^.forcevaria:=true;
  244. end
  245. else
  246. begin
  247. p^.left^.novariaallowed:=true;
  248. p^.left^.constructdef:=parraydef(defcoll^.data)^.definition;
  249. end;
  250. old_array_constructor:=allow_array_constructor;
  251. allow_array_constructor:=true;
  252. firstpass(p^.left);
  253. allow_array_constructor:=old_array_constructor;
  254. end;
  255. { process open parameters }
  256. if push_high_param(defcoll^.data) then
  257. begin
  258. { insert type conv but hold the ranges of the array }
  259. oldtype:=p^.left^.resulttype;
  260. p^.left:=gentypeconvnode(p^.left,defcoll^.data);
  261. firstpass(p^.left);
  262. p^.left^.resulttype:=oldtype;
  263. end
  264. else
  265. begin
  266. p^.left:=gentypeconvnode(p^.left,defcoll^.data);
  267. firstpass(p^.left);
  268. end;
  269. if codegenerror then
  270. begin
  271. dec(parsing_para_level);
  272. exit;
  273. end;
  274. end;
  275. { check var strings }
  276. if (cs_strict_var_strings in aktlocalswitches) and
  277. is_shortstring(p^.left^.resulttype) and
  278. is_shortstring(defcoll^.data) and
  279. (defcoll^.paratyp=vs_var) and
  280. not(is_open_string(defcoll^.data)) and
  281. not(is_equal(p^.left^.resulttype,defcoll^.data)) then
  282. begin
  283. aktfilepos:=p^.left^.fileinfo;
  284. CGMessage(type_e_strict_var_string_violation);
  285. end;
  286. { Variablen for call by reference may not be copied }
  287. { into a register }
  288. { is this usefull here ? }
  289. { this was missing in formal parameter list }
  290. if (defcoll^.data=pdef(cformaldef)) then
  291. begin
  292. if defcoll^.paratyp=vs_var then
  293. if not valid_for_formal_var(p^.left) then
  294. begin
  295. aktfilepos:=p^.left^.fileinfo;
  296. CGMessage(parser_e_illegal_parameter_list);
  297. end;
  298. if defcoll^.paratyp=vs_const then
  299. if not valid_for_formal_const(p^.left) then
  300. begin
  301. aktfilepos:=p^.left^.fileinfo;
  302. CGMessage(parser_e_illegal_parameter_list);
  303. end;
  304. end;
  305. if defcoll^.paratyp=vs_var then
  306. begin
  307. set_unique(p^.left);
  308. make_not_regable(p^.left);
  309. end;
  310. p^.resulttype:=defcoll^.data;
  311. end;
  312. if p^.left^.registers32>p^.registers32 then
  313. p^.registers32:=p^.left^.registers32;
  314. if p^.left^.registersfpu>p^.registersfpu then
  315. p^.registersfpu:=p^.left^.registersfpu;
  316. {$ifdef SUPPORT_MMX}
  317. if p^.left^.registersmmx>p^.registersmmx then
  318. p^.registersmmx:=p^.left^.registersmmx;
  319. {$endif SUPPORT_MMX}
  320. dec(parsing_para_level);
  321. end;
  322. {*****************************************************************************
  323. FirstCallN
  324. *****************************************************************************}
  325. procedure firstcalln(var p : ptree);
  326. type
  327. pprocdefcoll = ^tprocdefcoll;
  328. tprocdefcoll = record
  329. data : pprocdef;
  330. nextpara : pparaitem;
  331. firstpara : pparaitem;
  332. next : pprocdefcoll;
  333. end;
  334. var
  335. hp,procs,hp2 : pprocdefcoll;
  336. pd : pprocdef;
  337. oldcallprocsym : pprocsym;
  338. nextprocsym : pprocsym;
  339. def_from,def_to,conv_to : pdef;
  340. hpt,pt,inlinecode : ptree;
  341. exactmatch,inlined : boolean;
  342. paralength,lastpara : longint;
  343. lastparatype : pdef;
  344. pdc : pparaitem;
  345. {$ifdef TEST_PROCSYMS}
  346. symt : psymtable;
  347. {$endif TEST_PROCSYMS}
  348. { only Dummy }
  349. hcvt : tconverttype;
  350. regi : tregister;
  351. store_valid, old_count_ref : boolean;
  352. label
  353. errorexit;
  354. { check if the resulttype from tree p is equal with def, needed
  355. for stringconstn and formaldef }
  356. function is_equal(p:ptree;def:pdef) : boolean;
  357. begin
  358. { safety check }
  359. if not (assigned(def) or assigned(p^.resulttype)) then
  360. begin
  361. is_equal:=false;
  362. exit;
  363. end;
  364. { all types can be passed to a formaldef }
  365. is_equal:=(def^.deftype=formaldef) or
  366. (types.is_equal(p^.resulttype,def))
  367. { to support ansi/long/wide strings in a proper way }
  368. { string and string[10] are assumed as equal }
  369. { when searching the correct overloaded procedure }
  370. or
  371. (
  372. (def^.deftype=stringdef) and (p^.resulttype^.deftype=stringdef) and
  373. (pstringdef(def)^.string_typ=pstringdef(p^.resulttype)^.string_typ)
  374. )
  375. or
  376. (
  377. (p^.left^.treetype=stringconstn) and
  378. (is_ansistring(p^.resulttype) and is_pchar(def))
  379. )
  380. or
  381. (
  382. (p^.left^.treetype=ordconstn) and
  383. (is_char(p^.resulttype) and (is_shortstring(def) or is_ansistring(def)))
  384. )
  385. { set can also be a not yet converted array constructor }
  386. or
  387. (
  388. (def^.deftype=setdef) and (p^.resulttype^.deftype=arraydef) and
  389. (parraydef(p^.resulttype)^.IsConstructor) and not(parraydef(p^.resulttype)^.IsVariant)
  390. )
  391. { in tp7 mode proc -> procvar is allowed }
  392. or
  393. (
  394. (m_tp_procvar in aktmodeswitches) and
  395. (def^.deftype=procvardef) and (p^.left^.treetype=calln) and
  396. (proc_to_procvar_equal(pprocdef(p^.left^.procdefinition),pprocvardef(def)))
  397. )
  398. ;
  399. end;
  400. function is_in_limit(def_from,def_to : pdef) : boolean;
  401. begin
  402. is_in_limit:=(def_from^.deftype = orddef) and
  403. (def_to^.deftype = orddef) and
  404. (porddef(def_from)^.low>porddef(def_to)^.low) and
  405. (porddef(def_from)^.high<porddef(def_to)^.high);
  406. end;
  407. var
  408. is_const : boolean;
  409. begin
  410. { release registers! }
  411. { if procdefinition<>nil then we called firstpass already }
  412. { it seems to be bad because of the registers }
  413. { at least we can avoid the overloaded search !! }
  414. procs:=nil;
  415. { made this global for disposing !! }
  416. store_valid:=must_be_valid;
  417. must_be_valid:=false;
  418. oldcallprocsym:=aktcallprocsym;
  419. aktcallprocsym:=nil;
  420. inlined:=false;
  421. if assigned(p^.procdefinition) and
  422. (pocall_inline in p^.procdefinition^.proccalloptions) then
  423. begin
  424. inlinecode:=p^.right;
  425. if assigned(inlinecode) then
  426. begin
  427. inlined:=true;
  428. {$ifdef INCLUDEOK}
  429. exclude(p^.procdefinition^.proccalloptions,pocall_inline);
  430. {$else}
  431. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
  432. {$endif}
  433. end;
  434. p^.right:=nil;
  435. end;
  436. if assigned(p^.procdefinition) and
  437. (po_containsself in p^.procdefinition^.procoptions) then
  438. message(cg_e_cannot_call_message_direct);
  439. { procedure variable ? }
  440. if assigned(p^.right) then
  441. begin
  442. { procedure does a call }
  443. procinfo^.flags:=procinfo^.flags or pi_do_call;
  444. { calc the correture value for the register }
  445. {$ifdef i386}
  446. for regi:=R_EAX to R_EDI do
  447. inc(reg_pushes[regi],t_times*2);
  448. {$endif}
  449. {$ifdef m68k}
  450. for regi:=R_D0 to R_A6 do
  451. inc(reg_pushes[regi],t_times*2);
  452. {$endif}
  453. { calculate the type of the parameters }
  454. if assigned(p^.left) then
  455. begin
  456. old_count_ref:=count_ref;
  457. count_ref:=false;
  458. firstcallparan(p^.left,nil);
  459. count_ref:=old_count_ref;
  460. if codegenerror then
  461. goto errorexit;
  462. end;
  463. firstpass(p^.right);
  464. { check the parameters }
  465. pdc:=pparaitem(pprocvardef(p^.right^.resulttype)^.para^.first);
  466. pt:=p^.left;
  467. while assigned(pdc) and assigned(pt) do
  468. begin
  469. pt:=pt^.right;
  470. pdc:=pparaitem(pdc^.next);
  471. end;
  472. if assigned(pt) or assigned(pdc) then
  473. begin
  474. if assigned(pt) then
  475. aktfilepos:=pt^.fileinfo;
  476. CGMessage(parser_e_illegal_parameter_list);
  477. end;
  478. { insert type conversions }
  479. if assigned(p^.left) then
  480. begin
  481. old_count_ref:=count_ref;
  482. count_ref:=true;
  483. firstcallparan(p^.left,pparaitem(pprocvardef(p^.right^.resulttype)^.para^.first));
  484. count_ref:=old_count_ref;
  485. if codegenerror then
  486. goto errorexit;
  487. end;
  488. p^.resulttype:=pprocvardef(p^.right^.resulttype)^.retdef;
  489. { this was missing, leads to a bug below if
  490. the procvar is a function }
  491. p^.procdefinition:=pabstractprocdef(p^.right^.resulttype);
  492. end
  493. else
  494. { not a procedure variable }
  495. begin
  496. { determine the type of the parameters }
  497. if assigned(p^.left) then
  498. begin
  499. old_count_ref:=count_ref;
  500. count_ref:=false;
  501. { must be valid is already false!
  502. store_valid:=must_be_valid;
  503. must_be_valid:=false; }
  504. firstcallparan(p^.left,nil);
  505. count_ref:=old_count_ref;
  506. {
  507. must_be_valid:=store_valid;
  508. }
  509. if codegenerror then
  510. goto errorexit;
  511. end;
  512. aktcallprocsym:=pprocsym(p^.symtableprocentry);
  513. { do we know the procedure to call ? }
  514. if not(assigned(p^.procdefinition)) then
  515. begin
  516. {$ifdef TEST_PROCSYMS}
  517. if (p^.unit_specific) or
  518. assigned(p^.methodpointer) then
  519. nextprocsym:=nil
  520. else while not assigned(procs) do
  521. begin
  522. symt:=p^.symtableproc;
  523. srsym:=nil;
  524. while assigned(symt^.next) and not assigned(srsym) do
  525. begin
  526. symt:=symt^.next;
  527. getsymonlyin(symt,actprocsym^.name);
  528. if assigned(srsym) then
  529. if srsym^.typ<>procsym then
  530. begin
  531. { reject all that is not a procedure }
  532. srsym:=nil;
  533. { don't search elsewhere }
  534. while assigned(symt^.next) do
  535. symt:=symt^.next;
  536. end;
  537. end;
  538. nextprocsym:=srsym;
  539. end;
  540. {$else TEST_PROCSYMS}
  541. nextprocsym:=nil;
  542. {$endif TEST_PROCSYMS}
  543. { determine length of parameter list }
  544. pt:=p^.left;
  545. paralength:=0;
  546. while assigned(pt) do
  547. begin
  548. inc(paralength);
  549. pt:=pt^.right;
  550. end;
  551. { link all procedures which have the same # of parameters }
  552. pd:=aktcallprocsym^.definition;
  553. while assigned(pd) do
  554. begin
  555. { only when the # of parameter are equal }
  556. if (pd^.para^.count=paralength) then
  557. begin
  558. new(hp);
  559. hp^.data:=pd;
  560. hp^.next:=procs;
  561. hp^.nextpara:=pparaitem(pd^.para^.first);
  562. hp^.firstpara:=pparaitem(pd^.para^.first);
  563. procs:=hp;
  564. end;
  565. pd:=pd^.nextoverloaded;
  566. end;
  567. { no procedures found? then there is something wrong
  568. with the parameter size }
  569. if not assigned(procs) then
  570. begin
  571. { in tp mode we can try to convert to procvar if
  572. there are no parameters specified }
  573. if not(assigned(p^.left)) and
  574. (m_tp_procvar in aktmodeswitches) then
  575. begin
  576. if (p^.symtableprocentry^.owner^.symtabletype=objectsymtable) and
  577. (pobjectdef(p^.symtableprocentry^.owner^.defowner)^.is_class) then
  578. hpt:=genloadmethodcallnode(pprocsym(p^.symtableprocentry),p^.symtableproc,
  579. getcopy(p^.methodpointer))
  580. else
  581. hpt:=genloadcallnode(pprocsym(p^.symtableprocentry),p^.symtableproc);
  582. disposetree(p);
  583. firstpass(hpt);
  584. p:=hpt;
  585. end
  586. else
  587. begin
  588. if assigned(p^.left) then
  589. aktfilepos:=p^.left^.fileinfo;
  590. CGMessage(parser_e_wrong_parameter_size);
  591. aktcallprocsym^.write_parameter_lists;
  592. end;
  593. goto errorexit;
  594. end;
  595. { now we can compare parameter after parameter }
  596. pt:=p^.left;
  597. { we start with the last parameter }
  598. lastpara:=paralength+1;
  599. lastparatype:=nil;
  600. while assigned(pt) do
  601. begin
  602. dec(lastpara);
  603. { walk all procedures and determine how this parameter matches and set:
  604. 1. pt^.exact_match_found if one parameter has an exact match
  605. 2. exactmatch if an equal or exact match is found
  606. 3. para^.argconvtyp to exact,equal or convertable
  607. (when convertable then also convertlevel is set)
  608. 4. pt^.convlevel1found if there is a convertlevel=1
  609. 5. pt^.convlevel2found if there is a convertlevel=2
  610. }
  611. exactmatch:=false;
  612. hp:=procs;
  613. while assigned(hp) do
  614. begin
  615. if is_equal(pt,hp^.nextpara^.data) then
  616. begin
  617. if hp^.nextpara^.data=pt^.resulttype then
  618. begin
  619. pt^.exact_match_found:=true;
  620. hp^.nextpara^.argconvtyp:=act_exact;
  621. end
  622. else
  623. hp^.nextpara^.argconvtyp:=act_equal;
  624. exactmatch:=true;
  625. end
  626. else
  627. begin
  628. hp^.nextpara^.argconvtyp:=act_convertable;
  629. hp^.nextpara^.convertlevel:=isconvertable(pt^.resulttype,hp^.nextpara^.data,
  630. hcvt,pt^.left^.treetype,false);
  631. case hp^.nextpara^.convertlevel of
  632. 1 : pt^.convlevel1found:=true;
  633. 2 : pt^.convlevel2found:=true;
  634. end;
  635. end;
  636. hp:=hp^.next;
  637. end;
  638. { If there was an exactmatch then delete all convertables }
  639. if exactmatch then
  640. begin
  641. hp:=procs;
  642. procs:=nil;
  643. while assigned(hp) do
  644. begin
  645. hp2:=hp^.next;
  646. { keep if not convertable }
  647. if (hp^.nextpara^.argconvtyp<>act_convertable) then
  648. begin
  649. hp^.next:=procs;
  650. procs:=hp;
  651. end
  652. else
  653. dispose(hp);
  654. hp:=hp2;
  655. end;
  656. end
  657. else
  658. { No exact match was found, remove all procedures that are
  659. not convertable (convertlevel=0) }
  660. begin
  661. hp:=procs;
  662. procs:=nil;
  663. while assigned(hp) do
  664. begin
  665. hp2:=hp^.next;
  666. { keep if not convertable }
  667. if (hp^.nextpara^.convertlevel<>0) then
  668. begin
  669. hp^.next:=procs;
  670. procs:=hp;
  671. end
  672. else
  673. begin
  674. { save the type for nice error message }
  675. lastparatype:=hp^.nextpara^.data;
  676. dispose(hp);
  677. end;
  678. hp:=hp2;
  679. end;
  680. end;
  681. { update nextpara for all procedures }
  682. hp:=procs;
  683. while assigned(hp) do
  684. begin
  685. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  686. hp:=hp^.next;
  687. end;
  688. { load next parameter or quit loop if no procs left }
  689. if assigned(procs) then
  690. pt:=pt^.right
  691. else
  692. break;
  693. end;
  694. { All parameters are checked, check if there are any
  695. procedures left }
  696. if not assigned(procs) then
  697. begin
  698. { there is an error, must be wrong type, because
  699. wrong size is already checked (PFV) }
  700. if (not assigned(lastparatype)) or
  701. (not assigned(pt)) or
  702. (not assigned(pt^.resulttype)) then
  703. internalerror(39393)
  704. else
  705. begin
  706. aktfilepos:=pt^.fileinfo;
  707. CGMessage3(type_e_wrong_parameter_type,tostr(lastpara),
  708. pt^.resulttype^.typename,lastparatype^.typename);
  709. end;
  710. aktcallprocsym^.write_parameter_lists;
  711. goto errorexit;
  712. end;
  713. { if there are several choices left then for orddef }
  714. { if a type is totally included in the other }
  715. { we don't fear an overflow , }
  716. { so we can do as if it is an exact match }
  717. { this will convert integer to longint }
  718. { rather than to words }
  719. { conversion of byte to integer or longint }
  720. {would still not be solved }
  721. if assigned(procs) and assigned(procs^.next) then
  722. begin
  723. hp:=procs;
  724. while assigned(hp) do
  725. begin
  726. hp^.nextpara:=hp^.firstpara;
  727. hp:=hp^.next;
  728. end;
  729. pt:=p^.left;
  730. while assigned(pt) do
  731. begin
  732. { matches a parameter of one procedure exact ? }
  733. exactmatch:=false;
  734. def_from:=pt^.resulttype;
  735. hp:=procs;
  736. while assigned(hp) do
  737. begin
  738. if not is_equal(pt,hp^.nextpara^.data) then
  739. begin
  740. def_to:=hp^.nextpara^.data;
  741. if ((def_from^.deftype=orddef) and (def_to^.deftype=orddef)) and
  742. (is_in_limit(def_from,def_to) or
  743. ((hp^.nextpara^.paratyp=vs_var) and
  744. (def_from^.size=def_to^.size))) then
  745. begin
  746. exactmatch:=true;
  747. conv_to:=def_to;
  748. end;
  749. end;
  750. hp:=hp^.next;
  751. end;
  752. { .... if yes, del all the other procedures }
  753. if exactmatch then
  754. begin
  755. { the first .... }
  756. while (assigned(procs)) and not(is_in_limit(def_from,procs^.nextpara^.data)) do
  757. begin
  758. hp:=procs^.next;
  759. dispose(procs);
  760. procs:=hp;
  761. end;
  762. { and the others }
  763. hp:=procs;
  764. while (assigned(hp)) and assigned(hp^.next) do
  765. begin
  766. if not(is_in_limit(def_from,hp^.next^.nextpara^.data)) then
  767. begin
  768. hp2:=hp^.next^.next;
  769. dispose(hp^.next);
  770. hp^.next:=hp2;
  771. end
  772. else
  773. begin
  774. def_to:=hp^.next^.nextpara^.data;
  775. if (conv_to^.size>def_to^.size) or
  776. ((porddef(conv_to)^.low<porddef(def_to)^.low) and
  777. (porddef(conv_to)^.high>porddef(def_to)^.high)) then
  778. begin
  779. hp2:=procs;
  780. procs:=hp;
  781. conv_to:=def_to;
  782. dispose(hp2);
  783. end
  784. else
  785. hp:=hp^.next;
  786. end;
  787. end;
  788. end;
  789. { update nextpara for all procedures }
  790. hp:=procs;
  791. while assigned(hp) do
  792. begin
  793. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  794. hp:=hp^.next;
  795. end;
  796. pt:=pt^.right;
  797. end;
  798. end;
  799. { let's try to eliminate equal if there is an exact match
  800. is there }
  801. if assigned(procs) and assigned(procs^.next) then
  802. begin
  803. { reset nextpara for all procs left }
  804. hp:=procs;
  805. while assigned(hp) do
  806. begin
  807. hp^.nextpara:=hp^.firstpara;
  808. hp:=hp^.next;
  809. end;
  810. pt:=p^.left;
  811. while assigned(pt) do
  812. begin
  813. if pt^.exact_match_found then
  814. begin
  815. hp:=procs;
  816. procs:=nil;
  817. while assigned(hp) do
  818. begin
  819. hp2:=hp^.next;
  820. { keep the exact matches, dispose the others }
  821. if (hp^.nextpara^.argconvtyp=act_exact) then
  822. begin
  823. hp^.next:=procs;
  824. procs:=hp;
  825. end
  826. else
  827. dispose(hp);
  828. hp:=hp2;
  829. end;
  830. end;
  831. { update nextpara for all procedures }
  832. hp:=procs;
  833. while assigned(hp) do
  834. begin
  835. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  836. hp:=hp^.next;
  837. end;
  838. pt:=pt^.right;
  839. end;
  840. end;
  841. { Check if there are convertlevel 1 and 2 differences
  842. left for the parameters, then discard all convertlevel
  843. 2 procedures. The value of convlevelXfound can still
  844. be used, because all convertables are still here or
  845. not }
  846. if assigned(procs) and assigned(procs^.next) then
  847. begin
  848. { reset nextpara for all procs left }
  849. hp:=procs;
  850. while assigned(hp) do
  851. begin
  852. hp^.nextpara:=hp^.firstpara;
  853. hp:=hp^.next;
  854. end;
  855. pt:=p^.left;
  856. while assigned(pt) do
  857. begin
  858. if pt^.convlevel1found and pt^.convlevel2found then
  859. begin
  860. hp:=procs;
  861. procs:=nil;
  862. while assigned(hp) do
  863. begin
  864. hp2:=hp^.next;
  865. { keep all not act_convertable and all convertlevels=1 }
  866. if (hp^.nextpara^.argconvtyp<>act_convertable) or
  867. (hp^.nextpara^.convertlevel=1) then
  868. begin
  869. hp^.next:=procs;
  870. procs:=hp;
  871. end
  872. else
  873. dispose(hp);
  874. hp:=hp2;
  875. end;
  876. end;
  877. { update nextpara for all procedures }
  878. hp:=procs;
  879. while assigned(hp) do
  880. begin
  881. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  882. hp:=hp^.next;
  883. end;
  884. pt:=pt^.right;
  885. end;
  886. end;
  887. if not(assigned(procs)) or assigned(procs^.next) then
  888. begin
  889. CGMessage(cg_e_cant_choose_overload_function);
  890. aktcallprocsym^.write_parameter_lists;
  891. goto errorexit;
  892. end;
  893. {$ifdef TEST_PROCSYMS}
  894. if (procs=nil) and assigned(nextprocsym) then
  895. begin
  896. p^.symtableprocentry:=nextprocsym;
  897. p^.symtableproc:=symt;
  898. end;
  899. end ; { of while assigned(p^.symtableprocentry) do }
  900. {$endif TEST_PROCSYMS}
  901. if make_ref then
  902. begin
  903. procs^.data^.lastref:=new(pref,init(procs^.data^.lastref,@p^.fileinfo));
  904. inc(procs^.data^.refcount);
  905. if procs^.data^.defref=nil then
  906. procs^.data^.defref:=procs^.data^.lastref;
  907. end;
  908. p^.procdefinition:=procs^.data;
  909. p^.resulttype:=procs^.data^.retdef;
  910. { big error for with statements
  911. p^.symtableproc:=p^.procdefinition^.owner;
  912. but neede for overloaded operators !! }
  913. if p^.symtableproc=nil then
  914. p^.symtableproc:=p^.procdefinition^.owner;
  915. p^.location.loc:=LOC_MEM;
  916. {$ifdef CHAINPROCSYMS}
  917. { object with method read;
  918. call to read(x) will be a usual procedure call }
  919. if assigned(p^.methodpointer) and
  920. (p^.procdefinition^._class=nil) then
  921. begin
  922. { not ok for extended }
  923. case p^.methodpointer^.treetype of
  924. typen,hnewn : fatalerror(no_para_match);
  925. end;
  926. disposetree(p^.methodpointer);
  927. p^.methodpointer:=nil;
  928. end;
  929. {$endif CHAINPROCSYMS}
  930. end; { end of procedure to call determination }
  931. is_const:=(pocall_internconst in p^.procdefinition^.proccalloptions) and
  932. ((block_type=bt_const) or
  933. (assigned(p^.left) and (p^.left^.left^.treetype in [realconstn,ordconstn])));
  934. { handle predefined procedures }
  935. if (pocall_internproc in p^.procdefinition^.proccalloptions) or is_const then
  936. begin
  937. if assigned(p^.left) then
  938. begin
  939. { settextbuf needs two args }
  940. if assigned(p^.left^.right) then
  941. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,p^.left)
  942. else
  943. begin
  944. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,p^.left^.left);
  945. putnode(p^.left);
  946. end;
  947. end
  948. else
  949. begin
  950. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,nil);
  951. end;
  952. putnode(p);
  953. firstpass(pt);
  954. p:=pt;
  955. goto errorexit;
  956. end
  957. else
  958. { no intern procedure => we do a call }
  959. { calc the correture value for the register }
  960. { handle predefined procedures }
  961. if (pocall_inline in p^.procdefinition^.proccalloptions) then
  962. begin
  963. if assigned(p^.methodpointer) then
  964. CGMessage(cg_e_unable_inline_object_methods);
  965. if assigned(p^.right) and (p^.right^.treetype<>procinlinen) then
  966. CGMessage(cg_e_unable_inline_procvar);
  967. { p^.treetype:=procinlinen; }
  968. if not assigned(p^.right) then
  969. begin
  970. if assigned(pprocdef(p^.procdefinition)^.code) then
  971. inlinecode:=genprocinlinenode(p,ptree(pprocdef(p^.procdefinition)^.code))
  972. else
  973. CGMessage(cg_e_no_code_for_inline_stored);
  974. if assigned(inlinecode) then
  975. begin
  976. { consider it has not inlined if called
  977. again inside the args }
  978. {$ifdef INCLUDEOK}
  979. exclude(p^.procdefinition^.proccalloptions,pocall_inline);
  980. {$else}
  981. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
  982. {$endif}
  983. firstpass(inlinecode);
  984. inlined:=true;
  985. end;
  986. end;
  987. end
  988. else
  989. procinfo^.flags:=procinfo^.flags or pi_do_call;
  990. if (po_interrupt in p^.procdefinition^.procoptions) then
  991. CGmessage1(cg_e_no_call_to_interrupt,p^.symtableprocentry^.name);
  992. { work trough all parameters to insert the type conversions }
  993. { !!! done now after internproc !! (PM) }
  994. if assigned(p^.left) then
  995. begin
  996. old_count_ref:=count_ref;
  997. count_ref:=true;
  998. firstcallparan(p^.left,pparaitem(p^.procdefinition^.para^.first));
  999. count_ref:=old_count_ref;
  1000. end;
  1001. {$ifdef i386}
  1002. for regi:=R_EAX to R_EDI do
  1003. begin
  1004. if (pprocdef(p^.procdefinition)^.usedregisters and ($80 shr word(regi)))<>0 then
  1005. inc(reg_pushes[regi],t_times*2);
  1006. end;
  1007. {$endif}
  1008. {$ifdef m68k}
  1009. for regi:=R_D0 to R_A6 do
  1010. begin
  1011. if (pprocdef(p^.procdefinition)^.usedregisters and ($800 shr word(regi)))<>0 then
  1012. inc(reg_pushes[regi],t_times*2);
  1013. end;
  1014. {$endif}
  1015. end;
  1016. { ensure that the result type is set }
  1017. p^.resulttype:=p^.procdefinition^.retdef;
  1018. { get a register for the return value }
  1019. if (p^.resulttype<>pdef(voiddef)) then
  1020. begin
  1021. if (p^.procdefinition^.proctypeoption=potype_constructor) then
  1022. begin
  1023. { extra handling of classes }
  1024. { p^.methodpointer should be assigned! }
  1025. if assigned(p^.methodpointer) and assigned(p^.methodpointer^.resulttype) and
  1026. (p^.methodpointer^.resulttype^.deftype=classrefdef) then
  1027. begin
  1028. p^.location.loc:=LOC_REGISTER;
  1029. p^.registers32:=1;
  1030. { the result type depends on the classref }
  1031. p^.resulttype:=pclassrefdef(p^.methodpointer^.resulttype)^.definition;
  1032. end
  1033. { a object constructor returns the result with the flags }
  1034. else
  1035. p^.location.loc:=LOC_FLAGS;
  1036. end
  1037. else
  1038. begin
  1039. {$ifdef SUPPORT_MMX}
  1040. if (cs_mmx in aktlocalswitches) and
  1041. is_mmx_able_array(p^.resulttype) then
  1042. begin
  1043. p^.location.loc:=LOC_MMXREGISTER;
  1044. p^.registersmmx:=1;
  1045. end
  1046. else
  1047. {$endif SUPPORT_MMX}
  1048. if ret_in_acc(p^.resulttype) then
  1049. begin
  1050. p^.location.loc:=LOC_REGISTER;
  1051. if is_64bitint(p^.resulttype) then
  1052. p^.registers32:=2
  1053. else
  1054. p^.registers32:=1;
  1055. { wide- and ansistrings are returned in EAX }
  1056. { but they are imm. moved to a memory location }
  1057. if is_widestring(p^.resulttype) or
  1058. is_ansistring(p^.resulttype) then
  1059. begin
  1060. p^.location.loc:=LOC_MEM;
  1061. { this is wrong we still need one register PM
  1062. p^.registers32:=0; }
  1063. p^.registers32:=1;
  1064. end;
  1065. end
  1066. else if (p^.resulttype^.deftype=floatdef) then
  1067. begin
  1068. p^.location.loc:=LOC_FPU;
  1069. p^.registersfpu:=1;
  1070. end
  1071. else
  1072. p^.location.loc:=LOC_MEM;
  1073. end;
  1074. end;
  1075. must_be_valid:=store_valid;
  1076. { a fpu can be used in any procedure !! }
  1077. p^.registersfpu:=p^.procdefinition^.fpu_used;
  1078. { if this is a call to a method calc the registers }
  1079. if (p^.methodpointer<>nil) then
  1080. begin
  1081. case p^.methodpointer^.treetype of
  1082. { but only, if this is not a supporting node }
  1083. typen: ;
  1084. { we need one register for new return value PM }
  1085. hnewn : if p^.registers32=0 then
  1086. p^.registers32:=1;
  1087. else
  1088. begin
  1089. if (p^.procdefinition^.proctypeoption in [potype_constructor,potype_destructor]) and
  1090. assigned(p^.symtable) and (p^.symtable^.symtabletype=withsymtable) and
  1091. not pwithsymtable(p^.symtable)^.direct_with then
  1092. begin
  1093. CGmessage(cg_e_cannot_call_cons_dest_inside_with);
  1094. end; { Is accepted by Delphi !! }
  1095. { this is not a good reason to accept it in FPC if we produce
  1096. wrong code for it !!! (PM) }
  1097. { R.Assign is not a constructor !!! }
  1098. { but for R^.Assign, R must be valid !! }
  1099. if (p^.procdefinition^.proctypeoption=potype_constructor) or
  1100. ((p^.methodpointer^.treetype=loadn) and
  1101. (not(oo_has_virtual in pobjectdef(p^.methodpointer^.resulttype)^.objectoptions))) then
  1102. must_be_valid:=false;
  1103. {
  1104. else
  1105. must_be_valid:=true;
  1106. }
  1107. firstpass(p^.methodpointer);
  1108. p^.registersfpu:=max(p^.methodpointer^.registersfpu,p^.registersfpu);
  1109. p^.registers32:=max(p^.methodpointer^.registers32,p^.registers32);
  1110. {$ifdef SUPPORT_MMX}
  1111. p^.registersmmx:=max(p^.methodpointer^.registersmmx,p^.registersmmx);
  1112. {$endif SUPPORT_MMX}
  1113. end;
  1114. end;
  1115. end;
  1116. if inlined then
  1117. p^.right:=inlinecode;
  1118. { determine the registers of the procedure variable }
  1119. { is this OK for inlined procs also ?? (PM) }
  1120. if assigned(p^.right) then
  1121. begin
  1122. p^.registersfpu:=max(p^.right^.registersfpu,p^.registersfpu);
  1123. p^.registers32:=max(p^.right^.registers32,p^.registers32);
  1124. {$ifdef SUPPORT_MMX}
  1125. p^.registersmmx:=max(p^.right^.registersmmx,p^.registersmmx);
  1126. {$endif SUPPORT_MMX}
  1127. end;
  1128. { determine the registers of the procedure }
  1129. if assigned(p^.left) then
  1130. begin
  1131. p^.registersfpu:=max(p^.left^.registersfpu,p^.registersfpu);
  1132. p^.registers32:=max(p^.left^.registers32,p^.registers32);
  1133. {$ifdef SUPPORT_MMX}
  1134. p^.registersmmx:=max(p^.left^.registersmmx,p^.registersmmx);
  1135. {$endif SUPPORT_MMX}
  1136. end;
  1137. errorexit:
  1138. { Reset some settings back }
  1139. if assigned(procs) then
  1140. dispose(procs);
  1141. if inlined then
  1142. {$ifdef INCLUDEOK}
  1143. include(p^.procdefinition^.proccalloptions,pocall_inline);
  1144. {$else}
  1145. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions+[pocall_inline];
  1146. {$endif}
  1147. aktcallprocsym:=oldcallprocsym;
  1148. end;
  1149. {*****************************************************************************
  1150. FirstProcInlineN
  1151. *****************************************************************************}
  1152. procedure firstprocinline(var p : ptree);
  1153. begin
  1154. { left contains the code in tree form }
  1155. { but it has already been firstpassed }
  1156. { so firstpass(p^.left); does not seem required }
  1157. { might be required later if we change the arg handling !! }
  1158. end;
  1159. end.
  1160. {
  1161. $Log$
  1162. Revision 1.71 1999-11-06 14:34:29 peter
  1163. * truncated log to 20 revs
  1164. Revision 1.70 1999/10/26 12:30:46 peter
  1165. * const parameter is now checked
  1166. * better and generic check if a node can be used for assigning
  1167. * export fixes
  1168. * procvar equal works now (it never had worked at least from 0.99.8)
  1169. * defcoll changed to linkedlist with pparaitem so it can easily be
  1170. walked both directions
  1171. Revision 1.69 1999/10/22 14:37:30 peter
  1172. * error when properties are passed to var parameters
  1173. Revision 1.68 1999/10/13 10:35:27 peter
  1174. * var must match exactly error msg extended with got and expected type
  1175. * array constructor type check now gives error on wrong types
  1176. Revision 1.67 1999/10/12 15:50:54 pierre
  1177. * error if calling interrupt procedure
  1178. Revision 1.66 1999/09/27 23:45:00 peter
  1179. * procinfo is now a pointer
  1180. * support for result setting in sub procedure
  1181. Revision 1.65 1999/09/16 23:05:56 florian
  1182. * m68k compiler is again compilable (only gas writer, no assembler reader)
  1183. Revision 1.64 1999/09/14 07:59:48 florian
  1184. * finally!? fixed
  1185. with <function with result in temp> do
  1186. My last and also Peter's fix before were wrong :(
  1187. Revision 1.63 1999/09/10 18:48:11 florian
  1188. * some bug fixes (e.g. must_be_valid and procinfo^.funcret_is_valid)
  1189. * most things for stored properties fixed
  1190. Revision 1.62 1999/08/23 23:42:52 pierre
  1191. * hnewn reg allocation corrected
  1192. Revision 1.61 1999/08/17 13:26:08 peter
  1193. * arrayconstructor -> arrayofconst fixed when arraycosntructor was not
  1194. variant.
  1195. Revision 1.60 1999/08/16 23:23:39 peter
  1196. * arrayconstructor -> openarray type conversions for element types
  1197. Revision 1.59 1999/08/13 21:33:16 peter
  1198. * support for array constructors extended and more error checking
  1199. Revision 1.58 1999/08/12 14:34:28 peter
  1200. * tp_procvar mode call->loadn fixed
  1201. Revision 1.57 1999/08/05 16:53:19 peter
  1202. * V_Fatal=1, all other V_ are also increased
  1203. * Check for local procedure when assigning procvar
  1204. * fixed comment parsing because directives
  1205. * oldtp mode directives better supported
  1206. * added some messages to errore.msg
  1207. Revision 1.56 1999/08/04 00:23:34 florian
  1208. * renamed i386asm and i386base to cpuasm and cpubase
  1209. Revision 1.55 1999/08/03 22:03:27 peter
  1210. * moved bitmask constants to sets
  1211. * some other type/const renamings
  1212. Revision 1.54 1999/07/01 21:33:58 peter
  1213. * merged
  1214. Revision 1.53 1999/06/29 14:02:33 peter
  1215. * merged file pos fixes
  1216. Revision 1.52 1999/06/29 12:16:22 pierre
  1217. * mereg from fixes-0_99_12
  1218. Revision 1.51.2.3 1999/07/01 21:32:01 peter
  1219. * procvar fixes again
  1220. }