tccal.pas 54 KB

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