tccal.pas 53 KB

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