tccal.pas 56 KB

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