tccal.pas 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 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;do_count : boolean);
  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. htypechk,pass_1,cpubase
  32. {$ifdef newcg}
  33. ,cgbase
  34. ,tgobj
  35. {$else newcg}
  36. ,hcodegen
  37. {$ifdef i386}
  38. ,tgeni386
  39. {$endif}
  40. {$ifdef m68k}
  41. ,tgen68k
  42. {$endif m68k}
  43. {$endif newcg}
  44. ;
  45. {*****************************************************************************
  46. FirstCallParaN
  47. *****************************************************************************}
  48. procedure gen_high_tree(p:ptree;openstring:boolean);
  49. var
  50. len : longint;
  51. st : psymtable;
  52. loadconst : boolean;
  53. begin
  54. if assigned(p^.hightree) then
  55. exit;
  56. len:=-1;
  57. loadconst:=true;
  58. case p^.left^.resulttype^.deftype of
  59. arraydef :
  60. begin
  61. if is_open_array(p^.left^.resulttype) or
  62. is_array_of_const(p^.left^.resulttype) then
  63. begin
  64. st:=p^.left^.symtable;
  65. getsymonlyin(st,'high'+pvarsym(p^.left^.symtableentry)^.name);
  66. p^.hightree:=genloadnode(pvarsym(srsym),st);
  67. loadconst:=false;
  68. end
  69. else
  70. begin
  71. { this is an empty constructor }
  72. len:=parraydef(p^.left^.resulttype)^.highrange-
  73. parraydef(p^.left^.resulttype)^.lowrange;
  74. end;
  75. end;
  76. stringdef :
  77. begin
  78. if openstring then
  79. begin
  80. if is_open_string(p^.left^.resulttype) then
  81. begin
  82. st:=p^.left^.symtable;
  83. getsymonlyin(st,'high'+pvarsym(p^.left^.symtableentry)^.name);
  84. p^.hightree:=genloadnode(pvarsym(srsym),st);
  85. loadconst:=false;
  86. end
  87. else
  88. len:=pstringdef(p^.left^.resulttype)^.len;
  89. end
  90. else
  91. { passing a string to an array of char }
  92. begin
  93. if (p^.left^.treetype=stringconstn) then
  94. begin
  95. len:=str_length(p^.left);
  96. if len>0 then
  97. dec(len);
  98. end
  99. else
  100. begin
  101. p^.hightree:=gennode(subn,geninlinenode(in_length_string,false,getcopy(p^.left)),
  102. genordinalconstnode(1,s32bitdef));
  103. firstpass(p^.hightree);
  104. p^.hightree:=gentypeconvnode(p^.hightree,s32bitdef);
  105. loadconst:=false;
  106. end;
  107. end;
  108. end;
  109. else
  110. len:=0;
  111. end;
  112. if loadconst then
  113. p^.hightree:=genordinalconstnode(len,s32bitdef);
  114. firstpass(p^.hightree);
  115. end;
  116. procedure firstcallparan(var p : ptree;defcoll : pparaitem;do_count : boolean);
  117. var
  118. old_get_para_resulttype : boolean;
  119. old_array_constructor : boolean;
  120. oldtype : pdef;
  121. {$ifdef extdebug}
  122. store_count_ref : boolean;
  123. {$endif def extdebug}
  124. {convtyp : tconverttype;}
  125. begin
  126. inc(parsing_para_level);
  127. {$ifdef extdebug}
  128. if do_count then
  129. begin
  130. store_count_ref:=count_ref;
  131. count_ref:=true;
  132. end;
  133. {$endif def extdebug}
  134. if assigned(p^.right) then
  135. begin
  136. if defcoll=nil then
  137. firstcallparan(p^.right,nil,do_count)
  138. else
  139. firstcallparan(p^.right,pparaitem(defcoll^.next),do_count);
  140. p^.registers32:=p^.right^.registers32;
  141. p^.registersfpu:=p^.right^.registersfpu;
  142. {$ifdef SUPPORT_MMX}
  143. p^.registersmmx:=p^.right^.registersmmx;
  144. {$endif}
  145. end;
  146. if defcoll=nil then
  147. begin
  148. old_array_constructor:=allow_array_constructor;
  149. old_get_para_resulttype:=get_para_resulttype;
  150. get_para_resulttype:=true;
  151. allow_array_constructor:=true;
  152. firstpass(p^.left);
  153. get_para_resulttype:=old_get_para_resulttype;
  154. allow_array_constructor:=old_array_constructor;
  155. if codegenerror then
  156. begin
  157. dec(parsing_para_level);
  158. exit;
  159. end;
  160. p^.resulttype:=p^.left^.resulttype;
  161. end
  162. { if we know the routine which is called, then the type }
  163. { conversions are inserted }
  164. else
  165. begin
  166. { Do we need arrayconstructor -> set conversion, then insert
  167. it here before the arrayconstructor node breaks the tree
  168. with its conversions of enum->ord }
  169. if (p^.left^.treetype=arrayconstructn) and
  170. (defcoll^.paratype.def^.deftype=setdef) then
  171. p^.left:=gentypeconvnode(p^.left,defcoll^.paratype.def);
  172. { set some settings needed for arrayconstructor }
  173. if is_array_constructor(p^.left^.resulttype) then
  174. begin
  175. if is_array_of_const(defcoll^.paratype.def) then
  176. begin
  177. if assigned(aktcallprocsym) and
  178. (pocall_cdecl in aktcallprocsym^.definition^.proccalloptions) and
  179. (po_external in aktcallprocsym^.definition^.procoptions) then
  180. p^.left^.cargs:=true;
  181. { force variant array }
  182. p^.left^.forcevaria:=true;
  183. end
  184. else
  185. begin
  186. p^.left^.novariaallowed:=true;
  187. p^.left^.constructdef:=parraydef(defcoll^.paratype.def)^.elementtype.def;
  188. end;
  189. end;
  190. if do_count then
  191. begin
  192. { not completly proper, but avoids some warnings }
  193. if (defcoll^.paratyp=vs_var) then
  194. set_funcret_is_valid(p^.left);
  195. { protected has nothing to do with read/write
  196. if (defcoll^.paratyp=vs_var) then
  197. test_protected(p^.left);
  198. }
  199. { set_varstate(p^.left,defcoll^.paratyp<>vs_var);
  200. must only be done after typeconv PM }
  201. { only process typeconvn and arrayconstructn, else it will
  202. break other trees }
  203. { But this is need to get correct varstate !! PM }
  204. old_array_constructor:=allow_array_constructor;
  205. old_get_para_resulttype:=get_para_resulttype;
  206. allow_array_constructor:=true;
  207. get_para_resulttype:=false;
  208. if (p^.left^.treetype in [arrayconstructn,typeconvn]) then
  209. firstpass(p^.left);
  210. if not assigned(p^.resulttype) then
  211. p^.resulttype:=p^.left^.resulttype;
  212. get_para_resulttype:=old_get_para_resulttype;
  213. allow_array_constructor:=old_array_constructor;
  214. end;
  215. { check if local proc/func is assigned to procvar }
  216. if p^.left^.resulttype^.deftype=procvardef then
  217. test_local_to_procvar(pprocvardef(p^.left^.resulttype),defcoll^.paratype.def);
  218. { property is not allowed as var parameter }
  219. if (defcoll^.paratyp=vs_var) and
  220. (p^.left^.isproperty) then
  221. CGMessagePos(p^.left^.fileinfo,type_e_argument_cant_be_assigned);
  222. { generate the high() value tree }
  223. if push_high_param(defcoll^.paratype.def) then
  224. gen_high_tree(p,is_open_string(defcoll^.paratype.def));
  225. if not(is_shortstring(p^.left^.resulttype) and
  226. is_shortstring(defcoll^.paratype.def)) and
  227. (defcoll^.paratype.def^.deftype<>formaldef) then
  228. begin
  229. if (defcoll^.paratyp=vs_var) and
  230. { allows conversion from word to integer and
  231. byte to shortint }
  232. (not(
  233. (p^.left^.resulttype^.deftype=orddef) and
  234. (defcoll^.paratype.def^.deftype=orddef) and
  235. (p^.left^.resulttype^.size=defcoll^.paratype.def^.size)
  236. ) and
  237. { an implicit pointer conversion is allowed }
  238. not(
  239. (p^.left^.resulttype^.deftype=pointerdef) and
  240. (defcoll^.paratype.def^.deftype=pointerdef)
  241. ) and
  242. { child classes can be also passed }
  243. not(
  244. (p^.left^.resulttype^.deftype=objectdef) and
  245. (defcoll^.paratype.def^.deftype=objectdef) and
  246. pobjectdef(p^.left^.resulttype)^.is_related(pobjectdef(defcoll^.paratype.def))
  247. ) and
  248. { passing a single element to a openarray of the same type }
  249. not(
  250. (is_open_array(defcoll^.paratype.def) and
  251. is_equal(parraydef(defcoll^.paratype.def)^.elementtype.def,p^.left^.resulttype))
  252. ) and
  253. { an implicit file conversion is also allowed }
  254. { from a typed file to an untyped one }
  255. not(
  256. (p^.left^.resulttype^.deftype=filedef) and
  257. (defcoll^.paratype.def^.deftype=filedef) and
  258. (pfiledef(defcoll^.paratype.def)^.filetyp = ft_untyped) and
  259. (pfiledef(p^.left^.resulttype)^.filetyp = ft_typed)
  260. ) and
  261. not(is_equal(p^.left^.resulttype,defcoll^.paratype.def))) then
  262. begin
  263. CGMessagePos2(p^.left^.fileinfo,parser_e_call_by_ref_without_typeconv,
  264. p^.left^.resulttype^.typename,defcoll^.paratype.def^.typename);
  265. end;
  266. { Process open parameters }
  267. if push_high_param(defcoll^.paratype.def) then
  268. begin
  269. { insert type conv but hold the ranges of the array }
  270. oldtype:=p^.left^.resulttype;
  271. p^.left:=gentypeconvnode(p^.left,defcoll^.paratype.def);
  272. firstpass(p^.left);
  273. p^.left^.resulttype:=oldtype;
  274. end
  275. else
  276. begin
  277. p^.left:=gentypeconvnode(p^.left,defcoll^.paratype.def);
  278. firstpass(p^.left);
  279. end;
  280. if codegenerror then
  281. begin
  282. dec(parsing_para_level);
  283. exit;
  284. end;
  285. end;
  286. { check var strings }
  287. if (cs_strict_var_strings in aktlocalswitches) and
  288. is_shortstring(p^.left^.resulttype) and
  289. is_shortstring(defcoll^.paratype.def) and
  290. (defcoll^.paratyp=vs_var) and
  291. not(is_open_string(defcoll^.paratype.def)) and
  292. not(is_equal(p^.left^.resulttype,defcoll^.paratype.def)) then
  293. begin
  294. aktfilepos:=p^.left^.fileinfo;
  295. CGMessage(type_e_strict_var_string_violation);
  296. end;
  297. { Variablen for call by reference may not be copied }
  298. { into a register }
  299. { is this usefull here ? }
  300. { this was missing in formal parameter list }
  301. if (defcoll^.paratype.def=pdef(cformaldef)) then
  302. begin
  303. if defcoll^.paratyp=vs_var then
  304. begin
  305. if not valid_for_formal_var(p^.left) then
  306. begin
  307. aktfilepos:=p^.left^.fileinfo;
  308. CGMessage(parser_e_illegal_parameter_list);
  309. end;
  310. end;
  311. if defcoll^.paratyp=vs_const then
  312. begin
  313. if not valid_for_formal_const(p^.left) then
  314. begin
  315. aktfilepos:=p^.left^.fileinfo;
  316. CGMessage(parser_e_illegal_parameter_list);
  317. end;
  318. end;
  319. end;
  320. if defcoll^.paratyp=vs_var then
  321. begin
  322. set_unique(p^.left);
  323. make_not_regable(p^.left);
  324. end;
  325. if do_count then
  326. set_varstate(p^.left,defcoll^.paratyp<>vs_var);
  327. { must only be done after typeconv PM }
  328. p^.resulttype:=defcoll^.paratype.def;
  329. end;
  330. if p^.left^.registers32>p^.registers32 then
  331. p^.registers32:=p^.left^.registers32;
  332. if p^.left^.registersfpu>p^.registersfpu then
  333. p^.registersfpu:=p^.left^.registersfpu;
  334. {$ifdef SUPPORT_MMX}
  335. if p^.left^.registersmmx>p^.registersmmx then
  336. p^.registersmmx:=p^.left^.registersmmx;
  337. {$endif SUPPORT_MMX}
  338. dec(parsing_para_level);
  339. {$ifdef extdebug}
  340. if do_count then
  341. count_ref:=store_count_ref;
  342. {$endif def extdebug}
  343. end;
  344. {*****************************************************************************
  345. FirstCallN
  346. *****************************************************************************}
  347. procedure firstcalln(var p : ptree);
  348. type
  349. pprocdefcoll = ^tprocdefcoll;
  350. tprocdefcoll = record
  351. data : pprocdef;
  352. nextpara : pparaitem;
  353. firstpara : pparaitem;
  354. next : pprocdefcoll;
  355. end;
  356. var
  357. hp,procs,hp2 : pprocdefcoll;
  358. pd : pprocdef;
  359. oldcallprocsym : pprocsym;
  360. def_from,def_to,conv_to : pdef;
  361. hpt,pt,inlinecode : ptree;
  362. exactmatch,inlined : boolean;
  363. paralength,lastpara : longint;
  364. lastparatype : pdef;
  365. pdc : pparaitem;
  366. {$ifdef TEST_PROCSYMS}
  367. nextprocsym : pprocsym;
  368. symt : psymtable;
  369. {$endif TEST_PROCSYMS}
  370. { only Dummy }
  371. hcvt : tconverttype;
  372. regi : tregister;
  373. method_must_be_valid : boolean;
  374. label
  375. errorexit;
  376. { check if the resulttype from tree p is equal with def, needed
  377. for stringconstn and formaldef }
  378. function is_equal(p:ptree;def:pdef) : boolean;
  379. begin
  380. { safety check }
  381. if not (assigned(def) or assigned(p^.resulttype)) then
  382. begin
  383. is_equal:=false;
  384. exit;
  385. end;
  386. { all types can be passed to a formaldef }
  387. is_equal:=(def^.deftype=formaldef) or
  388. (types.is_equal(p^.resulttype,def))
  389. { to support ansi/long/wide strings in a proper way }
  390. { string and string[10] are assumed as equal }
  391. { when searching the correct overloaded procedure }
  392. or
  393. (
  394. (def^.deftype=stringdef) and (p^.resulttype^.deftype=stringdef) and
  395. (pstringdef(def)^.string_typ=pstringdef(p^.resulttype)^.string_typ)
  396. )
  397. or
  398. (
  399. (p^.left^.treetype=stringconstn) and
  400. (is_ansistring(p^.resulttype) and is_pchar(def))
  401. )
  402. or
  403. (
  404. (p^.left^.treetype=ordconstn) and
  405. (is_char(p^.resulttype) and (is_shortstring(def) or is_ansistring(def)))
  406. )
  407. { set can also be a not yet converted array constructor }
  408. or
  409. (
  410. (def^.deftype=setdef) and (p^.resulttype^.deftype=arraydef) and
  411. (parraydef(p^.resulttype)^.IsConstructor) and not(parraydef(p^.resulttype)^.IsVariant)
  412. )
  413. { in tp7 mode proc -> procvar is allowed }
  414. or
  415. (
  416. (m_tp_procvar in aktmodeswitches) and
  417. (def^.deftype=procvardef) and (p^.left^.treetype=calln) and
  418. (proc_to_procvar_equal(pprocdef(p^.left^.procdefinition),pprocvardef(def)))
  419. )
  420. ;
  421. end;
  422. function is_in_limit(def_from,def_to : pdef) : boolean;
  423. begin
  424. is_in_limit:=(def_from^.deftype = orddef) and
  425. (def_to^.deftype = orddef) and
  426. (porddef(def_from)^.low>porddef(def_to)^.low) and
  427. (porddef(def_from)^.high<porddef(def_to)^.high);
  428. end;
  429. var
  430. is_const : boolean;
  431. begin
  432. { release registers! }
  433. { if procdefinition<>nil then we called firstpass already }
  434. { it seems to be bad because of the registers }
  435. { at least we can avoid the overloaded search !! }
  436. procs:=nil;
  437. { made this global for disposing !! }
  438. oldcallprocsym:=aktcallprocsym;
  439. aktcallprocsym:=nil;
  440. inlined:=false;
  441. if assigned(p^.procdefinition) and
  442. (pocall_inline in p^.procdefinition^.proccalloptions) then
  443. begin
  444. inlinecode:=p^.right;
  445. if assigned(inlinecode) then
  446. begin
  447. inlined:=true;
  448. {$ifdef INCLUDEOK}
  449. exclude(p^.procdefinition^.proccalloptions,pocall_inline);
  450. {$else}
  451. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
  452. {$endif}
  453. end;
  454. p^.right:=nil;
  455. end;
  456. if assigned(p^.procdefinition) and
  457. (po_containsself in p^.procdefinition^.procoptions) then
  458. message(cg_e_cannot_call_message_direct);
  459. { procedure variable ? }
  460. if assigned(p^.right) then
  461. begin
  462. { procedure does a call }
  463. procinfo^.flags:=procinfo^.flags or pi_do_call;
  464. {$ifndef newcg}
  465. { calc the correture value for the register }
  466. {$ifdef i386}
  467. for regi:=R_EAX to R_EDI do
  468. inc(reg_pushes[regi],t_times*2);
  469. {$endif}
  470. {$ifdef m68k}
  471. for regi:=R_D0 to R_A6 do
  472. inc(reg_pushes[regi],t_times*2);
  473. {$endif}
  474. {$endif newcg}
  475. { calculate the type of the parameters }
  476. if assigned(p^.left) then
  477. begin
  478. firstcallparan(p^.left,nil,false);
  479. if codegenerror then
  480. goto errorexit;
  481. end;
  482. firstpass(p^.right);
  483. set_varstate(p^.right,true);
  484. { check the parameters }
  485. pdc:=pparaitem(pprocvardef(p^.right^.resulttype)^.para^.first);
  486. pt:=p^.left;
  487. while assigned(pdc) and assigned(pt) do
  488. begin
  489. pt:=pt^.right;
  490. pdc:=pparaitem(pdc^.next);
  491. end;
  492. if assigned(pt) or assigned(pdc) then
  493. begin
  494. if assigned(pt) then
  495. aktfilepos:=pt^.fileinfo;
  496. CGMessage(parser_e_illegal_parameter_list);
  497. end;
  498. { insert type conversions }
  499. if assigned(p^.left) then
  500. begin
  501. firstcallparan(p^.left,pparaitem(pprocvardef(p^.right^.resulttype)^.para^.first),true);
  502. if codegenerror then
  503. goto errorexit;
  504. end;
  505. p^.resulttype:=pprocvardef(p^.right^.resulttype)^.rettype.def;
  506. { this was missing, leads to a bug below if
  507. the procvar is a function }
  508. p^.procdefinition:=pabstractprocdef(p^.right^.resulttype);
  509. end
  510. else
  511. { not a procedure variable }
  512. begin
  513. { determine the type of the parameters }
  514. if assigned(p^.left) then
  515. begin
  516. firstcallparan(p^.left,nil,false);
  517. if codegenerror then
  518. goto errorexit;
  519. end;
  520. aktcallprocsym:=pprocsym(p^.symtableprocentry);
  521. { do we know the procedure to call ? }
  522. if not(assigned(p^.procdefinition)) then
  523. begin
  524. {$ifdef TEST_PROCSYMS}
  525. if (p^.unit_specific) or
  526. assigned(p^.methodpointer) then
  527. nextprocsym:=nil
  528. else while not assigned(procs) do
  529. begin
  530. symt:=p^.symtableproc;
  531. srsym:=nil;
  532. while assigned(symt^.next) and not assigned(srsym) do
  533. begin
  534. symt:=symt^.next;
  535. getsymonlyin(symt,actprocsym^.name);
  536. if assigned(srsym) then
  537. if srsym^.typ<>procsym then
  538. begin
  539. { reject all that is not a procedure }
  540. srsym:=nil;
  541. { don't search elsewhere }
  542. while assigned(symt^.next) do
  543. symt:=symt^.next;
  544. end;
  545. end;
  546. nextprocsym:=srsym;
  547. end;
  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^.paratype.def) then
  622. begin
  623. if hp^.nextpara^.paratype.def=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^.paratype.def,
  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^.paratype.def;
  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^.paratype.def) then
  745. begin
  746. def_to:=hp^.nextpara^.paratype.def;
  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^.paratype.def)) 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^.paratype.def)) 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^.paratype.def;
  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^.rettype.def;
  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. firstcallparan(p^.left,pparaitem(p^.procdefinition^.para^.first),true);
  1003. end;
  1004. {$ifndef newcg}
  1005. {$ifdef i386}
  1006. for regi:=R_EAX to R_EDI do
  1007. begin
  1008. if (pprocdef(p^.procdefinition)^.usedregisters and ($80 shr word(regi)))<>0 then
  1009. inc(reg_pushes[regi],t_times*2);
  1010. end;
  1011. {$endif}
  1012. {$ifdef m68k}
  1013. for regi:=R_D0 to R_A6 do
  1014. begin
  1015. if (pprocdef(p^.procdefinition)^.usedregisters and ($800 shr word(regi)))<>0 then
  1016. inc(reg_pushes[regi],t_times*2);
  1017. end;
  1018. {$endif}
  1019. {$endif newcg}
  1020. end;
  1021. { ensure that the result type is set }
  1022. p^.resulttype:=p^.procdefinition^.rettype.def;
  1023. { get a register for the return value }
  1024. if (p^.resulttype<>pdef(voiddef)) then
  1025. begin
  1026. if (p^.procdefinition^.proctypeoption=potype_constructor) then
  1027. begin
  1028. { extra handling of classes }
  1029. { p^.methodpointer should be assigned! }
  1030. if assigned(p^.methodpointer) and assigned(p^.methodpointer^.resulttype) and
  1031. (p^.methodpointer^.resulttype^.deftype=classrefdef) then
  1032. begin
  1033. p^.location.loc:=LOC_REGISTER;
  1034. p^.registers32:=1;
  1035. { the result type depends on the classref }
  1036. p^.resulttype:=pclassrefdef(p^.methodpointer^.resulttype)^.pointertype.def;
  1037. end
  1038. { a object constructor returns the result with the flags }
  1039. else
  1040. p^.location.loc:=LOC_FLAGS;
  1041. end
  1042. else
  1043. begin
  1044. {$ifdef SUPPORT_MMX}
  1045. if (cs_mmx in aktlocalswitches) and
  1046. is_mmx_able_array(p^.resulttype) then
  1047. begin
  1048. p^.location.loc:=LOC_MMXREGISTER;
  1049. p^.registersmmx:=1;
  1050. end
  1051. else
  1052. {$endif SUPPORT_MMX}
  1053. if ret_in_acc(p^.resulttype) then
  1054. begin
  1055. p^.location.loc:=LOC_REGISTER;
  1056. if is_64bitint(p^.resulttype) then
  1057. p^.registers32:=2
  1058. else
  1059. p^.registers32:=1;
  1060. { wide- and ansistrings are returned in EAX }
  1061. { but they are imm. moved to a memory location }
  1062. if is_widestring(p^.resulttype) or
  1063. is_ansistring(p^.resulttype) then
  1064. begin
  1065. p^.location.loc:=LOC_MEM;
  1066. { this is wrong we still need one register PM
  1067. p^.registers32:=0; }
  1068. { we use ansistrings so no fast exit here }
  1069. procinfo^.no_fast_exit:=true;
  1070. p^.registers32:=1;
  1071. end;
  1072. end
  1073. else if (p^.resulttype^.deftype=floatdef) then
  1074. begin
  1075. p^.location.loc:=LOC_FPU;
  1076. p^.registersfpu:=1;
  1077. end
  1078. else
  1079. p^.location.loc:=LOC_MEM;
  1080. end;
  1081. end;
  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. method_must_be_valid:=false
  1109. else
  1110. method_must_be_valid:=true;
  1111. firstpass(p^.methodpointer);
  1112. set_varstate(p^.methodpointer,method_must_be_valid);
  1113. { The object is already used ven if it is called once }
  1114. if (p^.methodpointer^.treetype=loadn) and
  1115. (p^.methodpointer^.symtableentry^.typ=varsym) then
  1116. pvarsym(p^.methodpointer^.symtableentry)^.varstate:=vs_used;
  1117. p^.registersfpu:=max(p^.methodpointer^.registersfpu,p^.registersfpu);
  1118. p^.registers32:=max(p^.methodpointer^.registers32,p^.registers32);
  1119. {$ifdef SUPPORT_MMX}
  1120. p^.registersmmx:=max(p^.methodpointer^.registersmmx,p^.registersmmx);
  1121. {$endif SUPPORT_MMX}
  1122. end;
  1123. end;
  1124. end;
  1125. if inlined then
  1126. p^.right:=inlinecode;
  1127. { determine the registers of the procedure variable }
  1128. { is this OK for inlined procs also ?? (PM) }
  1129. if assigned(p^.right) then
  1130. begin
  1131. p^.registersfpu:=max(p^.right^.registersfpu,p^.registersfpu);
  1132. p^.registers32:=max(p^.right^.registers32,p^.registers32);
  1133. {$ifdef SUPPORT_MMX}
  1134. p^.registersmmx:=max(p^.right^.registersmmx,p^.registersmmx);
  1135. {$endif SUPPORT_MMX}
  1136. end;
  1137. { determine the registers of the procedure }
  1138. if assigned(p^.left) then
  1139. begin
  1140. p^.registersfpu:=max(p^.left^.registersfpu,p^.registersfpu);
  1141. p^.registers32:=max(p^.left^.registers32,p^.registers32);
  1142. {$ifdef SUPPORT_MMX}
  1143. p^.registersmmx:=max(p^.left^.registersmmx,p^.registersmmx);
  1144. {$endif SUPPORT_MMX}
  1145. end;
  1146. errorexit:
  1147. { Reset some settings back }
  1148. if assigned(procs) then
  1149. dispose(procs);
  1150. if inlined then
  1151. {$ifdef INCLUDEOK}
  1152. include(p^.procdefinition^.proccalloptions,pocall_inline);
  1153. {$else}
  1154. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions+[pocall_inline];
  1155. {$endif}
  1156. aktcallprocsym:=oldcallprocsym;
  1157. end;
  1158. {*****************************************************************************
  1159. FirstProcInlineN
  1160. *****************************************************************************}
  1161. procedure firstprocinline(var p : ptree);
  1162. begin
  1163. { left contains the code in tree form }
  1164. { but it has already been firstpassed }
  1165. { so firstpass(p^.left); does not seem required }
  1166. { might be required later if we change the arg handling !! }
  1167. end;
  1168. end.
  1169. {
  1170. $Log$
  1171. Revision 1.81 2000-02-24 18:41:39 peter
  1172. * removed warnings/notes
  1173. Revision 1.80 2000/02/17 14:53:43 florian
  1174. * some updates for the newcg
  1175. Revision 1.79 2000/02/09 13:23:07 peter
  1176. * log truncated
  1177. Revision 1.78 2000/01/07 09:35:12 pierre
  1178. * set_varstate must be called after typeconv insertions
  1179. Revision 1.77 2000/01/07 01:14:44 peter
  1180. * updated copyright to 2000
  1181. Revision 1.76 1999/12/19 15:13:56 peter
  1182. * constant array type conversion fixed
  1183. Revision 1.75 1999/12/09 23:18:04 pierre
  1184. * no_fast_exit if procedure contains implicit termination code
  1185. Revision 1.74 1999/11/30 10:40:57 peter
  1186. + ttype, tsymlist
  1187. Revision 1.73 1999/11/18 15:34:49 pierre
  1188. * Notes/Hints for local syms changed to
  1189. Set_varstate function
  1190. Revision 1.72 1999/11/17 17:05:07 pierre
  1191. * Notes/hints changes
  1192. Revision 1.71 1999/11/06 14:34:29 peter
  1193. * truncated log to 20 revs
  1194. Revision 1.70 1999/10/26 12:30:46 peter
  1195. * const parameter is now checked
  1196. * better and generic check if a node can be used for assigning
  1197. * export fixes
  1198. * procvar equal works now (it never had worked at least from 0.99.8)
  1199. * defcoll changed to linkedlist with pparaitem so it can easily be
  1200. walked both directions
  1201. Revision 1.69 1999/10/22 14:37:30 peter
  1202. * error when properties are passed to var parameters
  1203. Revision 1.68 1999/10/13 10:35:27 peter
  1204. * var must match exactly error msg extended with got and expected type
  1205. * array constructor type check now gives error on wrong types
  1206. Revision 1.67 1999/10/12 15:50:54 pierre
  1207. * error if calling interrupt procedure
  1208. Revision 1.66 1999/09/27 23:45:00 peter
  1209. * procinfo is now a pointer
  1210. * support for result setting in sub procedure
  1211. Revision 1.65 1999/09/16 23:05:56 florian
  1212. * m68k compiler is again compilable (only gas writer, no assembler reader)
  1213. Revision 1.64 1999/09/14 07:59:48 florian
  1214. * finally!? fixed
  1215. with <function with result in temp> do
  1216. My last and also Peter's fix before were wrong :(
  1217. Revision 1.63 1999/09/10 18:48:11 florian
  1218. * some bug fixes (e.g. must_be_valid and procinfo^.funcret_is_valid)
  1219. * most things for stored properties fixed
  1220. Revision 1.62 1999/08/23 23:42:52 pierre
  1221. * hnewn reg allocation corrected
  1222. Revision 1.61 1999/08/17 13:26:08 peter
  1223. * arrayconstructor -> arrayofconst fixed when arraycosntructor was not
  1224. variant.
  1225. Revision 1.60 1999/08/16 23:23:39 peter
  1226. * arrayconstructor -> openarray type conversions for element types
  1227. Revision 1.59 1999/08/13 21:33:16 peter
  1228. * support for array constructors extended and more error checking
  1229. }