tccal.pas 56 KB

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