tccal.pas 55 KB

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