tccal.pas 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423
  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. 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. p^.treetype:=loadn;
  564. p^.resulttype:=pprocsym(p^.symtableprocentry)^.definition;
  565. p^.symtableentry:=p^.symtableprocentry;
  566. p^.is_first:=false;
  567. p^.disposetyp:=dt_nothing;
  568. firstpass(p);
  569. end
  570. else
  571. begin
  572. if assigned(p^.left) then
  573. aktfilepos:=p^.left^.fileinfo;
  574. CGMessage(parser_e_wrong_parameter_size);
  575. aktcallprocsym^.write_parameter_lists;
  576. end;
  577. goto errorexit;
  578. end;
  579. { now we can compare parameter after parameter }
  580. pt:=p^.left;
  581. { we start with the last parameter }
  582. lastpara:=paralength+1;
  583. lastparatype:=nil;
  584. while assigned(pt) do
  585. begin
  586. dec(lastpara);
  587. { walk all procedures and determine how this parameter matches and set:
  588. 1. pt^.exact_match_found if one parameter has an exact match
  589. 2. exactmatch if an equal or exact match is found
  590. 3. para^.argconvtyp to exact,equal or convertable
  591. (when convertable then also convertlevel is set)
  592. 4. pt^.convlevel1found if there is a convertlevel=1
  593. 5. pt^.convlevel2found if there is a convertlevel=2
  594. }
  595. exactmatch:=false;
  596. hp:=procs;
  597. while assigned(hp) do
  598. begin
  599. if is_equal(pt,hp^.nextpara^.data) then
  600. begin
  601. if hp^.nextpara^.data=pt^.resulttype then
  602. begin
  603. pt^.exact_match_found:=true;
  604. hp^.nextpara^.argconvtyp:=act_exact;
  605. end
  606. else
  607. hp^.nextpara^.argconvtyp:=act_equal;
  608. exactmatch:=true;
  609. end
  610. else
  611. begin
  612. hp^.nextpara^.argconvtyp:=act_convertable;
  613. hp^.nextpara^.convertlevel:=isconvertable(pt^.resulttype,hp^.nextpara^.data,
  614. hcvt,pt^.left^.treetype,false);
  615. case hp^.nextpara^.convertlevel of
  616. 1 : pt^.convlevel1found:=true;
  617. 2 : pt^.convlevel2found:=true;
  618. end;
  619. end;
  620. hp:=hp^.next;
  621. end;
  622. { If there was an exactmatch then delete all convertables }
  623. if exactmatch then
  624. begin
  625. hp:=procs;
  626. procs:=nil;
  627. while assigned(hp) do
  628. begin
  629. hp2:=hp^.next;
  630. { keep if not convertable }
  631. if (hp^.nextpara^.argconvtyp<>act_convertable) then
  632. begin
  633. hp^.next:=procs;
  634. procs:=hp;
  635. end
  636. else
  637. dispose(hp);
  638. hp:=hp2;
  639. end;
  640. end
  641. else
  642. { No exact match was found, remove all procedures that are
  643. not convertable (convertlevel=0) }
  644. begin
  645. hp:=procs;
  646. procs:=nil;
  647. while assigned(hp) do
  648. begin
  649. hp2:=hp^.next;
  650. { keep if not convertable }
  651. if (hp^.nextpara^.convertlevel<>0) then
  652. begin
  653. hp^.next:=procs;
  654. procs:=hp;
  655. end
  656. else
  657. begin
  658. { save the type for nice error message }
  659. lastparatype:=hp^.nextpara^.data;
  660. dispose(hp);
  661. end;
  662. hp:=hp2;
  663. end;
  664. end;
  665. { update nextpara for all procedures }
  666. hp:=procs;
  667. while assigned(hp) do
  668. begin
  669. hp^.nextpara:=hp^.nextpara^.next;
  670. hp:=hp^.next;
  671. end;
  672. { load next parameter or quit loop if no procs left }
  673. if assigned(procs) then
  674. pt:=pt^.right
  675. else
  676. break;
  677. end;
  678. { All parameters are checked, check if there are any
  679. procedures left }
  680. if not assigned(procs) then
  681. begin
  682. { there is an error, must be wrong type, because
  683. wrong size is already checked (PFV) }
  684. if (not assigned(lastparatype)) or
  685. (not assigned(pt)) or
  686. (not assigned(pt^.resulttype)) then
  687. internalerror(39393)
  688. else
  689. begin
  690. aktfilepos:=pt^.fileinfo;
  691. CGMessage3(type_e_wrong_parameter_type,tostr(lastpara),
  692. pt^.resulttype^.typename,lastparatype^.typename);
  693. end;
  694. aktcallprocsym^.write_parameter_lists;
  695. goto errorexit;
  696. end;
  697. { if there are several choices left then for orddef }
  698. { if a type is totally included in the other }
  699. { we don't fear an overflow , }
  700. { so we can do as if it is an exact match }
  701. { this will convert integer to longint }
  702. { rather than to words }
  703. { conversion of byte to integer or longint }
  704. {would still not be solved }
  705. if assigned(procs) and assigned(procs^.next) then
  706. begin
  707. hp:=procs;
  708. while assigned(hp) do
  709. begin
  710. hp^.nextpara:=hp^.firstpara;
  711. hp:=hp^.next;
  712. end;
  713. pt:=p^.left;
  714. while assigned(pt) do
  715. begin
  716. { matches a parameter of one procedure exact ? }
  717. exactmatch:=false;
  718. def_from:=pt^.resulttype;
  719. hp:=procs;
  720. while assigned(hp) do
  721. begin
  722. if not is_equal(pt,hp^.nextpara^.data) then
  723. begin
  724. def_to:=hp^.nextpara^.data;
  725. if ((def_from^.deftype=orddef) and (def_to^.deftype=orddef)) and
  726. (is_in_limit(def_from,def_to) or
  727. ((hp^.nextpara^.paratyp=vs_var) and
  728. (def_from^.size=def_to^.size))) then
  729. begin
  730. exactmatch:=true;
  731. conv_to:=def_to;
  732. end;
  733. end;
  734. hp:=hp^.next;
  735. end;
  736. { .... if yes, del all the other procedures }
  737. if exactmatch then
  738. begin
  739. { the first .... }
  740. while (assigned(procs)) and not(is_in_limit(def_from,procs^.nextpara^.data)) do
  741. begin
  742. hp:=procs^.next;
  743. dispose(procs);
  744. procs:=hp;
  745. end;
  746. { and the others }
  747. hp:=procs;
  748. while (assigned(hp)) and assigned(hp^.next) do
  749. begin
  750. if not(is_in_limit(def_from,hp^.next^.nextpara^.data)) then
  751. begin
  752. hp2:=hp^.next^.next;
  753. dispose(hp^.next);
  754. hp^.next:=hp2;
  755. end
  756. else
  757. begin
  758. def_to:=hp^.next^.nextpara^.data;
  759. if (conv_to^.size>def_to^.size) or
  760. ((porddef(conv_to)^.low<porddef(def_to)^.low) and
  761. (porddef(conv_to)^.high>porddef(def_to)^.high)) then
  762. begin
  763. hp2:=procs;
  764. procs:=hp;
  765. conv_to:=def_to;
  766. dispose(hp2);
  767. end
  768. else
  769. hp:=hp^.next;
  770. end;
  771. end;
  772. end;
  773. { update nextpara for all procedures }
  774. hp:=procs;
  775. while assigned(hp) do
  776. begin
  777. hp^.nextpara:=hp^.nextpara^.next;
  778. hp:=hp^.next;
  779. end;
  780. pt:=pt^.right;
  781. end;
  782. end;
  783. { let's try to eliminate equal if there is an exact match
  784. is there }
  785. if assigned(procs) and assigned(procs^.next) then
  786. begin
  787. { reset nextpara for all procs left }
  788. hp:=procs;
  789. while assigned(hp) do
  790. begin
  791. hp^.nextpara:=hp^.firstpara;
  792. hp:=hp^.next;
  793. end;
  794. pt:=p^.left;
  795. while assigned(pt) do
  796. begin
  797. if pt^.exact_match_found then
  798. begin
  799. hp:=procs;
  800. procs:=nil;
  801. while assigned(hp) do
  802. begin
  803. hp2:=hp^.next;
  804. { keep the exact matches, dispose the others }
  805. if (hp^.nextpara^.argconvtyp=act_exact) then
  806. begin
  807. hp^.next:=procs;
  808. procs:=hp;
  809. end
  810. else
  811. dispose(hp);
  812. hp:=hp2;
  813. end;
  814. end;
  815. { update nextpara for all procedures }
  816. hp:=procs;
  817. while assigned(hp) do
  818. begin
  819. hp^.nextpara:=hp^.nextpara^.next;
  820. hp:=hp^.next;
  821. end;
  822. pt:=pt^.right;
  823. end;
  824. end;
  825. { Check if there are convertlevel 1 and 2 differences
  826. left for the parameters, then discard all convertlevel
  827. 2 procedures. The value of convlevelXfound can still
  828. be used, because all convertables are still here or
  829. not }
  830. if assigned(procs) and assigned(procs^.next) then
  831. begin
  832. { reset nextpara for all procs left }
  833. hp:=procs;
  834. while assigned(hp) do
  835. begin
  836. hp^.nextpara:=hp^.firstpara;
  837. hp:=hp^.next;
  838. end;
  839. pt:=p^.left;
  840. while assigned(pt) do
  841. begin
  842. if pt^.convlevel1found and pt^.convlevel2found then
  843. begin
  844. hp:=procs;
  845. procs:=nil;
  846. while assigned(hp) do
  847. begin
  848. hp2:=hp^.next;
  849. { keep all not act_convertable and all convertlevels=1 }
  850. if (hp^.nextpara^.argconvtyp<>act_convertable) or
  851. (hp^.nextpara^.convertlevel=1) then
  852. begin
  853. hp^.next:=procs;
  854. procs:=hp;
  855. end
  856. else
  857. dispose(hp);
  858. hp:=hp2;
  859. end;
  860. end;
  861. { update nextpara for all procedures }
  862. hp:=procs;
  863. while assigned(hp) do
  864. begin
  865. hp^.nextpara:=hp^.nextpara^.next;
  866. hp:=hp^.next;
  867. end;
  868. pt:=pt^.right;
  869. end;
  870. end;
  871. if not(assigned(procs)) or assigned(procs^.next) then
  872. begin
  873. CGMessage(cg_e_cant_choose_overload_function);
  874. aktcallprocsym^.write_parameter_lists;
  875. goto errorexit;
  876. end;
  877. {$ifdef TEST_PROCSYMS}
  878. if (procs=nil) and assigned(nextprocsym) then
  879. begin
  880. p^.symtableprocentry:=nextprocsym;
  881. p^.symtableproc:=symt;
  882. end;
  883. end ; { of while assigned(p^.symtableprocentry) do }
  884. {$endif TEST_PROCSYMS}
  885. if make_ref then
  886. begin
  887. procs^.data^.lastref:=new(pref,init(procs^.data^.lastref,@p^.fileinfo));
  888. inc(procs^.data^.refcount);
  889. if procs^.data^.defref=nil then
  890. procs^.data^.defref:=procs^.data^.lastref;
  891. end;
  892. p^.procdefinition:=procs^.data;
  893. p^.resulttype:=procs^.data^.retdef;
  894. { big error for with statements
  895. p^.symtableproc:=p^.procdefinition^.owner;
  896. but neede for overloaded operators !! }
  897. if p^.symtableproc=nil then
  898. p^.symtableproc:=p^.procdefinition^.owner;
  899. p^.location.loc:=LOC_MEM;
  900. {$ifdef CHAINPROCSYMS}
  901. { object with method read;
  902. call to read(x) will be a usual procedure call }
  903. if assigned(p^.methodpointer) and
  904. (p^.procdefinition^._class=nil) then
  905. begin
  906. { not ok for extended }
  907. case p^.methodpointer^.treetype of
  908. typen,hnewn : fatalerror(no_para_match);
  909. end;
  910. disposetree(p^.methodpointer);
  911. p^.methodpointer:=nil;
  912. end;
  913. {$endif CHAINPROCSYMS}
  914. end; { end of procedure to call determination }
  915. is_const:=(pocall_internconst in p^.procdefinition^.proccalloptions) and
  916. ((block_type=bt_const) or
  917. (assigned(p^.left) and (p^.left^.left^.treetype in [realconstn,ordconstn])));
  918. { handle predefined procedures }
  919. if (pocall_internproc in p^.procdefinition^.proccalloptions) or is_const then
  920. begin
  921. if assigned(p^.left) then
  922. begin
  923. { settextbuf needs two args }
  924. if assigned(p^.left^.right) then
  925. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,p^.left)
  926. else
  927. begin
  928. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,p^.left^.left);
  929. putnode(p^.left);
  930. end;
  931. end
  932. else
  933. begin
  934. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,nil);
  935. end;
  936. putnode(p);
  937. firstpass(pt);
  938. p:=pt;
  939. goto errorexit;
  940. end
  941. else
  942. { no intern procedure => we do a call }
  943. { calc the correture value for the register }
  944. { handle predefined procedures }
  945. if (pocall_inline in p^.procdefinition^.proccalloptions) then
  946. begin
  947. if assigned(p^.methodpointer) then
  948. CGMessage(cg_e_unable_inline_object_methods);
  949. if assigned(p^.right) and (p^.right^.treetype<>procinlinen) then
  950. CGMessage(cg_e_unable_inline_procvar);
  951. { p^.treetype:=procinlinen; }
  952. if not assigned(p^.right) then
  953. begin
  954. if assigned(pprocdef(p^.procdefinition)^.code) then
  955. inlinecode:=genprocinlinenode(p,ptree(pprocdef(p^.procdefinition)^.code))
  956. else
  957. CGMessage(cg_e_no_code_for_inline_stored);
  958. if assigned(inlinecode) then
  959. begin
  960. { consider it has not inlined if called
  961. again inside the args }
  962. {$ifdef INCLUDEOK}
  963. exclude(p^.procdefinition^.proccalloptions,pocall_inline);
  964. {$else}
  965. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
  966. {$endif}
  967. firstpass(inlinecode);
  968. inlined:=true;
  969. end;
  970. end;
  971. end
  972. else
  973. procinfo.flags:=procinfo.flags or pi_do_call;
  974. { work trough all parameters to insert the type conversions }
  975. { !!! done now after internproc !! (PM) }
  976. if assigned(p^.left) then
  977. begin
  978. old_count_ref:=count_ref;
  979. count_ref:=true;
  980. firstcallparan(p^.left,p^.procdefinition^.para1);
  981. count_ref:=old_count_ref;
  982. end;
  983. {$ifdef i386}
  984. for regi:=R_EAX to R_EDI do
  985. begin
  986. if (pprocdef(p^.procdefinition)^.usedregisters and ($80 shr word(regi)))<>0 then
  987. inc(reg_pushes[regi],t_times*2);
  988. end;
  989. {$endif}
  990. {$ifdef m68k}
  991. for regi:=R_D0 to R_A6 do
  992. begin
  993. if (pprocdef(p^.procdefinition)^.usedregisters and ($800 shr word(regi)))<>0 then
  994. inc(reg_pushes[regi],t_times*2);
  995. end;
  996. {$endif}
  997. end;
  998. { ensure that the result type is set }
  999. p^.resulttype:=p^.procdefinition^.retdef;
  1000. { get a register for the return value }
  1001. if (p^.resulttype<>pdef(voiddef)) then
  1002. begin
  1003. if (p^.procdefinition^.proctypeoption=potype_constructor) then
  1004. begin
  1005. { extra handling of classes }
  1006. { p^.methodpointer should be assigned! }
  1007. if assigned(p^.methodpointer) and assigned(p^.methodpointer^.resulttype) and
  1008. (p^.methodpointer^.resulttype^.deftype=classrefdef) then
  1009. begin
  1010. p^.location.loc:=LOC_REGISTER;
  1011. p^.registers32:=1;
  1012. { the result type depends on the classref }
  1013. p^.resulttype:=pclassrefdef(p^.methodpointer^.resulttype)^.definition;
  1014. end
  1015. { a object constructor returns the result with the flags }
  1016. else
  1017. p^.location.loc:=LOC_FLAGS;
  1018. end
  1019. else
  1020. begin
  1021. {$ifdef SUPPORT_MMX}
  1022. if (cs_mmx in aktlocalswitches) and
  1023. is_mmx_able_array(p^.resulttype) then
  1024. begin
  1025. p^.location.loc:=LOC_MMXREGISTER;
  1026. p^.registersmmx:=1;
  1027. end
  1028. else
  1029. {$endif SUPPORT_MMX}
  1030. if ret_in_acc(p^.resulttype) then
  1031. begin
  1032. p^.location.loc:=LOC_REGISTER;
  1033. if is_64bitint(p^.resulttype) then
  1034. p^.registers32:=2
  1035. else
  1036. p^.registers32:=1;
  1037. { wide- and ansistrings are returned in EAX }
  1038. { but they are imm. moved to a memory location }
  1039. if is_widestring(p^.resulttype) or
  1040. is_ansistring(p^.resulttype) then
  1041. begin
  1042. p^.location.loc:=LOC_MEM;
  1043. p^.registers32:=0;
  1044. end;
  1045. end
  1046. else if (p^.resulttype^.deftype=floatdef) then
  1047. begin
  1048. p^.location.loc:=LOC_FPU;
  1049. p^.registersfpu:=1;
  1050. end
  1051. end;
  1052. end;
  1053. { a fpu can be used in any procedure !! }
  1054. p^.registersfpu:=p^.procdefinition^.fpu_used;
  1055. { if this is a call to a method calc the registers }
  1056. if (p^.methodpointer<>nil) then
  1057. begin
  1058. case p^.methodpointer^.treetype of
  1059. { but only, if this is not a supporting node }
  1060. typen,hnewn : ;
  1061. else
  1062. begin
  1063. if (p^.procdefinition^.proctypeoption in [potype_constructor,potype_destructor]) and
  1064. assigned(p^.symtable) and (p^.symtable^.symtabletype=withsymtable) and
  1065. not pwithsymtable(p^.symtable)^.direct_with then
  1066. begin
  1067. CGmessage(cg_e_cannot_call_cons_dest_inside_with);
  1068. end; { Is accepted by Delphi !! }
  1069. { this is not a good reason to accept it in FPC if we produce
  1070. wrong code for it !!! (PM) }
  1071. { R.Assign is not a constructor !!! }
  1072. { but for R^.Assign, R must be valid !! }
  1073. if (p^.procdefinition^.proctypeoption=potype_constructor) or
  1074. ((p^.methodpointer^.treetype=loadn) and
  1075. (not(oo_has_virtual in pobjectdef(p^.methodpointer^.resulttype)^.objectoptions))) then
  1076. must_be_valid:=false
  1077. else
  1078. must_be_valid:=true;
  1079. firstpass(p^.methodpointer);
  1080. p^.registersfpu:=max(p^.methodpointer^.registersfpu,p^.registersfpu);
  1081. p^.registers32:=max(p^.methodpointer^.registers32,p^.registers32);
  1082. {$ifdef SUPPORT_MMX}
  1083. p^.registersmmx:=max(p^.methodpointer^.registersmmx,p^.registersmmx);
  1084. {$endif SUPPORT_MMX}
  1085. end;
  1086. end;
  1087. end;
  1088. if inlined then
  1089. p^.right:=inlinecode;
  1090. { determine the registers of the procedure variable }
  1091. { is this OK for inlined procs also ?? (PM) }
  1092. if assigned(p^.right) then
  1093. begin
  1094. p^.registersfpu:=max(p^.right^.registersfpu,p^.registersfpu);
  1095. p^.registers32:=max(p^.right^.registers32,p^.registers32);
  1096. {$ifdef SUPPORT_MMX}
  1097. p^.registersmmx:=max(p^.right^.registersmmx,p^.registersmmx);
  1098. {$endif SUPPORT_MMX}
  1099. end;
  1100. { determine the registers of the procedure }
  1101. if assigned(p^.left) then
  1102. begin
  1103. p^.registersfpu:=max(p^.left^.registersfpu,p^.registersfpu);
  1104. p^.registers32:=max(p^.left^.registers32,p^.registers32);
  1105. {$ifdef SUPPORT_MMX}
  1106. p^.registersmmx:=max(p^.left^.registersmmx,p^.registersmmx);
  1107. {$endif SUPPORT_MMX}
  1108. end;
  1109. errorexit:
  1110. { Reset some settings back }
  1111. if assigned(procs) then
  1112. dispose(procs);
  1113. if inlined then
  1114. {$ifdef INCLUDEOK}
  1115. include(p^.procdefinition^.proccalloptions,pocall_inline);
  1116. {$else}
  1117. p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions+[pocall_inline];
  1118. {$endif}
  1119. aktcallprocsym:=oldcallprocsym;
  1120. must_be_valid:=store_valid;
  1121. end;
  1122. {*****************************************************************************
  1123. FirstProcInlineN
  1124. *****************************************************************************}
  1125. procedure firstprocinline(var p : ptree);
  1126. begin
  1127. { left contains the code in tree form }
  1128. { but it has already been firstpassed }
  1129. { so firstpass(p^.left); does not seem required }
  1130. { might be required later if we change the arg handling !! }
  1131. end;
  1132. end.
  1133. {
  1134. $Log$
  1135. Revision 1.57 1999-08-05 16:53:19 peter
  1136. * V_Fatal=1, all other V_ are also increased
  1137. * Check for local procedure when assigning procvar
  1138. * fixed comment parsing because directives
  1139. * oldtp mode directives better supported
  1140. * added some messages to errore.msg
  1141. Revision 1.56 1999/08/04 00:23:34 florian
  1142. * renamed i386asm and i386base to cpuasm and cpubase
  1143. Revision 1.55 1999/08/03 22:03:27 peter
  1144. * moved bitmask constants to sets
  1145. * some other type/const renamings
  1146. Revision 1.54 1999/07/01 21:33:58 peter
  1147. * merged
  1148. Revision 1.53 1999/06/29 14:02:33 peter
  1149. * merged file pos fixes
  1150. Revision 1.52 1999/06/29 12:16:22 pierre
  1151. * mereg from fixes-0_99_12
  1152. Revision 1.51.2.3 1999/07/01 21:32:01 peter
  1153. * procvar fixes again
  1154. Revision 1.51.2.2 1999/06/29 12:12:13 pierre
  1155. * fix for bug0272
  1156. Revision 1.51.2.1 1999/06/28 00:33:47 pierre
  1157. * better error position bug0269
  1158. Revision 1.51 1999/06/01 19:27:57 peter
  1159. * better checks for procvar and methodpointer
  1160. Revision 1.50 1999/06/01 14:46:00 peter
  1161. * @procvar is now always needed for FPC
  1162. Revision 1.49 1999/05/31 20:34:51 peter
  1163. * fixed hightree generation when loading highSYM
  1164. Revision 1.48 1999/05/27 19:45:13 peter
  1165. * removed oldasm
  1166. * plabel -> pasmlabel
  1167. * -a switches to source writing automaticly
  1168. * assembler readers OOPed
  1169. * asmsymbol automaticly external
  1170. * jumptables and other label fixes for asm readers
  1171. Revision 1.47 1999/05/23 18:42:19 florian
  1172. * better error recovering in typed constants
  1173. * some problems with arrays of const fixed, some problems
  1174. due my previous
  1175. - the location type of array constructor is now LOC_MEM
  1176. - the pushing of high fixed
  1177. - parameter copying fixed
  1178. - zero temp. allocation removed
  1179. * small problem in the assembler writers fixed:
  1180. ref to nil wasn't written correctly
  1181. Revision 1.46 1999/05/20 14:58:27 peter
  1182. * fixed arrayconstruct->set conversion which didn't work for enum sets
  1183. Revision 1.45 1999/05/19 10:31:54 florian
  1184. * two bugs reported by Romio (bugs 13) are fixed:
  1185. - empty array constructors are now handled correctly (e.g. for sysutils.format)
  1186. - comparsion of ansistrings was sometimes coded wrong
  1187. Revision 1.44 1999/05/18 21:58:33 florian
  1188. * fixed some bugs related to temp. ansistrings and functions results
  1189. which return records/objects/arrays which need init/final.
  1190. Revision 1.43 1999/05/18 14:15:58 peter
  1191. * containsself fixes
  1192. * checktypes()
  1193. Revision 1.42 1999/05/17 23:51:43 peter
  1194. * with temp vars now use a reference with a persistant temp instead
  1195. of setting datasize
  1196. Revision 1.41 1999/05/13 21:59:50 peter
  1197. * removed oldppu code
  1198. * warning if objpas is loaded from uses
  1199. * first things for new deref writing
  1200. Revision 1.40 1999/05/10 09:01:45 peter
  1201. * small message fixes
  1202. Revision 1.39 1999/05/02 09:35:46 florian
  1203. + method message handlers which contain an explicit self can't be called
  1204. directly anymore
  1205. + self is now loaded at the start of the an message handler with an explicit
  1206. self
  1207. + $useoverlay fixed: i386 was renamed to i386base
  1208. Revision 1.38 1999/05/01 13:24:47 peter
  1209. * merged nasm compiler
  1210. * old asm moved to oldasm/
  1211. Revision 1.37 1999/04/26 13:31:57 peter
  1212. * release storenumber,double_checksum
  1213. Revision 1.36 1999/04/26 09:30:46 peter
  1214. * small tp7 fix
  1215. * fix void pointer with formaldef
  1216. Revision 1.35 1999/04/21 21:49:18 pierre
  1217. * previous log corrected
  1218. Revision 1.34 1999/04/21 16:31:46 pierre
  1219. * checks for untyped var or const args
  1220. (refuse procsyms as var, types or voiddef as const)
  1221. Revision 1.33 1999/04/21 09:44:00 peter
  1222. * storenumber works
  1223. * fixed some typos in double_checksum
  1224. + incompatible types type1 and type2 message (with storenumber)
  1225. Revision 1.32 1999/04/14 09:11:22 peter
  1226. * fixed tp proc -> procvar
  1227. Revision 1.31 1999/04/01 21:59:56 peter
  1228. * type error for array constructor with array,record as argument
  1229. Revision 1.30 1999/03/31 13:55:27 peter
  1230. * assembler inlining working for ag386bin
  1231. Revision 1.29 1999/03/24 23:17:34 peter
  1232. * fixed bugs 212,222,225,227,229,231,233
  1233. Revision 1.28 1999/03/23 14:43:03 peter
  1234. * fixed crash with array of const in procvar
  1235. Revision 1.27 1999/03/19 17:31:54 pierre
  1236. * lost reference because refcount not increased fixed
  1237. Revision 1.26 1999/03/02 18:24:22 peter
  1238. * fixed overloading of array of char
  1239. Revision 1.25 1999/02/22 15:09:44 florian
  1240. * behaviaor of PROTECTED and PRIVATE fixed, works now like TP/Delphi
  1241. Revision 1.24 1999/02/22 02:15:45 peter
  1242. * updates for ag386bin
  1243. Revision 1.23 1999/02/09 17:15:52 florian
  1244. * some false warnings "function result doesn't seems to be set" are
  1245. avoided
  1246. Revision 1.22 1999/01/29 11:34:55 pierre
  1247. + better info for impossible type conversion in calln
  1248. Revision 1.21 1999/01/21 22:10:49 peter
  1249. * fixed array of const
  1250. * generic platform independent high() support
  1251. Revision 1.20 1999/01/21 16:41:06 pierre
  1252. * fix for constructor inside with statements
  1253. Revision 1.19 1999/01/19 14:20:16 peter
  1254. * fixed [char] crash
  1255. Revision 1.18 1999/01/12 14:25:40 peter
  1256. + BrowserLog for browser.log generation
  1257. + BrowserCol for browser info in TCollections
  1258. * released all other UseBrowser
  1259. Revision 1.17 1998/12/11 00:03:52 peter
  1260. + globtype,tokens,version unit splitted from globals
  1261. Revision 1.16 1998/12/10 14:57:52 pierre
  1262. * fix for operators
  1263. Revision 1.15 1998/12/10 09:47:32 florian
  1264. + basic operations with int64/qord (compiler with -dint64)
  1265. + rtti of enumerations extended: names are now written
  1266. Revision 1.14 1998/11/27 14:50:52 peter
  1267. + open strings, $P switch support
  1268. Revision 1.13 1998/11/24 17:03:51 peter
  1269. * fixed exactmatch removings
  1270. Revision 1.12 1998/11/16 10:18:10 peter
  1271. * fixes for ansistrings
  1272. Revision 1.11 1998/11/10 10:09:17 peter
  1273. * va_list -> array of const
  1274. Revision 1.10 1998/11/09 11:44:41 peter
  1275. + va_list for printf support
  1276. Revision 1.9 1998/10/28 18:26:22 pierre
  1277. * removed some erros after other errors (introduced by useexcept)
  1278. * stabs works again correctly (for how long !)
  1279. Revision 1.8 1998/10/09 16:36:09 pierre
  1280. * some memory leaks specific to usebrowser define fixed
  1281. * removed tmodule.implsymtable (was like tmodule.localsymtable)
  1282. Revision 1.7 1998/10/06 20:49:09 peter
  1283. * m68k compiler compiles again
  1284. Revision 1.6 1998/10/02 09:24:22 peter
  1285. * more constant expression evaluators
  1286. Revision 1.5 1998/09/28 11:22:17 pierre
  1287. * did not compile for browser
  1288. * merge from fixes
  1289. Revision 1.4 1998/09/27 10:16:24 florian
  1290. * type casts pchar<->ansistring fixed
  1291. * ansistring[..] calls does now an unique call
  1292. Revision 1.3 1998/09/24 14:27:40 peter
  1293. * some better support for openarray
  1294. Revision 1.2 1998/09/24 09:02:16 peter
  1295. * rewritten isconvertable to use case
  1296. * array of .. and single variable are compatible
  1297. Revision 1.1 1998/09/23 20:42:24 peter
  1298. * splitted pass_1
  1299. }