tccal.pas 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 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. {$ifdef FPC}
  19. {$goto on}
  20. {$endif FPC}
  21. unit tccal;
  22. interface
  23. uses
  24. symtable,tree;
  25. procedure gen_high_tree(p:ptree;openstring:boolean);
  26. procedure firstcallparan(var p : ptree;defcoll : pparaitem;do_count : boolean);
  27. procedure firstcalln(var p : ptree);
  28. procedure firstprocinline(var p : ptree);
  29. implementation
  30. uses
  31. globtype,systems,
  32. cobjects,verbose,globals,
  33. symconst,aasm,types,
  34. htypechk,pass_1,cpubase
  35. {$ifdef newcg}
  36. ,cgbase
  37. ,tgobj
  38. {$else newcg}
  39. ,hcodegen
  40. {$ifdef i386}
  41. ,tgeni386
  42. {$endif}
  43. {$ifdef m68k}
  44. ,tgen68k
  45. {$endif m68k}
  46. {$endif newcg}
  47. ;
  48. {*****************************************************************************
  49. FirstCallParaN
  50. *****************************************************************************}
  51. procedure gen_high_tree(p:ptree;openstring:boolean);
  52. var
  53. len : longint;
  54. st : psymtable;
  55. loadconst : boolean;
  56. begin
  57. if assigned(p^.hightree) then
  58. exit;
  59. len:=-1;
  60. loadconst:=true;
  61. case p^.left^.resulttype^.deftype of
  62. arraydef :
  63. begin
  64. if is_open_array(p^.left^.resulttype) or
  65. is_array_of_const(p^.left^.resulttype) then
  66. begin
  67. st:=p^.left^.symtable;
  68. getsymonlyin(st,'high'+pvarsym(p^.left^.symtableentry)^.name);
  69. p^.hightree:=genloadnode(pvarsym(srsym),st);
  70. loadconst:=false;
  71. end
  72. else
  73. begin
  74. { this is an empty constructor }
  75. len:=parraydef(p^.left^.resulttype)^.highrange-
  76. parraydef(p^.left^.resulttype)^.lowrange;
  77. end;
  78. end;
  79. stringdef :
  80. begin
  81. if openstring then
  82. begin
  83. if is_open_string(p^.left^.resulttype) then
  84. begin
  85. st:=p^.left^.symtable;
  86. getsymonlyin(st,'high'+pvarsym(p^.left^.symtableentry)^.name);
  87. p^.hightree:=genloadnode(pvarsym(srsym),st);
  88. loadconst:=false;
  89. end
  90. else
  91. len:=pstringdef(p^.left^.resulttype)^.len;
  92. end
  93. else
  94. { passing a string to an array of char }
  95. begin
  96. if (p^.left^.treetype=stringconstn) then
  97. begin
  98. len:=str_length(p^.left);
  99. if len>0 then
  100. dec(len);
  101. end
  102. else
  103. begin
  104. p^.hightree:=gennode(subn,geninlinenode(in_length_string,false,getcopy(p^.left)),
  105. genordinalconstnode(1,s32bitdef));
  106. firstpass(p^.hightree);
  107. p^.hightree:=gentypeconvnode(p^.hightree,s32bitdef);
  108. loadconst:=false;
  109. end;
  110. end;
  111. end;
  112. else
  113. len:=0;
  114. end;
  115. if loadconst then
  116. p^.hightree:=genordinalconstnode(len,s32bitdef);
  117. firstpass(p^.hightree);
  118. end;
  119. procedure firstcallparan(var p : ptree;defcoll : pparaitem;do_count : boolean);
  120. var
  121. old_get_para_resulttype : boolean;
  122. old_array_constructor : boolean;
  123. oldtype : pdef;
  124. {$ifdef extdebug}
  125. store_count_ref : boolean;
  126. {$endif def extdebug}
  127. {convtyp : tconverttype;}
  128. begin
  129. inc(parsing_para_level);
  130. {$ifdef extdebug}
  131. if do_count then
  132. begin
  133. store_count_ref:=count_ref;
  134. count_ref:=true;
  135. end;
  136. {$endif def extdebug}
  137. if assigned(p^.right) then
  138. begin
  139. if defcoll=nil then
  140. firstcallparan(p^.right,nil,do_count)
  141. else
  142. firstcallparan(p^.right,pparaitem(defcoll^.next),do_count);
  143. p^.registers32:=p^.right^.registers32;
  144. p^.registersfpu:=p^.right^.registersfpu;
  145. {$ifdef SUPPORT_MMX}
  146. p^.registersmmx:=p^.right^.registersmmx;
  147. {$endif}
  148. end;
  149. if defcoll=nil then
  150. begin
  151. old_array_constructor:=allow_array_constructor;
  152. old_get_para_resulttype:=get_para_resulttype;
  153. get_para_resulttype:=true;
  154. allow_array_constructor:=true;
  155. firstpass(p^.left);
  156. get_para_resulttype:=old_get_para_resulttype;
  157. allow_array_constructor:=old_array_constructor;
  158. if codegenerror then
  159. begin
  160. dec(parsing_para_level);
  161. exit;
  162. end;
  163. p^.resulttype:=p^.left^.resulttype;
  164. end
  165. { if we know the routine which is called, then the type }
  166. { conversions are inserted }
  167. else
  168. begin
  169. { Do we need arrayconstructor -> set conversion, then insert
  170. it here before the arrayconstructor node breaks the tree
  171. with its conversions of enum->ord }
  172. if (p^.left^.treetype=arrayconstructn) and
  173. (defcoll^.paratype.def^.deftype=setdef) then
  174. p^.left:=gentypeconvnode(p^.left,defcoll^.paratype.def);
  175. { set some settings needed for arrayconstructor }
  176. if is_array_constructor(p^.left^.resulttype) then
  177. begin
  178. if is_array_of_const(defcoll^.paratype.def) then
  179. begin
  180. if assigned(aktcallprocsym) and
  181. (pocall_cdecl in aktcallprocsym^.definition^.proccalloptions) and
  182. (po_external in aktcallprocsym^.definition^.procoptions) then
  183. p^.left^.cargs:=true;
  184. { force variant array }
  185. p^.left^.forcevaria:=true;
  186. end
  187. else
  188. begin
  189. p^.left^.novariaallowed:=true;
  190. p^.left^.constructdef:=parraydef(defcoll^.paratype.def)^.elementtype.def;
  191. end;
  192. end;
  193. if do_count then
  194. begin
  195. { not completly proper, but avoids some warnings }
  196. if (defcoll^.paratyp=vs_var) then
  197. set_funcret_is_valid(p^.left);
  198. { protected has nothing to do with read/write
  199. if (defcoll^.paratyp=vs_var) then
  200. test_protected(p^.left);
  201. }
  202. { set_varstate(p^.left,defcoll^.paratyp<>vs_var);
  203. must only be done after typeconv PM }
  204. { only process typeconvn and arrayconstructn, else it will
  205. break other trees }
  206. { But this is need to get correct varstate !! PM }
  207. old_array_constructor:=allow_array_constructor;
  208. old_get_para_resulttype:=get_para_resulttype;
  209. allow_array_constructor:=true;
  210. get_para_resulttype:=false;
  211. if (p^.left^.treetype in [arrayconstructn,typeconvn]) then
  212. firstpass(p^.left);
  213. if not assigned(p^.resulttype) then
  214. p^.resulttype:=p^.left^.resulttype;
  215. get_para_resulttype:=old_get_para_resulttype;
  216. allow_array_constructor:=old_array_constructor;
  217. end;
  218. { check if local proc/func is assigned to procvar }
  219. if p^.left^.resulttype^.deftype=procvardef then
  220. test_local_to_procvar(pprocvardef(p^.left^.resulttype),defcoll^.paratype.def);
  221. { property is not allowed as var parameter }
  222. if (defcoll^.paratyp in [vs_out,vs_var]) and
  223. (p^.left^.isproperty) then
  224. CGMessagePos(p^.left^.fileinfo,type_e_argument_cant_be_assigned);
  225. { generate the high() value tree }
  226. if push_high_param(defcoll^.paratype.def) then
  227. gen_high_tree(p,is_open_string(defcoll^.paratype.def));
  228. if not(is_shortstring(p^.left^.resulttype) and
  229. is_shortstring(defcoll^.paratype.def)) and
  230. (defcoll^.paratype.def^.deftype<>formaldef) then
  231. begin
  232. if (defcoll^.paratyp in [vs_var,vs_out]) and
  233. { allows conversion from word to integer and
  234. byte to shortint }
  235. (not(
  236. (p^.left^.resulttype^.deftype=orddef) and
  237. (defcoll^.paratype.def^.deftype=orddef) and
  238. (p^.left^.resulttype^.size=defcoll^.paratype.def^.size)
  239. ) and
  240. { an implicit pointer conversion is allowed }
  241. not(
  242. (p^.left^.resulttype^.deftype=pointerdef) and
  243. (defcoll^.paratype.def^.deftype=pointerdef)
  244. ) and
  245. { child classes can be also passed }
  246. not(
  247. (p^.left^.resulttype^.deftype=objectdef) and
  248. (defcoll^.paratype.def^.deftype=objectdef) and
  249. pobjectdef(p^.left^.resulttype)^.is_related(pobjectdef(defcoll^.paratype.def))
  250. ) and
  251. { passing a single element to a openarray of the same type }
  252. not(
  253. (is_open_array(defcoll^.paratype.def) and
  254. is_equal(parraydef(defcoll^.paratype.def)^.elementtype.def,p^.left^.resulttype))
  255. ) and
  256. { an implicit file conversion is also allowed }
  257. { from a typed file to an untyped one }
  258. not(
  259. (p^.left^.resulttype^.deftype=filedef) and
  260. (defcoll^.paratype.def^.deftype=filedef) and
  261. (pfiledef(defcoll^.paratype.def)^.filetyp = ft_untyped) and
  262. (pfiledef(p^.left^.resulttype)^.filetyp = ft_typed)
  263. ) and
  264. not(is_equal(p^.left^.resulttype,defcoll^.paratype.def))) then
  265. begin
  266. CGMessagePos2(p^.left^.fileinfo,parser_e_call_by_ref_without_typeconv,
  267. p^.left^.resulttype^.typename,defcoll^.paratype.def^.typename);
  268. end;
  269. { Process open parameters }
  270. if push_high_param(defcoll^.paratype.def) then
  271. begin
  272. { insert type conv but hold the ranges of the array }
  273. oldtype:=p^.left^.resulttype;
  274. p^.left:=gentypeconvnode(p^.left,defcoll^.paratype.def);
  275. firstpass(p^.left);
  276. p^.left^.resulttype:=oldtype;
  277. end
  278. else
  279. begin
  280. p^.left:=gentypeconvnode(p^.left,defcoll^.paratype.def);
  281. firstpass(p^.left);
  282. end;
  283. if codegenerror then
  284. begin
  285. dec(parsing_para_level);
  286. exit;
  287. end;
  288. end;
  289. { check var strings }
  290. if (cs_strict_var_strings in aktlocalswitches) and
  291. is_shortstring(p^.left^.resulttype) and
  292. is_shortstring(defcoll^.paratype.def) and
  293. (defcoll^.paratyp in [vs_out,vs_var]) and
  294. not(is_open_string(defcoll^.paratype.def)) and
  295. not(is_equal(p^.left^.resulttype,defcoll^.paratype.def)) then
  296. begin
  297. aktfilepos:=p^.left^.fileinfo;
  298. CGMessage(type_e_strict_var_string_violation);
  299. end;
  300. { Variablen for call by reference may not be copied }
  301. { into a register }
  302. { is this usefull here ? }
  303. { this was missing in formal parameter list }
  304. if (defcoll^.paratype.def=pdef(cformaldef)) then
  305. begin
  306. if defcoll^.paratyp=vs_var then
  307. begin
  308. if not valid_for_formal_var(p^.left) then
  309. begin
  310. aktfilepos:=p^.left^.fileinfo;
  311. CGMessage(parser_e_illegal_parameter_list);
  312. end;
  313. end;
  314. if defcoll^.paratyp=vs_const then
  315. begin
  316. if not valid_for_formal_const(p^.left) then
  317. begin
  318. aktfilepos:=p^.left^.fileinfo;
  319. CGMessage(parser_e_illegal_parameter_list);
  320. end;
  321. end;
  322. end;
  323. if defcoll^.paratyp in [vs_var,vs_const] then
  324. begin
  325. { Causes problems with const ansistrings if also }
  326. { done for vs_const (JM) }
  327. if defcoll^.paratyp = vs_var then
  328. set_unique(p^.left);
  329. make_not_regable(p^.left);
  330. end;
  331. { ansistrings out paramaters doesn't need to be }
  332. { unique, they are finalized }
  333. if defcoll^.paratyp=vs_out then
  334. make_not_regable(p^.left);
  335. if do_count then
  336. set_varstate(p^.left,defcoll^.paratyp <> vs_var);
  337. { must only be done after typeconv PM }
  338. p^.resulttype:=defcoll^.paratype.def;
  339. end;
  340. if p^.left^.registers32>p^.registers32 then
  341. p^.registers32:=p^.left^.registers32;
  342. if p^.left^.registersfpu>p^.registersfpu then
  343. p^.registersfpu:=p^.left^.registersfpu;
  344. {$ifdef SUPPORT_MMX}
  345. if p^.left^.registersmmx>p^.registersmmx then
  346. p^.registersmmx:=p^.left^.registersmmx;
  347. {$endif SUPPORT_MMX}
  348. dec(parsing_para_level);
  349. {$ifdef extdebug}
  350. if do_count then
  351. count_ref:=store_count_ref;
  352. {$endif def extdebug}
  353. end;
  354. {*****************************************************************************
  355. FirstCallN
  356. *****************************************************************************}
  357. procedure firstcalln(var p : ptree);
  358. type
  359. pprocdefcoll = ^tprocdefcoll;
  360. tprocdefcoll = record
  361. data : pprocdef;
  362. nextpara : pparaitem;
  363. firstpara : pparaitem;
  364. next : pprocdefcoll;
  365. end;
  366. var
  367. hp,procs,hp2 : pprocdefcoll;
  368. pd : pprocdef;
  369. oldcallprocsym : pprocsym;
  370. def_from,def_to,conv_to : pdef;
  371. hpt,pt,inlinecode : ptree;
  372. exactmatch,inlined : boolean;
  373. paralength,lastpara : longint;
  374. lastparatype : pdef;
  375. pdc : pparaitem;
  376. {$ifdef TEST_PROCSYMS}
  377. nextprocsym : pprocsym;
  378. symt : psymtable;
  379. {$endif TEST_PROCSYMS}
  380. { only Dummy }
  381. hcvt : tconverttype;
  382. {$ifdef m68k}
  383. regi : tregister;
  384. {$endif}
  385. method_must_be_valid : boolean;
  386. label
  387. errorexit;
  388. { check if the resulttype from tree p is equal with def, needed
  389. for stringconstn and formaldef }
  390. function is_equal(p:ptree;def:pdef) : boolean;
  391. begin
  392. { safety check }
  393. if not (assigned(def) or assigned(p^.resulttype)) then
  394. begin
  395. is_equal:=false;
  396. exit;
  397. end;
  398. { all types can be passed to a formaldef }
  399. is_equal:=(def^.deftype=formaldef) or
  400. (types.is_equal(p^.resulttype,def))
  401. { integer constants are compatible with all integer parameters }
  402. or
  403. (
  404. (p^.left^.treetype=ordconstn) and
  405. is_integer(p^.resulttype) and
  406. is_integer(def)
  407. )
  408. { to support ansi/long/wide strings in a proper way }
  409. { string and string[10] are assumed as equal }
  410. { when searching the correct overloaded procedure }
  411. or
  412. (
  413. (def^.deftype=stringdef) and (p^.resulttype^.deftype=stringdef) and
  414. (pstringdef(def)^.string_typ=pstringdef(p^.resulttype)^.string_typ)
  415. )
  416. or
  417. (
  418. (p^.left^.treetype=stringconstn) and
  419. (is_ansistring(p^.resulttype) and is_pchar(def))
  420. )
  421. or
  422. (
  423. (p^.left^.treetype=ordconstn) and
  424. (is_char(p^.resulttype) and (is_shortstring(def) or is_ansistring(def)))
  425. )
  426. { set can also be a not yet converted array constructor }
  427. or
  428. (
  429. (def^.deftype=setdef) and (p^.resulttype^.deftype=arraydef) and
  430. (parraydef(p^.resulttype)^.IsConstructor) and not(parraydef(p^.resulttype)^.IsVariant)
  431. )
  432. { in tp7 mode proc -> procvar is allowed }
  433. or
  434. (
  435. (m_tp_procvar in aktmodeswitches) and
  436. (def^.deftype=procvardef) and (p^.left^.treetype=calln) and
  437. (proc_to_procvar_equal(pprocdef(p^.left^.procdefinition),pprocvardef(def)))
  438. )
  439. ;
  440. end;
  441. function is_in_limit(def_from,def_to : pdef) : boolean;
  442. begin
  443. is_in_limit:=(def_from^.deftype = orddef) and
  444. (def_to^.deftype = orddef) and
  445. (porddef(def_from)^.low>porddef(def_to)^.low) and
  446. (porddef(def_from)^.high<porddef(def_to)^.high);
  447. end;
  448. var
  449. is_const : boolean;
  450. i : longint;
  451. begin
  452. { release registers! }
  453. { if procdefinition<>nil then we called firstpass already }
  454. { it seems to be bad because of the registers }
  455. { at least we can avoid the overloaded search !! }
  456. procs:=nil;
  457. { made this global for disposing !! }
  458. oldcallprocsym:=aktcallprocsym;
  459. aktcallprocsym:=nil;
  460. inlined:=false;
  461. if assigned(p^.procdefinition) and
  462. (pocall_inline in p^.procdefinition^.proccalloptions) then
  463. begin
  464. inlinecode:=p^.right;
  465. if assigned(inlinecode) then
  466. begin
  467. inlined:=true;
  468. exclude(p^.procdefinition^.proccalloptions,pocall_inline);
  469. end;
  470. p^.right:=nil;
  471. end;
  472. if assigned(p^.procdefinition) and
  473. (po_containsself in p^.procdefinition^.procoptions) then
  474. message(cg_e_cannot_call_message_direct);
  475. { procedure variable ? }
  476. if assigned(p^.right) then
  477. begin
  478. { procedure does a call }
  479. procinfo^.flags:=procinfo^.flags or pi_do_call;
  480. {$ifndef newcg}
  481. { calc the correture value for the register }
  482. {$ifdef i386}
  483. incrementregisterpushed($ff);
  484. {$endif}
  485. {$ifdef m68k}
  486. for regi:=R_D0 to R_A6 do
  487. inc(reg_pushes[regi],t_times*2);
  488. {$endif}
  489. {$endif newcg}
  490. { calculate the type of the parameters }
  491. if assigned(p^.left) then
  492. begin
  493. firstcallparan(p^.left,nil,false);
  494. if codegenerror then
  495. goto errorexit;
  496. end;
  497. firstpass(p^.right);
  498. set_varstate(p^.right,true);
  499. { check the parameters }
  500. pdc:=pparaitem(pprocvardef(p^.right^.resulttype)^.para^.first);
  501. pt:=p^.left;
  502. while assigned(pdc) and assigned(pt) do
  503. begin
  504. pt:=pt^.right;
  505. pdc:=pparaitem(pdc^.next);
  506. end;
  507. if assigned(pt) or assigned(pdc) then
  508. begin
  509. if assigned(pt) then
  510. aktfilepos:=pt^.fileinfo;
  511. CGMessage(parser_e_illegal_parameter_list);
  512. end;
  513. { insert type conversions }
  514. if assigned(p^.left) then
  515. begin
  516. firstcallparan(p^.left,pparaitem(pprocvardef(p^.right^.resulttype)^.para^.first),true);
  517. if codegenerror then
  518. goto errorexit;
  519. end;
  520. p^.resulttype:=pprocvardef(p^.right^.resulttype)^.rettype.def;
  521. { this was missing, leads to a bug below if
  522. the procvar is a function }
  523. p^.procdefinition:=pabstractprocdef(p^.right^.resulttype);
  524. end
  525. else
  526. { not a procedure variable }
  527. begin
  528. { determine the type of the parameters }
  529. if assigned(p^.left) then
  530. begin
  531. firstcallparan(p^.left,nil,false);
  532. if codegenerror then
  533. goto errorexit;
  534. end;
  535. aktcallprocsym:=pprocsym(p^.symtableprocentry);
  536. { do we know the procedure to call ? }
  537. if not(assigned(p^.procdefinition)) then
  538. begin
  539. {$ifdef TEST_PROCSYMS}
  540. if (p^.unit_specific) or
  541. assigned(p^.methodpointer) then
  542. nextprocsym:=nil
  543. else while not assigned(procs) do
  544. begin
  545. symt:=p^.symtableproc;
  546. srsym:=nil;
  547. while assigned(symt^.next) and not assigned(srsym) do
  548. begin
  549. symt:=symt^.next;
  550. getsymonlyin(symt,actprocsym^.name);
  551. if assigned(srsym) then
  552. if srsym^.typ<>procsym then
  553. begin
  554. { reject all that is not a procedure }
  555. srsym:=nil;
  556. { don't search elsewhere }
  557. while assigned(symt^.next) do
  558. symt:=symt^.next;
  559. end;
  560. end;
  561. nextprocsym:=srsym;
  562. end;
  563. {$endif TEST_PROCSYMS}
  564. { determine length of parameter list }
  565. pt:=p^.left;
  566. paralength:=0;
  567. while assigned(pt) do
  568. begin
  569. inc(paralength);
  570. pt:=pt^.right;
  571. end;
  572. { link all procedures which have the same # of parameters }
  573. pd:=aktcallprocsym^.definition;
  574. while assigned(pd) do
  575. begin
  576. { only when the # of parameter are supported by the
  577. procedure }
  578. if (paralength>=pd^.minparacount) and (paralength<=pd^.maxparacount) then
  579. begin
  580. new(hp);
  581. hp^.data:=pd;
  582. hp^.next:=procs;
  583. hp^.firstpara:=pparaitem(pd^.para^.first);
  584. { if not all parameters are given, then skip the
  585. default parameters }
  586. for i:=1 to pd^.maxparacount-paralength do
  587. hp^.firstpara:=pparaitem(hp^.firstpara^.next);
  588. hp^.nextpara:=hp^.firstpara;
  589. procs:=hp;
  590. end;
  591. pd:=pd^.nextoverloaded;
  592. end;
  593. { no procedures found? then there is something wrong
  594. with the parameter size }
  595. if not assigned(procs) then
  596. begin
  597. { in tp mode we can try to convert to procvar if
  598. there are no parameters specified }
  599. if not(assigned(p^.left)) and
  600. (m_tp_procvar in aktmodeswitches) then
  601. begin
  602. if (p^.symtableprocentry^.owner^.symtabletype=objectsymtable) and
  603. (pobjectdef(p^.symtableprocentry^.owner^.defowner)^.is_class) then
  604. hpt:=genloadmethodcallnode(pprocsym(p^.symtableprocentry),p^.symtableproc,
  605. getcopy(p^.methodpointer))
  606. else
  607. hpt:=genloadcallnode(pprocsym(p^.symtableprocentry),p^.symtableproc);
  608. disposetree(p);
  609. firstpass(hpt);
  610. p:=hpt;
  611. end
  612. else
  613. begin
  614. if assigned(p^.left) then
  615. aktfilepos:=p^.left^.fileinfo;
  616. CGMessage(parser_e_wrong_parameter_size);
  617. aktcallprocsym^.write_parameter_lists(nil);
  618. end;
  619. goto errorexit;
  620. end;
  621. { now we can compare parameter after parameter }
  622. pt:=p^.left;
  623. { we start with the last parameter }
  624. lastpara:=paralength+1;
  625. lastparatype:=nil;
  626. while assigned(pt) do
  627. begin
  628. dec(lastpara);
  629. { walk all procedures and determine how this parameter matches and set:
  630. 1. pt^.exact_match_found if one parameter has an exact match
  631. 2. exactmatch if an equal or exact match is found
  632. 3. para^.argconvtyp to exact,equal or convertable
  633. (when convertable then also convertlevel is set)
  634. 4. pt^.convlevel1found if there is a convertlevel=1
  635. 5. pt^.convlevel2found if there is a convertlevel=2
  636. }
  637. exactmatch:=false;
  638. hp:=procs;
  639. while assigned(hp) do
  640. begin
  641. if is_equal(pt,hp^.nextpara^.paratype.def) then
  642. begin
  643. if hp^.nextpara^.paratype.def=pt^.resulttype then
  644. begin
  645. pt^.exact_match_found:=true;
  646. hp^.nextpara^.argconvtyp:=act_exact;
  647. end
  648. else
  649. hp^.nextpara^.argconvtyp:=act_equal;
  650. exactmatch:=true;
  651. end
  652. else
  653. begin
  654. hp^.nextpara^.argconvtyp:=act_convertable;
  655. hp^.nextpara^.convertlevel:=isconvertable(pt^.resulttype,hp^.nextpara^.paratype.def,
  656. hcvt,pt^.left^.treetype,false);
  657. case hp^.nextpara^.convertlevel of
  658. 1 : pt^.convlevel1found:=true;
  659. 2 : pt^.convlevel2found:=true;
  660. end;
  661. end;
  662. hp:=hp^.next;
  663. end;
  664. { If there was an exactmatch then delete all convertables }
  665. if exactmatch then
  666. begin
  667. hp:=procs;
  668. procs:=nil;
  669. while assigned(hp) do
  670. begin
  671. hp2:=hp^.next;
  672. { keep if not convertable }
  673. if (hp^.nextpara^.argconvtyp<>act_convertable) then
  674. begin
  675. hp^.next:=procs;
  676. procs:=hp;
  677. end
  678. else
  679. dispose(hp);
  680. hp:=hp2;
  681. end;
  682. end
  683. else
  684. { No exact match was found, remove all procedures that are
  685. not convertable (convertlevel=0) }
  686. begin
  687. hp:=procs;
  688. procs:=nil;
  689. while assigned(hp) do
  690. begin
  691. hp2:=hp^.next;
  692. { keep if not convertable }
  693. if (hp^.nextpara^.convertlevel<>0) then
  694. begin
  695. hp^.next:=procs;
  696. procs:=hp;
  697. end
  698. else
  699. begin
  700. { save the type for nice error message }
  701. lastparatype:=hp^.nextpara^.paratype.def;
  702. dispose(hp);
  703. end;
  704. hp:=hp2;
  705. end;
  706. end;
  707. { update nextpara for all procedures }
  708. hp:=procs;
  709. while assigned(hp) do
  710. begin
  711. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  712. hp:=hp^.next;
  713. end;
  714. { load next parameter or quit loop if no procs left }
  715. if assigned(procs) then
  716. pt:=pt^.right
  717. else
  718. break;
  719. end;
  720. { All parameters are checked, check if there are any
  721. procedures left }
  722. if not assigned(procs) then
  723. begin
  724. { there is an error, must be wrong type, because
  725. wrong size is already checked (PFV) }
  726. if (not assigned(lastparatype)) or
  727. (not assigned(pt)) or
  728. (not assigned(pt^.resulttype)) then
  729. internalerror(39393)
  730. else
  731. begin
  732. aktfilepos:=pt^.fileinfo;
  733. CGMessage3(type_e_wrong_parameter_type,tostr(lastpara),
  734. pt^.resulttype^.typename,lastparatype^.typename);
  735. end;
  736. aktcallprocsym^.write_parameter_lists(nil);
  737. goto errorexit;
  738. end;
  739. { if there are several choices left then for orddef }
  740. { if a type is totally included in the other }
  741. { we don't fear an overflow , }
  742. { so we can do as if it is an exact match }
  743. { this will convert integer to longint }
  744. { rather than to words }
  745. { conversion of byte to integer or longint }
  746. {would still not be solved }
  747. if assigned(procs) and assigned(procs^.next) then
  748. begin
  749. hp:=procs;
  750. while assigned(hp) do
  751. begin
  752. hp^.nextpara:=hp^.firstpara;
  753. hp:=hp^.next;
  754. end;
  755. pt:=p^.left;
  756. while assigned(pt) do
  757. begin
  758. { matches a parameter of one procedure exact ? }
  759. exactmatch:=false;
  760. def_from:=pt^.resulttype;
  761. hp:=procs;
  762. while assigned(hp) do
  763. begin
  764. if not is_equal(pt,hp^.nextpara^.paratype.def) then
  765. begin
  766. def_to:=hp^.nextpara^.paratype.def;
  767. if ((def_from^.deftype=orddef) and (def_to^.deftype=orddef)) and
  768. (is_in_limit(def_from,def_to) or
  769. ((hp^.nextpara^.paratyp in [vs_var,vs_out]) and
  770. (def_from^.size=def_to^.size))) then
  771. begin
  772. exactmatch:=true;
  773. conv_to:=def_to;
  774. end;
  775. end;
  776. hp:=hp^.next;
  777. end;
  778. { .... if yes, del all the other procedures }
  779. if exactmatch then
  780. begin
  781. { the first .... }
  782. while (assigned(procs)) and not(is_in_limit(def_from,procs^.nextpara^.paratype.def)) do
  783. begin
  784. hp:=procs^.next;
  785. dispose(procs);
  786. procs:=hp;
  787. end;
  788. { and the others }
  789. hp:=procs;
  790. while (assigned(hp)) and assigned(hp^.next) do
  791. begin
  792. if not(is_in_limit(def_from,hp^.next^.nextpara^.paratype.def)) then
  793. begin
  794. hp2:=hp^.next^.next;
  795. dispose(hp^.next);
  796. hp^.next:=hp2;
  797. end
  798. else
  799. begin
  800. def_to:=hp^.next^.nextpara^.paratype.def;
  801. if (conv_to^.size>def_to^.size) or
  802. ((porddef(conv_to)^.low<porddef(def_to)^.low) and
  803. (porddef(conv_to)^.high>porddef(def_to)^.high)) then
  804. begin
  805. hp2:=procs;
  806. procs:=hp;
  807. conv_to:=def_to;
  808. dispose(hp2);
  809. end
  810. else
  811. hp:=hp^.next;
  812. end;
  813. end;
  814. end;
  815. { update nextpara for all procedures }
  816. hp:=procs;
  817. while assigned(hp) do
  818. begin
  819. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  820. hp:=hp^.next;
  821. end;
  822. pt:=pt^.right;
  823. end;
  824. end;
  825. { let's try to eliminate equal if there is an exact match
  826. is there }
  827. if assigned(procs) and assigned(procs^.next) then
  828. begin
  829. { reset nextpara for all procs left }
  830. hp:=procs;
  831. while assigned(hp) do
  832. begin
  833. hp^.nextpara:=hp^.firstpara;
  834. hp:=hp^.next;
  835. end;
  836. pt:=p^.left;
  837. while assigned(pt) do
  838. begin
  839. if pt^.exact_match_found then
  840. begin
  841. hp:=procs;
  842. procs:=nil;
  843. while assigned(hp) do
  844. begin
  845. hp2:=hp^.next;
  846. { keep the exact matches, dispose the others }
  847. if (hp^.nextpara^.argconvtyp=act_exact) 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:=pparaitem(hp^.nextpara^.next);
  862. hp:=hp^.next;
  863. end;
  864. pt:=pt^.right;
  865. end;
  866. end;
  867. { Check if there are convertlevel 1 and 2 differences
  868. left for the parameters, then discard all convertlevel
  869. 2 procedures. The value of convlevelXfound can still
  870. be used, because all convertables are still here or
  871. not }
  872. if assigned(procs) and assigned(procs^.next) then
  873. begin
  874. { reset nextpara for all procs left }
  875. hp:=procs;
  876. while assigned(hp) do
  877. begin
  878. hp^.nextpara:=hp^.firstpara;
  879. hp:=hp^.next;
  880. end;
  881. pt:=p^.left;
  882. while assigned(pt) do
  883. begin
  884. if pt^.convlevel1found and pt^.convlevel2found then
  885. begin
  886. hp:=procs;
  887. procs:=nil;
  888. while assigned(hp) do
  889. begin
  890. hp2:=hp^.next;
  891. { keep all not act_convertable and all convertlevels=1 }
  892. if (hp^.nextpara^.argconvtyp<>act_convertable) or
  893. (hp^.nextpara^.convertlevel=1) then
  894. begin
  895. hp^.next:=procs;
  896. procs:=hp;
  897. end
  898. else
  899. dispose(hp);
  900. hp:=hp2;
  901. end;
  902. end;
  903. { update nextpara for all procedures }
  904. hp:=procs;
  905. while assigned(hp) do
  906. begin
  907. hp^.nextpara:=pparaitem(hp^.nextpara^.next);
  908. hp:=hp^.next;
  909. end;
  910. pt:=pt^.right;
  911. end;
  912. end;
  913. if not(assigned(procs)) or assigned(procs^.next) then
  914. begin
  915. CGMessage(cg_e_cant_choose_overload_function);
  916. aktcallprocsym^.write_parameter_lists(nil);
  917. goto errorexit;
  918. end;
  919. {$ifdef TEST_PROCSYMS}
  920. if (procs=nil) and assigned(nextprocsym) then
  921. begin
  922. p^.symtableprocentry:=nextprocsym;
  923. p^.symtableproc:=symt;
  924. end;
  925. end ; { of while assigned(p^.symtableprocentry) do }
  926. {$endif TEST_PROCSYMS}
  927. if make_ref then
  928. begin
  929. procs^.data^.lastref:=new(pref,init(procs^.data^.lastref,@p^.fileinfo));
  930. inc(procs^.data^.refcount);
  931. if procs^.data^.defref=nil then
  932. procs^.data^.defref:=procs^.data^.lastref;
  933. end;
  934. p^.procdefinition:=procs^.data;
  935. p^.resulttype:=procs^.data^.rettype.def;
  936. { big error for with statements
  937. p^.symtableproc:=p^.procdefinition^.owner;
  938. but neede for overloaded operators !! }
  939. if p^.symtableproc=nil then
  940. p^.symtableproc:=p^.procdefinition^.owner;
  941. p^.location.loc:=LOC_MEM;
  942. {$ifdef CHAINPROCSYMS}
  943. { object with method read;
  944. call to read(x) will be a usual procedure call }
  945. if assigned(p^.methodpointer) and
  946. (p^.procdefinition^._class=nil) then
  947. begin
  948. { not ok for extended }
  949. case p^.methodpointer^.treetype of
  950. typen,hnewn : fatalerror(no_para_match);
  951. end;
  952. disposetree(p^.methodpointer);
  953. p^.methodpointer:=nil;
  954. end;
  955. {$endif CHAINPROCSYMS}
  956. end; { end of procedure to call determination }
  957. is_const:=(pocall_internconst in p^.procdefinition^.proccalloptions) and
  958. ((block_type=bt_const) or
  959. (assigned(p^.left) and (p^.left^.left^.treetype in [realconstn,ordconstn])));
  960. { handle predefined procedures }
  961. if (pocall_internproc in p^.procdefinition^.proccalloptions) or is_const then
  962. begin
  963. if assigned(p^.left) then
  964. begin
  965. { settextbuf needs two args }
  966. if assigned(p^.left^.right) then
  967. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,p^.left)
  968. else
  969. begin
  970. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,p^.left^.left);
  971. putnode(p^.left);
  972. end;
  973. end
  974. else
  975. begin
  976. pt:=geninlinenode(pprocdef(p^.procdefinition)^.extnumber,is_const,nil);
  977. end;
  978. putnode(p);
  979. firstpass(pt);
  980. p:=pt;
  981. goto errorexit;
  982. end
  983. else
  984. { no intern procedure => we do a call }
  985. { calc the correture value for the register }
  986. { handle predefined procedures }
  987. if (pocall_inline in p^.procdefinition^.proccalloptions) then
  988. begin
  989. if assigned(p^.methodpointer) then
  990. CGMessage(cg_e_unable_inline_object_methods);
  991. if assigned(p^.right) and (p^.right^.treetype<>procinlinen) then
  992. CGMessage(cg_e_unable_inline_procvar);
  993. { p^.treetype:=procinlinen; }
  994. if not assigned(p^.right) then
  995. begin
  996. if assigned(pprocdef(p^.procdefinition)^.code) then
  997. inlinecode:=genprocinlinenode(p,ptree(pprocdef(p^.procdefinition)^.code))
  998. else
  999. CGMessage(cg_e_no_code_for_inline_stored);
  1000. if assigned(inlinecode) then
  1001. begin
  1002. { consider it has not inlined if called
  1003. again inside the args }
  1004. exclude(p^.procdefinition^.proccalloptions,pocall_inline);
  1005. firstpass(inlinecode);
  1006. inlined:=true;
  1007. end;
  1008. end;
  1009. end
  1010. else
  1011. procinfo^.flags:=procinfo^.flags or pi_do_call;
  1012. { add needed default parameters }
  1013. if assigned(procs) and
  1014. (paralength<p^.procdefinition^.maxparacount) then
  1015. begin
  1016. { add default parameters, just read back the skipped
  1017. paras starting from firstpara^.previous, when not available
  1018. (all parameters are default) then start with the last
  1019. parameter and read backward (PFV) }
  1020. if not assigned(procs^.firstpara) then
  1021. pdc:=pparaitem(procs^.data^.para^.last)
  1022. else
  1023. pdc:=pparaitem(procs^.firstpara^.previous);
  1024. while assigned(pdc) do
  1025. begin
  1026. if not assigned(pdc^.defaultvalue) then
  1027. internalerror(751349858);
  1028. p^.left:=gencallparanode(genconstsymtree(pconstsym(pdc^.defaultvalue)),p^.left);
  1029. pdc:=pparaitem(pdc^.previous);
  1030. end;
  1031. end;
  1032. { work trough all parameters to insert the type conversions }
  1033. if assigned(p^.left) then
  1034. begin
  1035. firstcallparan(p^.left,pparaitem(p^.procdefinition^.para^.first),true);
  1036. end;
  1037. {$ifndef newcg}
  1038. {$ifdef i386}
  1039. incrementregisterpushed(pprocdef(p^.procdefinition)^.usedregisters);
  1040. {$endif}
  1041. {$ifdef m68k}
  1042. for regi:=R_D0 to R_A6 do
  1043. begin
  1044. if (pprocdef(p^.procdefinition)^.usedregisters and ($800 shr word(regi)))<>0 then
  1045. inc(reg_pushes[regi],t_times*2);
  1046. end;
  1047. {$endif}
  1048. {$endif newcg}
  1049. end;
  1050. { ensure that the result type is set }
  1051. p^.resulttype:=p^.procdefinition^.rettype.def;
  1052. { get a register for the return value }
  1053. if (p^.resulttype<>pdef(voiddef)) then
  1054. begin
  1055. if (p^.procdefinition^.proctypeoption=potype_constructor) then
  1056. begin
  1057. { extra handling of classes }
  1058. { p^.methodpointer should be assigned! }
  1059. if assigned(p^.methodpointer) and assigned(p^.methodpointer^.resulttype) and
  1060. (p^.methodpointer^.resulttype^.deftype=classrefdef) then
  1061. begin
  1062. p^.location.loc:=LOC_REGISTER;
  1063. p^.registers32:=1;
  1064. { the result type depends on the classref }
  1065. p^.resulttype:=pclassrefdef(p^.methodpointer^.resulttype)^.pointertype.def;
  1066. end
  1067. { a object constructor returns the result with the flags }
  1068. else
  1069. p^.location.loc:=LOC_FLAGS;
  1070. end
  1071. else
  1072. begin
  1073. {$ifdef SUPPORT_MMX}
  1074. if (cs_mmx in aktlocalswitches) and
  1075. is_mmx_able_array(p^.resulttype) then
  1076. begin
  1077. p^.location.loc:=LOC_MMXREGISTER;
  1078. p^.registersmmx:=1;
  1079. end
  1080. else
  1081. {$endif SUPPORT_MMX}
  1082. if ret_in_acc(p^.resulttype) then
  1083. begin
  1084. p^.location.loc:=LOC_REGISTER;
  1085. if is_64bitint(p^.resulttype) then
  1086. p^.registers32:=2
  1087. else
  1088. p^.registers32:=1;
  1089. { wide- and ansistrings are returned in EAX }
  1090. { but they are imm. moved to a memory location }
  1091. if is_widestring(p^.resulttype) or
  1092. is_ansistring(p^.resulttype) then
  1093. begin
  1094. p^.location.loc:=LOC_MEM;
  1095. { this is wrong we still need one register PM
  1096. p^.registers32:=0; }
  1097. { we use ansistrings so no fast exit here }
  1098. procinfo^.no_fast_exit:=true;
  1099. p^.registers32:=1;
  1100. end;
  1101. end
  1102. else if (p^.resulttype^.deftype=floatdef) then
  1103. begin
  1104. p^.location.loc:=LOC_FPU;
  1105. p^.registersfpu:=1;
  1106. end
  1107. else
  1108. p^.location.loc:=LOC_MEM;
  1109. end;
  1110. end;
  1111. { a fpu can be used in any procedure !! }
  1112. p^.registersfpu:=p^.procdefinition^.fpu_used;
  1113. { if this is a call to a method calc the registers }
  1114. if (p^.methodpointer<>nil) then
  1115. begin
  1116. case p^.methodpointer^.treetype of
  1117. { but only, if this is not a supporting node }
  1118. typen: ;
  1119. { we need one register for new return value PM }
  1120. hnewn : if p^.registers32=0 then
  1121. p^.registers32:=1;
  1122. else
  1123. begin
  1124. if (p^.procdefinition^.proctypeoption in [potype_constructor,potype_destructor]) and
  1125. assigned(p^.symtable) and (p^.symtable^.symtabletype=withsymtable) and
  1126. not pwithsymtable(p^.symtable)^.direct_with then
  1127. begin
  1128. CGmessage(cg_e_cannot_call_cons_dest_inside_with);
  1129. end; { Is accepted by Delphi !! }
  1130. { this is not a good reason to accept it in FPC if we produce
  1131. wrong code for it !!! (PM) }
  1132. { R.Assign is not a constructor !!! }
  1133. { but for R^.Assign, R must be valid !! }
  1134. if (p^.procdefinition^.proctypeoption=potype_constructor) or
  1135. ((p^.methodpointer^.treetype=loadn) and
  1136. (not(oo_has_virtual in pobjectdef(p^.methodpointer^.resulttype)^.objectoptions))) then
  1137. method_must_be_valid:=false
  1138. else
  1139. method_must_be_valid:=true;
  1140. firstpass(p^.methodpointer);
  1141. set_varstate(p^.methodpointer,method_must_be_valid);
  1142. { The object is already used ven if it is called once }
  1143. if (p^.methodpointer^.treetype=loadn) and
  1144. (p^.methodpointer^.symtableentry^.typ=varsym) then
  1145. pvarsym(p^.methodpointer^.symtableentry)^.varstate:=vs_used;
  1146. p^.registersfpu:=max(p^.methodpointer^.registersfpu,p^.registersfpu);
  1147. p^.registers32:=max(p^.methodpointer^.registers32,p^.registers32);
  1148. {$ifdef SUPPORT_MMX}
  1149. p^.registersmmx:=max(p^.methodpointer^.registersmmx,p^.registersmmx);
  1150. {$endif SUPPORT_MMX}
  1151. end;
  1152. end;
  1153. end;
  1154. if inlined then
  1155. p^.right:=inlinecode;
  1156. { determine the registers of the procedure variable }
  1157. { is this OK for inlined procs also ?? (PM) }
  1158. if assigned(p^.right) then
  1159. begin
  1160. p^.registersfpu:=max(p^.right^.registersfpu,p^.registersfpu);
  1161. p^.registers32:=max(p^.right^.registers32,p^.registers32);
  1162. {$ifdef SUPPORT_MMX}
  1163. p^.registersmmx:=max(p^.right^.registersmmx,p^.registersmmx);
  1164. {$endif SUPPORT_MMX}
  1165. end;
  1166. { determine the registers of the procedure }
  1167. if assigned(p^.left) then
  1168. begin
  1169. p^.registersfpu:=max(p^.left^.registersfpu,p^.registersfpu);
  1170. p^.registers32:=max(p^.left^.registers32,p^.registers32);
  1171. {$ifdef SUPPORT_MMX}
  1172. p^.registersmmx:=max(p^.left^.registersmmx,p^.registersmmx);
  1173. {$endif SUPPORT_MMX}
  1174. end;
  1175. errorexit:
  1176. { Reset some settings back }
  1177. if assigned(procs) then
  1178. dispose(procs);
  1179. if inlined then
  1180. include(p^.procdefinition^.proccalloptions,pocall_inline);
  1181. aktcallprocsym:=oldcallprocsym;
  1182. end;
  1183. {*****************************************************************************
  1184. FirstProcInlineN
  1185. *****************************************************************************}
  1186. procedure firstprocinline(var p : ptree);
  1187. begin
  1188. { left contains the code in tree form }
  1189. { but it has already been firstpassed }
  1190. { so firstpass(p^.left); does not seem required }
  1191. { might be required later if we change the arg handling !! }
  1192. end;
  1193. end.
  1194. {
  1195. $Log$
  1196. Revision 1.7 2000-08-13 14:53:32 peter
  1197. * integer constant is equal with all integer type arguments (merged)
  1198. Revision 1.6 2000/08/13 12:54:56 peter
  1199. * class member decl wrong then no other error after it
  1200. * -vb has now also line numbering
  1201. * -vb is also used for interface/implementation different decls and
  1202. doesn't list the current function (merged)
  1203. Revision 1.5 2000/08/08 19:23:28 peter
  1204. * crash fix for default para when all parameters were omitted
  1205. Revision 1.4 2000/08/06 19:39:28 peter
  1206. * default parameters working !
  1207. Revision 1.3 2000/07/13 12:08:28 michael
  1208. + patched to 1.1.0 with former 1.09patch from peter
  1209. Revision 1.2 2000/07/13 11:32:51 michael
  1210. + removed logs
  1211. }