tccal.pas 58 KB

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