tccal.pas 57 KB

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