tccal.pas 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323
  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. regi : tregister;
  376. method_must_be_valid : boolean;
  377. label
  378. errorexit;
  379. { check if the resulttype from tree p is equal with def, needed
  380. for stringconstn and formaldef }
  381. function is_equal(p:ptree;def:pdef) : boolean;
  382. begin
  383. { safety check }
  384. if not (assigned(def) or assigned(p^.resulttype)) then
  385. begin
  386. is_equal:=false;
  387. exit;
  388. end;
  389. { all types can be passed to a formaldef }
  390. is_equal:=(def^.deftype=formaldef) or
  391. (types.is_equal(p^.resulttype,def))
  392. { to support ansi/long/wide strings in a proper way }
  393. { string and string[10] are assumed as equal }
  394. { when searching the correct overloaded procedure }
  395. or
  396. (
  397. (def^.deftype=stringdef) and (p^.resulttype^.deftype=stringdef) and
  398. (pstringdef(def)^.string_typ=pstringdef(p^.resulttype)^.string_typ)
  399. )
  400. or
  401. (
  402. (p^.left^.treetype=stringconstn) and
  403. (is_ansistring(p^.resulttype) and is_pchar(def))
  404. )
  405. or
  406. (
  407. (p^.left^.treetype=ordconstn) and
  408. (is_char(p^.resulttype) and (is_shortstring(def) or is_ansistring(def)))
  409. )
  410. { set can also be a not yet converted array constructor }
  411. or
  412. (
  413. (def^.deftype=setdef) and (p^.resulttype^.deftype=arraydef) and
  414. (parraydef(p^.resulttype)^.IsConstructor) and not(parraydef(p^.resulttype)^.IsVariant)
  415. )
  416. { in tp7 mode proc -> procvar is allowed }
  417. or
  418. (
  419. (m_tp_procvar in aktmodeswitches) and
  420. (def^.deftype=procvardef) and (p^.left^.treetype=calln) and
  421. (proc_to_procvar_equal(pprocdef(p^.left^.procdefinition),pprocvardef(def)))
  422. )
  423. ;
  424. end;
  425. function is_in_limit(def_from,def_to : pdef) : boolean;
  426. begin
  427. is_in_limit:=(def_from^.deftype = orddef) and
  428. (def_to^.deftype = orddef) and
  429. (porddef(def_from)^.low>porddef(def_to)^.low) and
  430. (porddef(def_from)^.high<porddef(def_to)^.high);
  431. end;
  432. var
  433. is_const : boolean;
  434. begin
  435. { release registers! }
  436. { if procdefinition<>nil then we called firstpass already }
  437. { it seems to be bad because of the registers }
  438. { at least we can avoid the overloaded search !! }
  439. procs:=nil;
  440. { made this global for disposing !! }
  441. oldcallprocsym:=aktcallprocsym;
  442. aktcallprocsym:=nil;
  443. inlined:=false;
  444. if assigned(p^.procdefinition) and
  445. (pocall_inline in p^.procdefinition^.proccalloptions) then
  446. begin
  447. inlinecode:=p^.right;
  448. if assigned(inlinecode) then
  449. begin
  450. inlined:=true;
  451. {$ifdef INCLUDEOK}
  452. exclude(p^.procdefinition^.proccalloptions,pocall_inline);
  453. {$else}
  454. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
  455. {$endif}
  456. end;
  457. p^.right:=nil;
  458. end;
  459. if assigned(p^.procdefinition) and
  460. (po_containsself in p^.procdefinition^.procoptions) then
  461. message(cg_e_cannot_call_message_direct);
  462. { procedure variable ? }
  463. if assigned(p^.right) then
  464. begin
  465. { procedure does a call }
  466. procinfo^.flags:=procinfo^.flags or pi_do_call;
  467. {$ifndef newcg}
  468. { calc the correture value for the register }
  469. {$ifdef i386}
  470. for regi:=R_EAX to R_EDI do
  471. inc(reg_pushes[regi],t_times*2);
  472. {$endif}
  473. {$ifdef m68k}
  474. for regi:=R_D0 to R_A6 do
  475. inc(reg_pushes[regi],t_times*2);
  476. {$endif}
  477. {$endif newcg}
  478. { calculate the type of the parameters }
  479. if assigned(p^.left) then
  480. begin
  481. firstcallparan(p^.left,nil,false);
  482. if codegenerror then
  483. goto errorexit;
  484. end;
  485. firstpass(p^.right);
  486. set_varstate(p^.right,true);
  487. { check the parameters }
  488. pdc:=pparaitem(pprocvardef(p^.right^.resulttype)^.para^.first);
  489. pt:=p^.left;
  490. while assigned(pdc) and assigned(pt) do
  491. begin
  492. pt:=pt^.right;
  493. pdc:=pparaitem(pdc^.next);
  494. end;
  495. if assigned(pt) or assigned(pdc) then
  496. begin
  497. if assigned(pt) then
  498. aktfilepos:=pt^.fileinfo;
  499. CGMessage(parser_e_illegal_parameter_list);
  500. end;
  501. { insert type conversions }
  502. if assigned(p^.left) then
  503. begin
  504. firstcallparan(p^.left,pparaitem(pprocvardef(p^.right^.resulttype)^.para^.first),true);
  505. if codegenerror then
  506. goto errorexit;
  507. end;
  508. p^.resulttype:=pprocvardef(p^.right^.resulttype)^.rettype.def;
  509. { this was missing, leads to a bug below if
  510. the procvar is a function }
  511. p^.procdefinition:=pabstractprocdef(p^.right^.resulttype);
  512. end
  513. else
  514. { not a procedure variable }
  515. begin
  516. { determine the type of the parameters }
  517. if assigned(p^.left) then
  518. begin
  519. firstcallparan(p^.left,nil,false);
  520. if codegenerror then
  521. goto errorexit;
  522. end;
  523. aktcallprocsym:=pprocsym(p^.symtableprocentry);
  524. { do we know the procedure to call ? }
  525. if not(assigned(p^.procdefinition)) then
  526. begin
  527. {$ifdef TEST_PROCSYMS}
  528. if (p^.unit_specific) or
  529. assigned(p^.methodpointer) then
  530. nextprocsym:=nil
  531. else while not assigned(procs) do
  532. begin
  533. symt:=p^.symtableproc;
  534. srsym:=nil;
  535. while assigned(symt^.next) and not assigned(srsym) do
  536. begin
  537. symt:=symt^.next;
  538. getsymonlyin(symt,actprocsym^.name);
  539. if assigned(srsym) then
  540. if srsym^.typ<>procsym then
  541. begin
  542. { reject all that is not a procedure }
  543. srsym:=nil;
  544. { don't search elsewhere }
  545. while assigned(symt^.next) do
  546. symt:=symt^.next;
  547. end;
  548. end;
  549. nextprocsym:=srsym;
  550. end;
  551. {$endif TEST_PROCSYMS}
  552. { determine length of parameter list }
  553. pt:=p^.left;
  554. paralength:=0;
  555. while assigned(pt) do
  556. begin
  557. inc(paralength);
  558. pt:=pt^.right;
  559. end;
  560. { link all procedures which have the same # of parameters }
  561. pd:=aktcallprocsym^.definition;
  562. while assigned(pd) do
  563. begin
  564. { only when the # of parameter are equal }
  565. if (pd^.para^.count=paralength) then
  566. begin
  567. new(hp);
  568. hp^.data:=pd;
  569. hp^.next:=procs;
  570. hp^.nextpara:=pparaitem(pd^.para^.first);
  571. hp^.firstpara:=pparaitem(pd^.para^.first);
  572. procs:=hp;
  573. end;
  574. pd:=pd^.nextoverloaded;
  575. end;
  576. { no procedures found? then there is something wrong
  577. with the parameter size }
  578. if not assigned(procs) then
  579. begin
  580. { in tp mode we can try to convert to procvar if
  581. there are no parameters specified }
  582. if not(assigned(p^.left)) and
  583. (m_tp_procvar in aktmodeswitches) then
  584. begin
  585. if (p^.symtableprocentry^.owner^.symtabletype=objectsymtable) and
  586. (pobjectdef(p^.symtableprocentry^.owner^.defowner)^.is_class) then
  587. hpt:=genloadmethodcallnode(pprocsym(p^.symtableprocentry),p^.symtableproc,
  588. getcopy(p^.methodpointer))
  589. else
  590. hpt:=genloadcallnode(pprocsym(p^.symtableprocentry),p^.symtableproc);
  591. disposetree(p);
  592. firstpass(hpt);
  593. p:=hpt;
  594. end
  595. else
  596. begin
  597. if assigned(p^.left) then
  598. aktfilepos:=p^.left^.fileinfo;
  599. CGMessage(parser_e_wrong_parameter_size);
  600. aktcallprocsym^.write_parameter_lists;
  601. end;
  602. goto errorexit;
  603. end;
  604. { now we can compare parameter after parameter }
  605. pt:=p^.left;
  606. { we start with the last parameter }
  607. lastpara:=paralength+1;
  608. lastparatype:=nil;
  609. while assigned(pt) do
  610. begin
  611. dec(lastpara);
  612. { walk all procedures and determine how this parameter matches and set:
  613. 1. pt^.exact_match_found if one parameter has an exact match
  614. 2. exactmatch if an equal or exact match is found
  615. 3. para^.argconvtyp to exact,equal or convertable
  616. (when convertable then also convertlevel is set)
  617. 4. pt^.convlevel1found if there is a convertlevel=1
  618. 5. pt^.convlevel2found if there is a convertlevel=2
  619. }
  620. exactmatch:=false;
  621. hp:=procs;
  622. while assigned(hp) do
  623. begin
  624. if is_equal(pt,hp^.nextpara^.paratype.def) then
  625. begin
  626. if hp^.nextpara^.paratype.def=pt^.resulttype then
  627. begin
  628. pt^.exact_match_found:=true;
  629. hp^.nextpara^.argconvtyp:=act_exact;
  630. end
  631. else
  632. hp^.nextpara^.argconvtyp:=act_equal;
  633. exactmatch:=true;
  634. end
  635. else
  636. begin
  637. hp^.nextpara^.argconvtyp:=act_convertable;
  638. hp^.nextpara^.convertlevel:=isconvertable(pt^.resulttype,hp^.nextpara^.paratype.def,
  639. hcvt,pt^.left^.treetype,false);
  640. case hp^.nextpara^.convertlevel of
  641. 1 : pt^.convlevel1found:=true;
  642. 2 : pt^.convlevel2found:=true;
  643. end;
  644. end;
  645. hp:=hp^.next;
  646. end;
  647. { If there was an exactmatch then delete all convertables }
  648. if exactmatch then
  649. begin
  650. hp:=procs;
  651. procs:=nil;
  652. while assigned(hp) do
  653. begin
  654. hp2:=hp^.next;
  655. { keep if not convertable }
  656. if (hp^.nextpara^.argconvtyp<>act_convertable) then
  657. begin
  658. hp^.next:=procs;
  659. procs:=hp;
  660. end
  661. else
  662. dispose(hp);
  663. hp:=hp2;
  664. end;
  665. end
  666. else
  667. { No exact match was found, remove all procedures that are
  668. not convertable (convertlevel=0) }
  669. begin
  670. hp:=procs;
  671. procs:=nil;
  672. while assigned(hp) do
  673. begin
  674. hp2:=hp^.next;
  675. { keep if not convertable }
  676. if (hp^.nextpara^.convertlevel<>0) then
  677. begin
  678. hp^.next:=procs;
  679. procs:=hp;
  680. end
  681. else
  682. begin
  683. { save the type for nice error message }
  684. lastparatype:=hp^.nextpara^.paratype.def;
  685. dispose(hp);
  686. end;
  687. hp:=hp2;
  688. end;
  689. end;
  690. { update nextpara for all procedures }
  691. hp:=procs;
  692. while assigned(hp) do
  693. begin
  694. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  695. hp:=hp^.next;
  696. end;
  697. { load next parameter or quit loop if no procs left }
  698. if assigned(procs) then
  699. pt:=pt^.right
  700. else
  701. break;
  702. end;
  703. { All parameters are checked, check if there are any
  704. procedures left }
  705. if not assigned(procs) then
  706. begin
  707. { there is an error, must be wrong type, because
  708. wrong size is already checked (PFV) }
  709. if (not assigned(lastparatype)) or
  710. (not assigned(pt)) or
  711. (not assigned(pt^.resulttype)) then
  712. internalerror(39393)
  713. else
  714. begin
  715. aktfilepos:=pt^.fileinfo;
  716. CGMessage3(type_e_wrong_parameter_type,tostr(lastpara),
  717. pt^.resulttype^.typename,lastparatype^.typename);
  718. end;
  719. aktcallprocsym^.write_parameter_lists;
  720. goto errorexit;
  721. end;
  722. { if there are several choices left then for orddef }
  723. { if a type is totally included in the other }
  724. { we don't fear an overflow , }
  725. { so we can do as if it is an exact match }
  726. { this will convert integer to longint }
  727. { rather than to words }
  728. { conversion of byte to integer or longint }
  729. {would still not be solved }
  730. if assigned(procs) and assigned(procs^.next) then
  731. begin
  732. hp:=procs;
  733. while assigned(hp) do
  734. begin
  735. hp^.nextpara:=hp^.firstpara;
  736. hp:=hp^.next;
  737. end;
  738. pt:=p^.left;
  739. while assigned(pt) do
  740. begin
  741. { matches a parameter of one procedure exact ? }
  742. exactmatch:=false;
  743. def_from:=pt^.resulttype;
  744. hp:=procs;
  745. while assigned(hp) do
  746. begin
  747. if not is_equal(pt,hp^.nextpara^.paratype.def) then
  748. begin
  749. def_to:=hp^.nextpara^.paratype.def;
  750. if ((def_from^.deftype=orddef) and (def_to^.deftype=orddef)) and
  751. (is_in_limit(def_from,def_to) or
  752. ((hp^.nextpara^.paratyp=vs_var) and
  753. (def_from^.size=def_to^.size))) then
  754. begin
  755. exactmatch:=true;
  756. conv_to:=def_to;
  757. end;
  758. end;
  759. hp:=hp^.next;
  760. end;
  761. { .... if yes, del all the other procedures }
  762. if exactmatch then
  763. begin
  764. { the first .... }
  765. while (assigned(procs)) and not(is_in_limit(def_from,procs^.nextpara^.paratype.def)) do
  766. begin
  767. hp:=procs^.next;
  768. dispose(procs);
  769. procs:=hp;
  770. end;
  771. { and the others }
  772. hp:=procs;
  773. while (assigned(hp)) and assigned(hp^.next) do
  774. begin
  775. if not(is_in_limit(def_from,hp^.next^.nextpara^.paratype.def)) then
  776. begin
  777. hp2:=hp^.next^.next;
  778. dispose(hp^.next);
  779. hp^.next:=hp2;
  780. end
  781. else
  782. begin
  783. def_to:=hp^.next^.nextpara^.paratype.def;
  784. if (conv_to^.size>def_to^.size) or
  785. ((porddef(conv_to)^.low<porddef(def_to)^.low) and
  786. (porddef(conv_to)^.high>porddef(def_to)^.high)) then
  787. begin
  788. hp2:=procs;
  789. procs:=hp;
  790. conv_to:=def_to;
  791. dispose(hp2);
  792. end
  793. else
  794. hp:=hp^.next;
  795. end;
  796. end;
  797. end;
  798. { update nextpara for all procedures }
  799. hp:=procs;
  800. while assigned(hp) do
  801. begin
  802. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  803. hp:=hp^.next;
  804. end;
  805. pt:=pt^.right;
  806. end;
  807. end;
  808. { let's try to eliminate equal if there is an exact match
  809. is there }
  810. if assigned(procs) and assigned(procs^.next) then
  811. begin
  812. { reset nextpara for all procs left }
  813. hp:=procs;
  814. while assigned(hp) do
  815. begin
  816. hp^.nextpara:=hp^.firstpara;
  817. hp:=hp^.next;
  818. end;
  819. pt:=p^.left;
  820. while assigned(pt) do
  821. begin
  822. if pt^.exact_match_found then
  823. begin
  824. hp:=procs;
  825. procs:=nil;
  826. while assigned(hp) do
  827. begin
  828. hp2:=hp^.next;
  829. { keep the exact matches, dispose the others }
  830. if (hp^.nextpara^.argconvtyp=act_exact) then
  831. begin
  832. hp^.next:=procs;
  833. procs:=hp;
  834. end
  835. else
  836. dispose(hp);
  837. hp:=hp2;
  838. end;
  839. end;
  840. { update nextpara for all procedures }
  841. hp:=procs;
  842. while assigned(hp) do
  843. begin
  844. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  845. hp:=hp^.next;
  846. end;
  847. pt:=pt^.right;
  848. end;
  849. end;
  850. { Check if there are convertlevel 1 and 2 differences
  851. left for the parameters, then discard all convertlevel
  852. 2 procedures. The value of convlevelXfound can still
  853. be used, because all convertables are still here or
  854. not }
  855. if assigned(procs) and assigned(procs^.next) then
  856. begin
  857. { reset nextpara for all procs left }
  858. hp:=procs;
  859. while assigned(hp) do
  860. begin
  861. hp^.nextpara:=hp^.firstpara;
  862. hp:=hp^.next;
  863. end;
  864. pt:=p^.left;
  865. while assigned(pt) do
  866. begin
  867. if pt^.convlevel1found and pt^.convlevel2found then
  868. begin
  869. hp:=procs;
  870. procs:=nil;
  871. while assigned(hp) do
  872. begin
  873. hp2:=hp^.next;
  874. { keep all not act_convertable and all convertlevels=1 }
  875. if (hp^.nextpara^.argconvtyp<>act_convertable) or
  876. (hp^.nextpara^.convertlevel=1) then
  877. begin
  878. hp^.next:=procs;
  879. procs:=hp;
  880. end
  881. else
  882. dispose(hp);
  883. hp:=hp2;
  884. end;
  885. end;
  886. { update nextpara for all procedures }
  887. hp:=procs;
  888. while assigned(hp) do
  889. begin
  890. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  891. hp:=hp^.next;
  892. end;
  893. pt:=pt^.right;
  894. end;
  895. end;
  896. if not(assigned(procs)) or assigned(procs^.next) then
  897. begin
  898. CGMessage(cg_e_cant_choose_overload_function);
  899. aktcallprocsym^.write_parameter_lists;
  900. goto errorexit;
  901. end;
  902. {$ifdef TEST_PROCSYMS}
  903. if (procs=nil) and assigned(nextprocsym) then
  904. begin
  905. p^.symtableprocentry:=nextprocsym;
  906. p^.symtableproc:=symt;
  907. end;
  908. end ; { of while assigned(p^.symtableprocentry) do }
  909. {$endif TEST_PROCSYMS}
  910. if make_ref then
  911. begin
  912. procs^.data^.lastref:=new(pref,init(procs^.data^.lastref,@p^.fileinfo));
  913. inc(procs^.data^.refcount);
  914. if procs^.data^.defref=nil then
  915. procs^.data^.defref:=procs^.data^.lastref;
  916. end;
  917. p^.procdefinition:=procs^.data;
  918. p^.resulttype:=procs^.data^.rettype.def;
  919. { big error for with statements
  920. p^.symtableproc:=p^.procdefinition^.owner;
  921. but neede for overloaded operators !! }
  922. if p^.symtableproc=nil then
  923. p^.symtableproc:=p^.procdefinition^.owner;
  924. p^.location.loc:=LOC_MEM;
  925. {$ifdef CHAINPROCSYMS}
  926. { object with method read;
  927. call to read(x) will be a usual procedure call }
  928. if assigned(p^.methodpointer) and
  929. (p^.procdefinition^._class=nil) then
  930. begin
  931. { not ok for extended }
  932. case p^.methodpointer^.treetype of
  933. typen,hnewn : fatalerror(no_para_match);
  934. end;
  935. disposetree(p^.methodpointer);
  936. p^.methodpointer:=nil;
  937. end;
  938. {$endif CHAINPROCSYMS}
  939. end; { end of procedure to call determination }
  940. is_const:=(pocall_internconst in p^.procdefinition^.proccalloptions) and
  941. ((block_type=bt_const) or
  942. (assigned(p^.left) and (p^.left^.left^.treetype in [realconstn,ordconstn])));
  943. { handle predefined procedures }
  944. if (pocall_internproc in p^.procdefinition^.proccalloptions) or is_const then
  945. begin
  946. if assigned(p^.left) then
  947. begin
  948. { settextbuf needs two args }
  949. if assigned(p^.left^.right) then
  950. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,p^.left)
  951. else
  952. begin
  953. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,p^.left^.left);
  954. putnode(p^.left);
  955. end;
  956. end
  957. else
  958. begin
  959. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,nil);
  960. end;
  961. putnode(p);
  962. firstpass(pt);
  963. p:=pt;
  964. goto errorexit;
  965. end
  966. else
  967. { no intern procedure => we do a call }
  968. { calc the correture value for the register }
  969. { handle predefined procedures }
  970. if (pocall_inline in p^.procdefinition^.proccalloptions) then
  971. begin
  972. if assigned(p^.methodpointer) then
  973. CGMessage(cg_e_unable_inline_object_methods);
  974. if assigned(p^.right) and (p^.right^.treetype<>procinlinen) then
  975. CGMessage(cg_e_unable_inline_procvar);
  976. { p^.treetype:=procinlinen; }
  977. if not assigned(p^.right) then
  978. begin
  979. if assigned(pprocdef(p^.procdefinition)^.code) then
  980. inlinecode:=genprocinlinenode(p,ptree(pprocdef(p^.procdefinition)^.code))
  981. else
  982. CGMessage(cg_e_no_code_for_inline_stored);
  983. if assigned(inlinecode) then
  984. begin
  985. { consider it has not inlined if called
  986. again inside the args }
  987. {$ifdef INCLUDEOK}
  988. exclude(p^.procdefinition^.proccalloptions,pocall_inline);
  989. {$else}
  990. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
  991. {$endif}
  992. firstpass(inlinecode);
  993. inlined:=true;
  994. end;
  995. end;
  996. end
  997. else
  998. procinfo^.flags:=procinfo^.flags or pi_do_call;
  999. if (po_interrupt in p^.procdefinition^.procoptions) then
  1000. CGmessage1(cg_e_no_call_to_interrupt,p^.symtableprocentry^.name);
  1001. { work trough all parameters to insert the type conversions }
  1002. { !!! done now after internproc !! (PM) }
  1003. if assigned(p^.left) then
  1004. begin
  1005. firstcallparan(p^.left,pparaitem(p^.procdefinition^.para^.first),true);
  1006. end;
  1007. {$ifndef newcg}
  1008. {$ifdef i386}
  1009. for regi:=R_EAX to R_EDI do
  1010. begin
  1011. if (pprocdef(p^.procdefinition)^.usedregisters and ($80 shr word(regi)))<>0 then
  1012. inc(reg_pushes[regi],t_times*2);
  1013. end;
  1014. {$endif}
  1015. {$ifdef m68k}
  1016. for regi:=R_D0 to R_A6 do
  1017. begin
  1018. if (pprocdef(p^.procdefinition)^.usedregisters and ($800 shr word(regi)))<>0 then
  1019. inc(reg_pushes[regi],t_times*2);
  1020. end;
  1021. {$endif}
  1022. {$endif newcg}
  1023. end;
  1024. { ensure that the result type is set }
  1025. p^.resulttype:=p^.procdefinition^.rettype.def;
  1026. { get a register for the return value }
  1027. if (p^.resulttype<>pdef(voiddef)) then
  1028. begin
  1029. if (p^.procdefinition^.proctypeoption=potype_constructor) then
  1030. begin
  1031. { extra handling of classes }
  1032. { p^.methodpointer should be assigned! }
  1033. if assigned(p^.methodpointer) and assigned(p^.methodpointer^.resulttype) and
  1034. (p^.methodpointer^.resulttype^.deftype=classrefdef) then
  1035. begin
  1036. p^.location.loc:=LOC_REGISTER;
  1037. p^.registers32:=1;
  1038. { the result type depends on the classref }
  1039. p^.resulttype:=pclassrefdef(p^.methodpointer^.resulttype)^.pointertype.def;
  1040. end
  1041. { a object constructor returns the result with the flags }
  1042. else
  1043. p^.location.loc:=LOC_FLAGS;
  1044. end
  1045. else
  1046. begin
  1047. {$ifdef SUPPORT_MMX}
  1048. if (cs_mmx in aktlocalswitches) and
  1049. is_mmx_able_array(p^.resulttype) then
  1050. begin
  1051. p^.location.loc:=LOC_MMXREGISTER;
  1052. p^.registersmmx:=1;
  1053. end
  1054. else
  1055. {$endif SUPPORT_MMX}
  1056. if ret_in_acc(p^.resulttype) then
  1057. begin
  1058. p^.location.loc:=LOC_REGISTER;
  1059. if is_64bitint(p^.resulttype) then
  1060. p^.registers32:=2
  1061. else
  1062. p^.registers32:=1;
  1063. { wide- and ansistrings are returned in EAX }
  1064. { but they are imm. moved to a memory location }
  1065. if is_widestring(p^.resulttype) or
  1066. is_ansistring(p^.resulttype) then
  1067. begin
  1068. p^.location.loc:=LOC_MEM;
  1069. { this is wrong we still need one register PM
  1070. p^.registers32:=0; }
  1071. { we use ansistrings so no fast exit here }
  1072. procinfo^.no_fast_exit:=true;
  1073. p^.registers32:=1;
  1074. end;
  1075. end
  1076. else if (p^.resulttype^.deftype=floatdef) then
  1077. begin
  1078. p^.location.loc:=LOC_FPU;
  1079. p^.registersfpu:=1;
  1080. end
  1081. else
  1082. p^.location.loc:=LOC_MEM;
  1083. end;
  1084. end;
  1085. { a fpu can be used in any procedure !! }
  1086. p^.registersfpu:=p^.procdefinition^.fpu_used;
  1087. { if this is a call to a method calc the registers }
  1088. if (p^.methodpointer<>nil) then
  1089. begin
  1090. case p^.methodpointer^.treetype of
  1091. { but only, if this is not a supporting node }
  1092. typen: ;
  1093. { we need one register for new return value PM }
  1094. hnewn : if p^.registers32=0 then
  1095. p^.registers32:=1;
  1096. else
  1097. begin
  1098. if (p^.procdefinition^.proctypeoption in [potype_constructor,potype_destructor]) and
  1099. assigned(p^.symtable) and (p^.symtable^.symtabletype=withsymtable) and
  1100. not pwithsymtable(p^.symtable)^.direct_with then
  1101. begin
  1102. CGmessage(cg_e_cannot_call_cons_dest_inside_with);
  1103. end; { Is accepted by Delphi !! }
  1104. { this is not a good reason to accept it in FPC if we produce
  1105. wrong code for it !!! (PM) }
  1106. { R.Assign is not a constructor !!! }
  1107. { but for R^.Assign, R must be valid !! }
  1108. if (p^.procdefinition^.proctypeoption=potype_constructor) or
  1109. ((p^.methodpointer^.treetype=loadn) and
  1110. (not(oo_has_virtual in pobjectdef(p^.methodpointer^.resulttype)^.objectoptions))) then
  1111. method_must_be_valid:=false
  1112. else
  1113. method_must_be_valid:=true;
  1114. firstpass(p^.methodpointer);
  1115. set_varstate(p^.methodpointer,method_must_be_valid);
  1116. { The object is already used ven if it is called once }
  1117. if (p^.methodpointer^.treetype=loadn) and
  1118. (p^.methodpointer^.symtableentry^.typ=varsym) then
  1119. pvarsym(p^.methodpointer^.symtableentry)^.varstate:=vs_used;
  1120. p^.registersfpu:=max(p^.methodpointer^.registersfpu,p^.registersfpu);
  1121. p^.registers32:=max(p^.methodpointer^.registers32,p^.registers32);
  1122. {$ifdef SUPPORT_MMX}
  1123. p^.registersmmx:=max(p^.methodpointer^.registersmmx,p^.registersmmx);
  1124. {$endif SUPPORT_MMX}
  1125. end;
  1126. end;
  1127. end;
  1128. if inlined then
  1129. p^.right:=inlinecode;
  1130. { determine the registers of the procedure variable }
  1131. { is this OK for inlined procs also ?? (PM) }
  1132. if assigned(p^.right) then
  1133. begin
  1134. p^.registersfpu:=max(p^.right^.registersfpu,p^.registersfpu);
  1135. p^.registers32:=max(p^.right^.registers32,p^.registers32);
  1136. {$ifdef SUPPORT_MMX}
  1137. p^.registersmmx:=max(p^.right^.registersmmx,p^.registersmmx);
  1138. {$endif SUPPORT_MMX}
  1139. end;
  1140. { determine the registers of the procedure }
  1141. if assigned(p^.left) then
  1142. begin
  1143. p^.registersfpu:=max(p^.left^.registersfpu,p^.registersfpu);
  1144. p^.registers32:=max(p^.left^.registers32,p^.registers32);
  1145. {$ifdef SUPPORT_MMX}
  1146. p^.registersmmx:=max(p^.left^.registersmmx,p^.registersmmx);
  1147. {$endif SUPPORT_MMX}
  1148. end;
  1149. errorexit:
  1150. { Reset some settings back }
  1151. if assigned(procs) then
  1152. dispose(procs);
  1153. if inlined then
  1154. {$ifdef INCLUDEOK}
  1155. include(p^.procdefinition^.proccalloptions,pocall_inline);
  1156. {$else}
  1157. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions+[pocall_inline];
  1158. {$endif}
  1159. aktcallprocsym:=oldcallprocsym;
  1160. end;
  1161. {*****************************************************************************
  1162. FirstProcInlineN
  1163. *****************************************************************************}
  1164. procedure firstprocinline(var p : ptree);
  1165. begin
  1166. { left contains the code in tree form }
  1167. { but it has already been firstpassed }
  1168. { so firstpass(p^.left); does not seem required }
  1169. { might be required later if we change the arg handling !! }
  1170. end;
  1171. end.
  1172. {
  1173. $Log$
  1174. Revision 1.82 2000-02-29 22:13:41 pierre
  1175. + use $GOTO ON
  1176. Revision 1.81 2000/02/24 18:41:39 peter
  1177. * removed warnings/notes
  1178. Revision 1.80 2000/02/17 14:53:43 florian
  1179. * some updates for the newcg
  1180. Revision 1.79 2000/02/09 13:23:07 peter
  1181. * log truncated
  1182. Revision 1.78 2000/01/07 09:35:12 pierre
  1183. * set_varstate must be called after typeconv insertions
  1184. Revision 1.77 2000/01/07 01:14:44 peter
  1185. * updated copyright to 2000
  1186. Revision 1.76 1999/12/19 15:13:56 peter
  1187. * constant array type conversion fixed
  1188. Revision 1.75 1999/12/09 23:18:04 pierre
  1189. * no_fast_exit if procedure contains implicit termination code
  1190. Revision 1.74 1999/11/30 10:40:57 peter
  1191. + ttype, tsymlist
  1192. Revision 1.73 1999/11/18 15:34:49 pierre
  1193. * Notes/Hints for local syms changed to
  1194. Set_varstate function
  1195. Revision 1.72 1999/11/17 17:05:07 pierre
  1196. * Notes/hints changes
  1197. Revision 1.71 1999/11/06 14:34:29 peter
  1198. * truncated log to 20 revs
  1199. Revision 1.70 1999/10/26 12:30:46 peter
  1200. * const parameter is now checked
  1201. * better and generic check if a node can be used for assigning
  1202. * export fixes
  1203. * procvar equal works now (it never had worked at least from 0.99.8)
  1204. * defcoll changed to linkedlist with pparaitem so it can easily be
  1205. walked both directions
  1206. Revision 1.69 1999/10/22 14:37:30 peter
  1207. * error when properties are passed to var parameters
  1208. Revision 1.68 1999/10/13 10:35:27 peter
  1209. * var must match exactly error msg extended with got and expected type
  1210. * array constructor type check now gives error on wrong types
  1211. Revision 1.67 1999/10/12 15:50:54 pierre
  1212. * error if calling interrupt procedure
  1213. Revision 1.66 1999/09/27 23:45:00 peter
  1214. * procinfo is now a pointer
  1215. * support for result setting in sub procedure
  1216. Revision 1.65 1999/09/16 23:05:56 florian
  1217. * m68k compiler is again compilable (only gas writer, no assembler reader)
  1218. Revision 1.64 1999/09/14 07:59:48 florian
  1219. * finally!? fixed
  1220. with <function with result in temp> do
  1221. My last and also Peter's fix before were wrong :(
  1222. Revision 1.63 1999/09/10 18:48:11 florian
  1223. * some bug fixes (e.g. must_be_valid and procinfo^.funcret_is_valid)
  1224. * most things for stored properties fixed
  1225. Revision 1.62 1999/08/23 23:42:52 pierre
  1226. * hnewn reg allocation corrected
  1227. Revision 1.61 1999/08/17 13:26:08 peter
  1228. * arrayconstructor -> arrayofconst fixed when arraycosntructor was not
  1229. variant.
  1230. Revision 1.60 1999/08/16 23:23:39 peter
  1231. * arrayconstructor -> openarray type conversions for element types
  1232. Revision 1.59 1999/08/13 21:33:16 peter
  1233. * support for array constructors extended and more error checking
  1234. }