tccal.pas 60 KB

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