tccal.pas 56 KB

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