tccal.pas 56 KB

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