tccal.pas 55 KB

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