tccal.pas 55 KB

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