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