nobj.pas 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Routines for the code generation of data structures
  5. like VMT, Messages, VTables, Interfaces descs
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit nobj;
  20. {$i defines.inc}
  21. interface
  22. uses
  23. cutils,cclasses,
  24. symdef,aasm;
  25. type
  26. pprocdeftree = ^tprocdeftree;
  27. tprocdeftree = record
  28. data : tprocdef;
  29. nl : tasmlabel;
  30. l,r : pprocdeftree;
  31. end;
  32. pprocdefcoll = ^tprocdefcoll;
  33. tprocdefcoll = record
  34. data : tprocdef;
  35. next : pprocdefcoll;
  36. end;
  37. psymcoll = ^tsymcoll;
  38. tsymcoll = record
  39. name : pstring;
  40. data : pprocdefcoll;
  41. next : psymcoll;
  42. end;
  43. tclassheader=class
  44. private
  45. _Class : tobjectdef;
  46. count : integer;
  47. private
  48. { message tables }
  49. root : pprocdeftree;
  50. procedure disposeprocdeftree(p : pprocdeftree);
  51. procedure insertmsgint(p : tnamedindexitem);
  52. procedure insertmsgstr(p : tnamedindexitem);
  53. procedure insertint(p : pprocdeftree;var at : pprocdeftree);
  54. procedure insertstr(p : pprocdeftree;var at : pprocdeftree);
  55. procedure writenames(p : pprocdeftree);
  56. procedure writeintentry(p : pprocdeftree);
  57. procedure writestrentry(p : pprocdeftree);
  58. {$ifdef WITHDMT}
  59. private
  60. { dmt }
  61. procedure insertdmtentry(p : tnamedindexitem);
  62. procedure writedmtindexentry(p : pprocdeftree);
  63. procedure writedmtaddressentry(p : pprocdeftree);
  64. {$endif}
  65. private
  66. { published methods }
  67. procedure do_count(p : tnamedindexitem);
  68. procedure genpubmethodtableentry(p : tnamedindexitem);
  69. private
  70. { vmt }
  71. wurzel : psymcoll;
  72. nextvirtnumber : integer;
  73. has_constructor,
  74. has_virtual_method : boolean;
  75. procedure eachsym(sym : tnamedindexitem);
  76. procedure disposevmttree;
  77. procedure writevirtualmethods(List:TAAsmoutput);
  78. private
  79. { interface tables }
  80. function gintfgetvtbllabelname(intfindex: integer): string;
  81. procedure gintfcreatevtbl(intfindex: integer; rawdata,rawcode: TAAsmoutput);
  82. procedure gintfgenentry(intfindex, contintfindex: integer; rawdata: TAAsmoutput);
  83. procedure gintfoptimizevtbls(implvtbl : plongint);
  84. procedure gintfwritedata;
  85. function gintfgetcprocdef(proc: tprocdef;const name: string): tprocdef;
  86. procedure gintfdoonintf(intf: tobjectdef; intfindex: longint);
  87. procedure gintfwalkdowninterface(intf: tobjectdef; intfindex: longint);
  88. protected
  89. procedure cgintfwrapper(asmlist: TAAsmoutput; procdef: tprocdef; const labelname: string; ioffset: longint);virtual;abstract;
  90. public
  91. constructor create(c:tobjectdef);
  92. destructor destroy;override;
  93. { generates the message tables for a class }
  94. function genstrmsgtab : tasmlabel;
  95. function genintmsgtab : tasmlabel;
  96. function genpublishedmethodstable : tasmlabel;
  97. { generates a VMT entries }
  98. procedure genvmt;
  99. {$ifdef WITHDMT}
  100. { generates a DMT for _class }
  101. function gendmt : tasmlabel;
  102. {$endif WITHDMT}
  103. { interfaces }
  104. function genintftable: tasmlabel;
  105. { write the VMT to datasegment }
  106. procedure writevmt;
  107. procedure writeinterfaceids;
  108. end;
  109. tclassheaderclass=class of tclassheader;
  110. var
  111. cclassheader : tclassheaderclass;
  112. implementation
  113. uses
  114. {$ifdef delphi}
  115. sysutils,
  116. {$else}
  117. strings,
  118. {$endif}
  119. globtype,globals,verbose,
  120. symtable,symconst,symtype,symsym,types,
  121. fmodule,
  122. {$ifdef GDB}
  123. gdb,
  124. {$endif GDB}
  125. systems
  126. ;
  127. {*****************************************************************************
  128. TClassHeader
  129. *****************************************************************************}
  130. constructor tclassheader.create(c:tobjectdef);
  131. begin
  132. inherited Create;
  133. _Class:=c;
  134. end;
  135. destructor tclassheader.destroy;
  136. begin
  137. disposevmttree;
  138. end;
  139. {**************************************
  140. Message Tables
  141. **************************************}
  142. procedure tclassheader.disposeprocdeftree(p : pprocdeftree);
  143. begin
  144. if assigned(p^.l) then
  145. disposeprocdeftree(p^.l);
  146. if assigned(p^.r) then
  147. disposeprocdeftree(p^.r);
  148. dispose(p);
  149. end;
  150. procedure tclassheader.insertint(p : pprocdeftree;var at : pprocdeftree);
  151. begin
  152. if at=nil then
  153. begin
  154. at:=p;
  155. inc(count);
  156. end
  157. else
  158. begin
  159. if p^.data.messageinf.i<at^.data.messageinf.i then
  160. insertint(p,at^.l)
  161. else if p^.data.messageinf.i>at^.data.messageinf.i then
  162. insertint(p,at^.r)
  163. else
  164. Message1(parser_e_duplicate_message_label,tostr(p^.data.messageinf.i));
  165. end;
  166. end;
  167. procedure tclassheader.insertstr(p : pprocdeftree;var at : pprocdeftree);
  168. var
  169. i : integer;
  170. begin
  171. if at=nil then
  172. begin
  173. at:=p;
  174. inc(count);
  175. end
  176. else
  177. begin
  178. i:=strcomp(p^.data.messageinf.str,at^.data.messageinf.str);
  179. if i<0 then
  180. insertstr(p,at^.l)
  181. else if i>0 then
  182. insertstr(p,at^.r)
  183. else
  184. Message1(parser_e_duplicate_message_label,strpas(p^.data.messageinf.str));
  185. end;
  186. end;
  187. procedure tclassheader.insertmsgint(p : tnamedindexitem);
  188. var
  189. hp : tprocdef;
  190. pt : pprocdeftree;
  191. begin
  192. if tsym(p).typ=procsym then
  193. begin
  194. hp:=tprocsym(p).definition;
  195. while assigned(hp) do
  196. begin
  197. if (po_msgint in hp.procoptions) then
  198. begin
  199. new(pt);
  200. pt^.data:=hp;
  201. pt^.l:=nil;
  202. pt^.r:=nil;
  203. insertint(pt,root);
  204. end;
  205. hp:=hp.nextoverloaded;
  206. end;
  207. end;
  208. end;
  209. procedure tclassheader.insertmsgstr(p : tnamedindexitem);
  210. var
  211. hp : tprocdef;
  212. pt : pprocdeftree;
  213. begin
  214. if tsym(p).typ=procsym then
  215. begin
  216. hp:=tprocsym(p).definition;
  217. while assigned(hp) do
  218. begin
  219. if (po_msgstr in hp.procoptions) then
  220. begin
  221. new(pt);
  222. pt^.data:=hp;
  223. pt^.l:=nil;
  224. pt^.r:=nil;
  225. insertstr(pt,root);
  226. end;
  227. hp:=hp.nextoverloaded;
  228. end;
  229. end;
  230. end;
  231. procedure tclassheader.writenames(p : pprocdeftree);
  232. begin
  233. getdatalabel(p^.nl);
  234. if assigned(p^.l) then
  235. writenames(p^.l);
  236. dataSegment.concat(Tai_label.Create(p^.nl));
  237. dataSegment.concat(Tai_const.Create_8bit(strlen(p^.data.messageinf.str)));
  238. dataSegment.concat(Tai_string.Create_pchar(p^.data.messageinf.str));
  239. if assigned(p^.r) then
  240. writenames(p^.r);
  241. end;
  242. procedure tclassheader.writestrentry(p : pprocdeftree);
  243. begin
  244. if assigned(p^.l) then
  245. writestrentry(p^.l);
  246. { write name label }
  247. dataSegment.concat(Tai_const_symbol.Create(p^.nl));
  248. dataSegment.concat(Tai_const_symbol.Createname(p^.data.mangledname));
  249. if assigned(p^.r) then
  250. writestrentry(p^.r);
  251. end;
  252. function tclassheader.genstrmsgtab : tasmlabel;
  253. var
  254. r : tasmlabel;
  255. begin
  256. root:=nil;
  257. count:=0;
  258. { insert all message handlers into a tree, sorted by name }
  259. _class.symtable.foreach({$ifdef FPCPROCVAR}@{$endif}insertmsgstr);
  260. { write all names }
  261. if assigned(root) then
  262. writenames(root);
  263. { now start writing of the message string table }
  264. getdatalabel(r);
  265. dataSegment.concat(Tai_label.Create(r));
  266. genstrmsgtab:=r;
  267. dataSegment.concat(Tai_const.Create_32bit(count));
  268. if assigned(root) then
  269. begin
  270. writestrentry(root);
  271. disposeprocdeftree(root);
  272. end;
  273. end;
  274. procedure tclassheader.writeintentry(p : pprocdeftree);
  275. begin
  276. if assigned(p^.l) then
  277. writeintentry(p^.l);
  278. { write name label }
  279. dataSegment.concat(Tai_const.Create_32bit(p^.data.messageinf.i));
  280. dataSegment.concat(Tai_const_symbol.Createname(p^.data.mangledname));
  281. if assigned(p^.r) then
  282. writeintentry(p^.r);
  283. end;
  284. function tclassheader.genintmsgtab : tasmlabel;
  285. var
  286. r : tasmlabel;
  287. begin
  288. root:=nil;
  289. count:=0;
  290. { insert all message handlers into a tree, sorted by name }
  291. _class.symtable.foreach({$ifdef FPCPROCVAR}@{$endif}insertmsgint);
  292. { now start writing of the message string table }
  293. getdatalabel(r);
  294. dataSegment.concat(Tai_label.Create(r));
  295. genintmsgtab:=r;
  296. dataSegment.concat(Tai_const.Create_32bit(count));
  297. if assigned(root) then
  298. begin
  299. writeintentry(root);
  300. disposeprocdeftree(root);
  301. end;
  302. end;
  303. {$ifdef WITHDMT}
  304. {**************************************
  305. DMT
  306. **************************************}
  307. procedure tclassheader.insertdmtentry(p : tnamedindexitem);
  308. var
  309. hp : tprocdef;
  310. pt : pprocdeftree;
  311. begin
  312. if tsym(p).typ=procsym then
  313. begin
  314. hp:=tprocsym(p).definition;
  315. while assigned(hp) do
  316. begin
  317. if (po_msgint in hp.procoptions) then
  318. begin
  319. new(pt);
  320. pt^.p:=hp;
  321. pt^.l:=nil;
  322. pt^.r:=nil;
  323. insertint(pt,root);
  324. end;
  325. hp:=hp.nextoverloaded;
  326. end;
  327. end;
  328. end;
  329. procedure tclassheader.writedmtindexentry(p : pprocdeftree);
  330. begin
  331. if assigned(p^.l) then
  332. writedmtindexentry(p^.l);
  333. dataSegment.concat(Tai_const.Create_32bit(p^.data.messageinf.i));
  334. if assigned(p^.r) then
  335. writedmtindexentry(p^.r);
  336. end;
  337. procedure tclassheader.writedmtaddressentry(p : pprocdeftree);
  338. begin
  339. if assigned(p^.l) then
  340. writedmtaddressentry(p^.l);
  341. dataSegment.concat(Tai_const_symbol.Createname(p^.data.mangledname));
  342. if assigned(p^.r) then
  343. writedmtaddressentry(p^.r);
  344. end;
  345. function tclassheader.gendmt : tasmlabel;
  346. var
  347. r : tasmlabel;
  348. begin
  349. root:=nil;
  350. count:=0;
  351. gendmt:=nil;
  352. { insert all message handlers into a tree, sorted by number }
  353. _class.symtable.foreach({$ifdef FPCPROCVAR}@{$endif}insertdmtentry);
  354. if count>0 then
  355. begin
  356. getdatalabel(r);
  357. gendmt:=r;
  358. dataSegment.concat(Tai_label.Create(r));
  359. { entries for caching }
  360. dataSegment.concat(Tai_const.Create_32bit(0));
  361. dataSegment.concat(Tai_const.Create_32bit(0));
  362. dataSegment.concat(Tai_const.Create_32bit(count));
  363. if assigned(root) then
  364. begin
  365. writedmtindexentry(root);
  366. writedmtaddressentry(root);
  367. disposeprocdeftree(root);
  368. end;
  369. end;
  370. end;
  371. {$endif WITHDMT}
  372. {**************************************
  373. Published Methods
  374. **************************************}
  375. procedure tclassheader.do_count(p : tnamedindexitem);
  376. begin
  377. if (tsym(p).typ=procsym) and (sp_published in tsym(p).symoptions) then
  378. inc(count);
  379. end;
  380. procedure tclassheader.genpubmethodtableentry(p : tnamedindexitem);
  381. var
  382. hp : tprocdef;
  383. l : tasmlabel;
  384. begin
  385. if (tsym(p).typ=procsym) and (sp_published in tsym(p).symoptions) then
  386. begin
  387. hp:=tprocsym(p).definition;
  388. if assigned(hp.nextoverloaded) then
  389. internalerror(1209992);
  390. getdatalabel(l);
  391. Consts.concat(Tai_label.Create(l));
  392. Consts.concat(Tai_const.Create_8bit(length(p.name)));
  393. Consts.concat(Tai_string.Create(p.name));
  394. dataSegment.concat(Tai_const_symbol.Create(l));
  395. dataSegment.concat(Tai_const_symbol.Createname(hp.mangledname));
  396. end;
  397. end;
  398. function tclassheader.genpublishedmethodstable : tasmlabel;
  399. var
  400. l : tasmlabel;
  401. begin
  402. count:=0;
  403. _class.symtable.foreach({$ifdef FPCPROCVAR}@{$endif}do_count);
  404. if count>0 then
  405. begin
  406. getdatalabel(l);
  407. dataSegment.concat(Tai_label.Create(l));
  408. dataSegment.concat(Tai_const.Create_32bit(count));
  409. _class.symtable.foreach({$ifdef FPCPROCVAR}@{$endif}genpubmethodtableentry);
  410. genpublishedmethodstable:=l;
  411. end
  412. else
  413. genpublishedmethodstable:=nil;
  414. end;
  415. {**************************************
  416. VMT
  417. **************************************}
  418. procedure tclassheader.eachsym(sym : tnamedindexitem);
  419. var
  420. procdefcoll : pprocdefcoll;
  421. hp : tprocdef;
  422. symcoll : psymcoll;
  423. _name : string;
  424. stored : boolean;
  425. { creates a new entry in the procsym list }
  426. procedure newentry;
  427. begin
  428. { if not, generate a new symbol item }
  429. new(symcoll);
  430. symcoll^.name:=stringdup(sym.name);
  431. symcoll^.next:=wurzel;
  432. symcoll^.data:=nil;
  433. wurzel:=symcoll;
  434. hp:=tprocsym(sym).definition;
  435. { inserts all definitions }
  436. while assigned(hp) do
  437. begin
  438. new(procdefcoll);
  439. procdefcoll^.data:=hp;
  440. procdefcoll^.next:=symcoll^.data;
  441. symcoll^.data:=procdefcoll;
  442. { if it's a virtual method }
  443. if (po_virtualmethod in hp.procoptions) then
  444. begin
  445. { then it gets a number ... }
  446. hp.extnumber:=nextvirtnumber;
  447. { and we inc the number }
  448. inc(nextvirtnumber);
  449. has_virtual_method:=true;
  450. end;
  451. if (hp.proctypeoption=potype_constructor) then
  452. has_constructor:=true;
  453. { check, if a method should be overridden }
  454. if (po_overridingmethod in hp.procoptions) then
  455. MessagePos1(hp.fileinfo,parser_e_nothing_to_be_overridden,_class.objname^+'.'+_name+hp.demangled_paras);
  456. { next overloaded method }
  457. hp:=hp.nextoverloaded;
  458. end;
  459. end;
  460. procedure newdefentry;
  461. begin
  462. new(procdefcoll);
  463. procdefcoll^.data:=hp;
  464. procdefcoll^.next:=symcoll^.data;
  465. symcoll^.data:=procdefcoll;
  466. { if it's a virtual method }
  467. if (po_virtualmethod in hp.procoptions) then
  468. begin
  469. { then it gets a number ... }
  470. hp.extnumber:=nextvirtnumber;
  471. { and we inc the number }
  472. inc(nextvirtnumber);
  473. has_virtual_method:=true;
  474. end;
  475. if (hp.proctypeoption=potype_constructor) then
  476. has_constructor:=true;
  477. { check, if a method should be overridden }
  478. if (po_overridingmethod in hp.procoptions) then
  479. MessagePos1(hp.fileinfo,parser_e_nothing_to_be_overridden,_class.objname^+'.'+_name+hp.demangled_paras);
  480. end;
  481. label
  482. handlenextdef;
  483. begin
  484. { put only sub routines into the VMT }
  485. if tsym(sym).typ=procsym then
  486. begin
  487. _name:=sym.name;
  488. symcoll:=wurzel;
  489. while assigned(symcoll) do
  490. begin
  491. { does the symbol already exist in the list ? }
  492. if _name=symcoll^.name^ then
  493. begin
  494. { walk through all defs of the symbol }
  495. hp:=tprocsym(sym).definition;
  496. while assigned(hp) do
  497. begin
  498. { compare with all stored definitions }
  499. procdefcoll:=symcoll^.data;
  500. stored:=false;
  501. while assigned(procdefcoll) do
  502. begin
  503. { compare parameters }
  504. if equal_paras(procdefcoll^.data.para,hp.para,cp_all) and
  505. (
  506. (po_virtualmethod in procdefcoll^.data.procoptions) or
  507. (po_virtualmethod in hp.procoptions)
  508. ) then
  509. begin { same parameters }
  510. { wenn sie gleich sind }
  511. { und eine davon virtual deklariert ist }
  512. { Fehler falls nur eine VIRTUAL }
  513. if (po_virtualmethod in procdefcoll^.data.procoptions)<>
  514. (po_virtualmethod in hp.procoptions) then
  515. begin
  516. { in classes, we hide the old method }
  517. if is_class(_class) then
  518. begin
  519. { warn only if it is the first time,
  520. we hide the method }
  521. if _class=hp._class then
  522. Message1(parser_w_should_use_override,hp.fullprocname);
  523. end
  524. else
  525. if _class=hp._class then
  526. begin
  527. if (po_virtualmethod in procdefcoll^.data.procoptions) then
  528. Message1(parser_w_overloaded_are_not_both_virtual,
  529. hp.fullprocname)
  530. else
  531. Message1(parser_w_overloaded_are_not_both_non_virtual,
  532. hp.fullprocname);
  533. end;
  534. { was newentry; exit; (FK) }
  535. newdefentry;
  536. goto handlenextdef;
  537. end
  538. else
  539. { the flags have to match }
  540. { except abstract and override }
  541. { only if both are virtual !! }
  542. if (procdefcoll^.data.proccalloptions<>hp.proccalloptions) or
  543. (procdefcoll^.data.proctypeoption<>hp.proctypeoption) or
  544. ((procdefcoll^.data.procoptions-
  545. [po_abstractmethod,po_overridingmethod,po_assembler,po_overload])<>
  546. (hp.procoptions-[po_abstractmethod,po_overridingmethod,po_assembler,po_overload])) then
  547. Message1(parser_e_header_dont_match_forward,hp.fullprocname);
  548. { check, if the overridden directive is set }
  549. { (povirtualmethod is set! }
  550. { class ? }
  551. if is_class(_class) and
  552. not(po_overridingmethod in hp.procoptions) then
  553. begin
  554. { warn only if it is the first time,
  555. we hide the method }
  556. if _class=hp._class then
  557. Message1(parser_w_should_use_override,hp.fullprocname);
  558. { was newentry; (FK) }
  559. newdefentry;
  560. exit;
  561. end;
  562. { error, if the return types aren't equal }
  563. if not(is_equal(procdefcoll^.data.rettype.def,hp.rettype.def)) and
  564. not((procdefcoll^.data.rettype.def.deftype=objectdef) and
  565. (hp.rettype.def.deftype=objectdef) and
  566. is_class(procdefcoll^.data.rettype.def) and
  567. is_class(hp.rettype.def) and
  568. (tobjectdef(hp.rettype.def).is_related(
  569. tobjectdef(procdefcoll^.data.rettype.def)))) then
  570. Message2(parser_e_overridden_methods_not_same_ret,hp.fullprocnamewithret,
  571. procdefcoll^.data.fullprocnamewithret);
  572. { now set the number }
  573. hp.extnumber:=procdefcoll^.data.extnumber;
  574. { and exchange }
  575. procdefcoll^.data:=hp;
  576. stored:=true;
  577. goto handlenextdef;
  578. end; { same parameters }
  579. procdefcoll:=procdefcoll^.next;
  580. end;
  581. { if it isn't saved in the list }
  582. { we create a new entry }
  583. if not(stored) then
  584. begin
  585. new(procdefcoll);
  586. procdefcoll^.data:=hp;
  587. procdefcoll^.next:=symcoll^.data;
  588. symcoll^.data:=procdefcoll;
  589. { if the method is virtual ... }
  590. if (po_virtualmethod in hp.procoptions) then
  591. begin
  592. { ... it will get a number }
  593. hp.extnumber:=nextvirtnumber;
  594. inc(nextvirtnumber);
  595. end;
  596. { check, if a method should be overridden }
  597. if (po_overridingmethod in hp.procoptions) then
  598. MessagePos1(hp.fileinfo,parser_e_nothing_to_be_overridden,
  599. hp.fullprocname);
  600. end;
  601. handlenextdef:
  602. hp:=hp.nextoverloaded;
  603. end;
  604. exit;
  605. end;
  606. symcoll:=symcoll^.next;
  607. end;
  608. newentry;
  609. end;
  610. end;
  611. procedure tclassheader.disposevmttree;
  612. var
  613. symcoll : psymcoll;
  614. procdefcoll : pprocdefcoll;
  615. begin
  616. { disposes the above generated tree }
  617. symcoll:=wurzel;
  618. while assigned(symcoll) do
  619. begin
  620. wurzel:=symcoll^.next;
  621. stringdispose(symcoll^.name);
  622. procdefcoll:=symcoll^.data;
  623. while assigned(procdefcoll) do
  624. begin
  625. symcoll^.data:=procdefcoll^.next;
  626. dispose(procdefcoll);
  627. procdefcoll:=symcoll^.data;
  628. end;
  629. dispose(symcoll);
  630. symcoll:=wurzel;
  631. end;
  632. end;
  633. procedure tclassheader.genvmt;
  634. procedure do_genvmt(p : tobjectdef);
  635. begin
  636. { start with the base class }
  637. if assigned(p.childof) then
  638. do_genvmt(p.childof);
  639. { walk through all public syms }
  640. p.symtable.foreach({$ifdef FPCPROCVAR}@{$endif}eachsym);
  641. end;
  642. begin
  643. wurzel:=nil;
  644. nextvirtnumber:=0;
  645. has_constructor:=false;
  646. has_virtual_method:=false;
  647. { generates a tree of all used methods }
  648. do_genvmt(_class);
  649. if has_virtual_method and not(has_constructor) then
  650. Message1(parser_w_virtual_without_constructor,_class.objname^);
  651. end;
  652. {**************************************
  653. Interface tables
  654. **************************************}
  655. function tclassheader.gintfgetvtbllabelname(intfindex: integer): string;
  656. begin
  657. gintfgetvtbllabelname:='VTBL_'+current_module.modulename^+'$_'+upper(_class.objname^)+
  658. '_$$_'+upper(_class.implementedinterfaces.interfaces(intfindex).objname^);
  659. end;
  660. procedure tclassheader.gintfcreatevtbl(intfindex: integer; rawdata,rawcode: TAAsmoutput);
  661. var
  662. implintf: timplementedinterfaces;
  663. curintf: tobjectdef;
  664. proccount: integer;
  665. tmps: string;
  666. i: longint;
  667. begin
  668. implintf:=_class.implementedinterfaces;
  669. curintf:=implintf.interfaces(intfindex);
  670. if (cs_create_smart in aktmoduleswitches) then
  671. rawdata.concat(Tai_symbol.Createname_global(gintfgetvtbllabelname(intfindex),0))
  672. else
  673. rawdata.concat(Tai_symbol.Createname(gintfgetvtbllabelname(intfindex),0));
  674. proccount:=implintf.implproccount(intfindex);
  675. for i:=1 to proccount do
  676. begin
  677. tmps:=implintf.implprocs(intfindex,i).mangledname+'_$$_'+upper(curintf.objname^);
  678. { create wrapper code }
  679. cgintfwrapper(rawcode,implintf.implprocs(intfindex,i),tmps,implintf.ioffsets(intfindex)^);
  680. { create reference }
  681. rawdata.concat(Tai_const_symbol.Createname(tmps));
  682. end;
  683. end;
  684. procedure tclassheader.gintfgenentry(intfindex, contintfindex: integer; rawdata: TAAsmoutput);
  685. var
  686. implintf: timplementedinterfaces;
  687. curintf: tobjectdef;
  688. tmplabel: tasmlabel;
  689. i: longint;
  690. begin
  691. implintf:=_class.implementedinterfaces;
  692. curintf:=implintf.interfaces(intfindex);
  693. { GUID }
  694. if curintf.objecttype in [odt_interfacecom] then
  695. begin
  696. { label for GUID }
  697. getdatalabel(tmplabel);
  698. rawdata.concat(Tai_label.Create(tmplabel));
  699. rawdata.concat(Tai_const.Create_32bit(curintf.iidguid.D1));
  700. rawdata.concat(Tai_const.Create_16bit(curintf.iidguid.D2));
  701. rawdata.concat(Tai_const.Create_16bit(curintf.iidguid.D3));
  702. for i:=Low(curintf.iidguid.D4) to High(curintf.iidguid.D4) do
  703. rawdata.concat(Tai_const.Create_8bit(curintf.iidguid.D4[i]));
  704. dataSegment.concat(Tai_const_symbol.Create(tmplabel));
  705. end
  706. else
  707. begin
  708. { nil for Corba interfaces }
  709. dataSegment.concat(Tai_const.Create_32bit(0)); { nil }
  710. end;
  711. { VTable }
  712. dataSegment.concat(Tai_const_symbol.Createname(gintfgetvtbllabelname(contintfindex)));
  713. { IOffset field }
  714. dataSegment.concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)^));
  715. { IIDStr }
  716. getdatalabel(tmplabel);
  717. rawdata.concat(Tai_label.Create(tmplabel));
  718. rawdata.concat(Tai_const.Create_8bit(length(curintf.iidstr^)));
  719. if curintf.objecttype=odt_interfacecom then
  720. rawdata.concat(Tai_string.Create(upper(curintf.iidstr^)))
  721. else
  722. rawdata.concat(Tai_string.Create(curintf.iidstr^));
  723. dataSegment.concat(Tai_const_symbol.Create(tmplabel));
  724. end;
  725. procedure tclassheader.gintfoptimizevtbls(implvtbl : plongint);
  726. type
  727. tcompintfentry = record
  728. weight: longint;
  729. compintf: longint;
  730. end;
  731. { Max 1000 interface in the class header interfaces it's enough imho }
  732. tcompintfs = packed array[1..1000] of tcompintfentry;
  733. pcompintfs = ^tcompintfs;
  734. tequals = packed array[1..1000] of longint;
  735. pequals = ^tequals;
  736. var
  737. max: longint;
  738. equals: pequals;
  739. compats: pcompintfs;
  740. i: longint;
  741. j: longint;
  742. w: longint;
  743. cij: boolean;
  744. cji: boolean;
  745. begin
  746. max:=_class.implementedinterfaces.count;
  747. if max>High(tequals) then
  748. Internalerror(200006135);
  749. getmem(compats,sizeof(tcompintfentry)*max);
  750. getmem(equals,sizeof(longint)*max);
  751. fillchar(compats^,sizeof(tcompintfentry)*max,0);
  752. fillchar(equals^,sizeof(longint)*max,0);
  753. { ismergepossible is a containing relation
  754. meaning of ismergepossible(a,b,w) =
  755. if implementorfunction map of a is contained implementorfunction map of b
  756. imp(a,b) and imp(b,c) => imp(a,c) ; imp(a,b) and imp(b,a) => a == b
  757. }
  758. { the order is very important for correct allocation }
  759. for i:=1 to max do
  760. begin
  761. for j:=i+1 to max do
  762. begin
  763. cij:=_class.implementedinterfaces.isimplmergepossible(i,j,w);
  764. cji:=_class.implementedinterfaces.isimplmergepossible(j,i,w);
  765. if cij and cji then { i equal j }
  766. begin
  767. { get minimum index of equal }
  768. if equals^[j]=0 then
  769. equals^[j]:=i;
  770. end
  771. else if cij then
  772. begin
  773. { get minimum index of maximum weight }
  774. if compats^[i].weight<w then
  775. begin
  776. compats^[i].weight:=w;
  777. compats^[i].compintf:=j;
  778. end;
  779. end
  780. else if cji then
  781. begin
  782. { get minimum index of maximum weight }
  783. if (compats^[j].weight<w) then
  784. begin
  785. compats^[j].weight:=w;
  786. compats^[j].compintf:=i;
  787. end;
  788. end;
  789. end;
  790. end;
  791. for i:=1 to max do
  792. begin
  793. if compats^[i].compintf<>0 then
  794. implvtbl[i]:=compats^[i].compintf
  795. else if equals^[i]<>0 then
  796. implvtbl[i]:=equals^[i]
  797. else
  798. implvtbl[i]:=i;
  799. end;
  800. freemem(compats,sizeof(tcompintfentry)*max);
  801. freemem(equals,sizeof(longint)*max);
  802. end;
  803. procedure tclassheader.gintfwritedata;
  804. var
  805. rawdata,rawcode: taasmoutput;
  806. impintfindexes: plongint;
  807. max: longint;
  808. i: longint;
  809. begin
  810. max:=_class.implementedinterfaces.count;
  811. getmem(impintfindexes,(max+1)*sizeof(longint));
  812. gintfoptimizevtbls(impintfindexes);
  813. rawdata:=TAAsmOutput.Create;
  814. rawcode:=TAAsmOutput.Create;
  815. dataSegment.concat(Tai_const.Create_16bit(max));
  816. { Two pass, one for allocation and vtbl creation }
  817. for i:=1 to max do
  818. begin
  819. if impintfindexes[i]=i then { if implement itself }
  820. begin
  821. { allocate a pointer in the object memory }
  822. with tstoredsymtable(_class.symtable) do
  823. begin
  824. if (dataalignment>=target_info.size_of_pointer) then
  825. datasize:=align(datasize,dataalignment)
  826. else
  827. datasize:=align(datasize,target_info.size_of_pointer);
  828. _class.implementedinterfaces.ioffsets(i)^:=datasize;
  829. datasize:=datasize+target_info.size_of_pointer;
  830. end;
  831. { write vtbl }
  832. gintfcreatevtbl(i,rawdata,rawcode);
  833. end;
  834. end;
  835. { second pass: for fill interfacetable and remained ioffsets }
  836. for i:=1 to max do
  837. begin
  838. if i<>impintfindexes[i] then { why execute x:=x ? }
  839. with _class.implementedinterfaces do
  840. ioffsets(i)^:=ioffsets(impintfindexes[i])^;
  841. gintfgenentry(i,impintfindexes[i],rawdata);
  842. end;
  843. dataSegment.concatlist(rawdata);
  844. rawdata.free;
  845. codeSegment.concatlist(rawcode);
  846. rawcode.free;
  847. freemem(impintfindexes,(max+1)*sizeof(longint));
  848. end;
  849. function tclassheader.gintfgetcprocdef(proc: tprocdef;const name: string): tprocdef;
  850. var
  851. sym: tprocsym;
  852. implprocdef: tprocdef;
  853. begin
  854. implprocdef:=nil;
  855. sym:=tprocsym(search_class_member(_class,name));
  856. if assigned(sym) and (sym.typ=procsym) then
  857. begin
  858. implprocdef:=sym.definition;
  859. while assigned(implprocdef) and not equal_paras(proc.para,implprocdef.para,cp_none) and
  860. (proc.proccalloptions<>implprocdef.proccalloptions) do
  861. implprocdef:=implprocdef.nextoverloaded;
  862. end;
  863. gintfgetcprocdef:=implprocdef;
  864. end;
  865. procedure tclassheader.gintfdoonintf(intf: tobjectdef; intfindex: longint);
  866. var
  867. i: longint;
  868. proc: tprocdef;
  869. procname: string; { for error }
  870. mappedname: string;
  871. nextexist: pointer;
  872. implprocdef: tprocdef;
  873. begin
  874. for i:=1 to intf.symtable.defindex.count do
  875. begin
  876. proc:=tprocdef(intf.symtable.defindex.search(i));
  877. if proc.deftype=procdef then
  878. begin
  879. procname:='';
  880. implprocdef:=nil;
  881. nextexist:=nil;
  882. repeat
  883. mappedname:=_class.implementedinterfaces.getmappings(intfindex,proc.procsym.name,nextexist);
  884. if procname='' then
  885. procname:=proc.procsym.name;
  886. //mappedname; { for error messages }
  887. if mappedname<>'' then
  888. implprocdef:=gintfgetcprocdef(proc,mappedname);
  889. until assigned(implprocdef) or not assigned(nextexist);
  890. if not assigned(implprocdef) then
  891. implprocdef:=gintfgetcprocdef(proc,proc.procsym.name);
  892. if procname='' then
  893. procname:=proc.procsym.name;
  894. if assigned(implprocdef) then
  895. _class.implementedinterfaces.addimplproc(intfindex,implprocdef)
  896. else
  897. Message1(sym_e_id_not_found,procname);
  898. end;
  899. end;
  900. end;
  901. procedure tclassheader.gintfwalkdowninterface(intf: tobjectdef; intfindex: longint);
  902. begin
  903. if assigned(intf.childof) then
  904. gintfwalkdowninterface(intf.childof,intfindex);
  905. gintfdoonintf(intf,intfindex);
  906. end;
  907. function tclassheader.genintftable: tasmlabel;
  908. var
  909. intfindex: longint;
  910. curintf: tobjectdef;
  911. intftable: tasmlabel;
  912. begin
  913. { 1. step collect implementor functions into the implementedinterfaces.implprocs }
  914. for intfindex:=1 to _class.implementedinterfaces.count do
  915. begin
  916. curintf:=_class.implementedinterfaces.interfaces(intfindex);
  917. gintfwalkdowninterface(curintf,intfindex);
  918. end;
  919. { 2. step calc required fieldcount and their offsets in the object memory map
  920. and write data }
  921. getdatalabel(intftable);
  922. dataSegment.concat(Tai_label.Create(intftable));
  923. gintfwritedata;
  924. _class.implementedinterfaces.clearimplprocs; { release temporary information }
  925. genintftable:=intftable;
  926. end;
  927. { Write interface identifiers to the data section }
  928. procedure tclassheader.writeinterfaceids;
  929. var
  930. i: longint;
  931. s1,s2 : string;
  932. begin
  933. if _class.owner.name=nil then
  934. s1:=''
  935. else
  936. s1:=upper(_class.owner.name^);
  937. if _class.objname=nil then
  938. s2:=''
  939. else
  940. s2:=upper(_class.objname^);
  941. s1:=s1+'$_'+s2;
  942. if _class.isiidguidvalid then
  943. begin
  944. if (cs_create_smart in aktmoduleswitches) then
  945. dataSegment.concat(Tai_cut.Create);
  946. dataSegment.concat(Tai_symbol.Createname_global('IID$_'+s1,0));
  947. dataSegment.concat(Tai_const.Create_32bit(longint(_class.iidguid.D1)));
  948. dataSegment.concat(Tai_const.Create_16bit(_class.iidguid.D2));
  949. dataSegment.concat(Tai_const.Create_16bit(_class.iidguid.D3));
  950. for i:=Low(_class.iidguid.D4) to High(_class.iidguid.D4) do
  951. dataSegment.concat(Tai_const.Create_8bit(_class.iidguid.D4[i]));
  952. end;
  953. if (cs_create_smart in aktmoduleswitches) then
  954. dataSegment.concat(Tai_cut.Create);
  955. dataSegment.concat(Tai_symbol.Createname_global('IIDSTR$_'+s1,0));
  956. dataSegment.concat(Tai_const.Create_8bit(length(_class.iidstr^)));
  957. dataSegment.concat(Tai_string.Create(_class.iidstr^));
  958. end;
  959. procedure tclassheader.writevirtualmethods(List:TAAsmoutput);
  960. var
  961. symcoll : psymcoll;
  962. procdefcoll : pprocdefcoll;
  963. i : longint;
  964. begin
  965. { walk trough all numbers for virtual methods and search }
  966. { the method }
  967. for i:=0 to nextvirtnumber-1 do
  968. begin
  969. symcoll:=wurzel;
  970. { walk trough all symbols }
  971. while assigned(symcoll) do
  972. begin
  973. { walk trough all methods }
  974. procdefcoll:=symcoll^.data;
  975. while assigned(procdefcoll) do
  976. begin
  977. { writes the addresses to the VMT }
  978. { but only this which are declared as virtual }
  979. if procdefcoll^.data.extnumber=i then
  980. begin
  981. if (po_virtualmethod in procdefcoll^.data.procoptions) then
  982. begin
  983. { if a method is abstract, then is also the }
  984. { class abstract and it's not allow to }
  985. { generates an instance }
  986. if (po_abstractmethod in procdefcoll^.data.procoptions) then
  987. begin
  988. include(_class.objectoptions,oo_has_abstract);
  989. List.concat(Tai_const_symbol.Createname('FPC_ABSTRACTERROR'));
  990. end
  991. else
  992. begin
  993. List.concat(Tai_const_symbol.createname(procdefcoll^.data.mangledname));
  994. end;
  995. end;
  996. end;
  997. procdefcoll:=procdefcoll^.next;
  998. end;
  999. symcoll:=symcoll^.next;
  1000. end;
  1001. end;
  1002. end;
  1003. { generates the vmt for classes as well as for objects }
  1004. procedure tclassheader.writevmt;
  1005. var
  1006. methodnametable,intmessagetable,
  1007. strmessagetable,classnamelabel,
  1008. fieldtablelabel : tasmlabel;
  1009. {$ifdef WITHDMT}
  1010. dmtlabel : tasmlabel;
  1011. {$endif WITHDMT}
  1012. interfacetable : tasmlabel;
  1013. begin
  1014. {$ifdef WITHDMT}
  1015. dmtlabel:=gendmt;
  1016. {$endif WITHDMT}
  1017. if (cs_create_smart in aktmoduleswitches) then
  1018. dataSegment.concat(Tai_cut.Create);
  1019. { write tables for classes, this must be done before the actual
  1020. class is written, because we need the labels defined }
  1021. if is_class(_class) then
  1022. begin
  1023. { interface table }
  1024. if _class.implementedinterfaces.count>0 then
  1025. begin
  1026. if (cs_create_smart in aktmoduleswitches) then
  1027. codeSegment.concat(Tai_cut.Create);
  1028. interfacetable:=genintftable;
  1029. end;
  1030. methodnametable:=genpublishedmethodstable;
  1031. fieldtablelabel:=_class.generate_field_table;
  1032. { write class name }
  1033. getdatalabel(classnamelabel);
  1034. dataSegment.concat(Tai_label.Create(classnamelabel));
  1035. dataSegment.concat(Tai_const.Create_8bit(length(_class.objname^)));
  1036. dataSegment.concat(Tai_string.Create(_class.objname^));
  1037. { generate message and dynamic tables }
  1038. if (oo_has_msgstr in _class.objectoptions) then
  1039. strmessagetable:=genstrmsgtab;
  1040. if (oo_has_msgint in _class.objectoptions) then
  1041. intmessagetable:=genintmsgtab
  1042. else
  1043. dataSegment.concat(Tai_const.Create_32bit(0));
  1044. end;
  1045. { write debug info }
  1046. {$ifdef GDB}
  1047. if (cs_debuginfo in aktmoduleswitches) then
  1048. begin
  1049. do_count_dbx:=true;
  1050. if assigned(_class.owner) and assigned(_class.owner.name) then
  1051. dataSegment.concat(Tai_stabs.Create(strpnew('"vmt_'+_class.owner.name^+_class.name+':S'+
  1052. typeglobalnumber('__vtbl_ptr_type')+'",'+tostr(N_STSYM)+',0,0,'+_class.vmt_mangledname)));
  1053. end;
  1054. {$endif GDB}
  1055. dataSegment.concat(Tai_symbol.Createdataname_global(_class.vmt_mangledname,0));
  1056. { determine the size with symtable.datasize, because }
  1057. { size gives back 4 for classes }
  1058. dataSegment.concat(Tai_const.Create_32bit(_class.symtable.datasize));
  1059. dataSegment.concat(Tai_const.Create_32bit(-_class.symtable.datasize));
  1060. {$ifdef WITHDMT}
  1061. if _class.classtype=ct_object then
  1062. begin
  1063. if assigned(dmtlabel) then
  1064. dataSegment.concat(Tai_const_symbol.Create(dmtlabel)))
  1065. else
  1066. dataSegment.concat(Tai_const.Create_32bit(0));
  1067. end;
  1068. {$endif WITHDMT}
  1069. { write pointer to parent VMT, this isn't implemented in TP }
  1070. { but this is not used in FPC ? (PM) }
  1071. { it's not used yet, but the delphi-operators as and is need it (FK) }
  1072. { it is not written for parents that don't have any vmt !! }
  1073. if assigned(_class.childof) and
  1074. (oo_has_vmt in _class.childof.objectoptions) then
  1075. dataSegment.concat(Tai_const_symbol.Createname(_class.childof.vmt_mangledname))
  1076. else
  1077. dataSegment.concat(Tai_const.Create_32bit(0));
  1078. { write extended info for classes, for the order see rtl/inc/objpash.inc }
  1079. if is_class(_class) then
  1080. begin
  1081. { pointer to class name string }
  1082. dataSegment.concat(Tai_const_symbol.Create(classnamelabel));
  1083. { pointer to dynamic table }
  1084. if (oo_has_msgint in _class.objectoptions) then
  1085. dataSegment.concat(Tai_const_symbol.Create(intmessagetable))
  1086. else
  1087. dataSegment.concat(Tai_const.Create_32bit(0));
  1088. { pointer to method table }
  1089. if assigned(methodnametable) then
  1090. dataSegment.concat(Tai_const_symbol.Create(methodnametable))
  1091. else
  1092. dataSegment.concat(Tai_const.Create_32bit(0));
  1093. { pointer to field table }
  1094. dataSegment.concat(Tai_const_symbol.Create(fieldtablelabel));
  1095. { pointer to type info of published section }
  1096. if (oo_can_have_published in _class.objectoptions) then
  1097. dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(fullrtti)))
  1098. else
  1099. dataSegment.concat(Tai_const.Create_32bit(0));
  1100. { inittable for con-/destruction, for classes this is always generated }
  1101. dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(initrtti)));
  1102. { auto table }
  1103. dataSegment.concat(Tai_const.Create_32bit(0));
  1104. { interface table }
  1105. if _class.implementedinterfaces.count>0 then
  1106. dataSegment.concat(Tai_const_symbol.Create(interfacetable))
  1107. else
  1108. dataSegment.concat(Tai_const.Create_32bit(0));
  1109. { table for string messages }
  1110. if (oo_has_msgstr in _class.objectoptions) then
  1111. dataSegment.concat(Tai_const_symbol.Create(strmessagetable))
  1112. else
  1113. dataSegment.concat(Tai_const.Create_32bit(0));
  1114. end;
  1115. { write virtual methods }
  1116. writevirtualmethods(dataSegment);
  1117. { write the size of the VMT }
  1118. dataSegment.concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
  1119. end;
  1120. initialization
  1121. cclassheader:=tclassheader;
  1122. end.
  1123. {
  1124. $Log$
  1125. Revision 1.5 2001-10-20 17:20:14 peter
  1126. * fixed generation of rtti for virtualmethods
  1127. Revision 1.4 2001/09/19 11:04:42 michael
  1128. * Smartlinking with interfaces fixed
  1129. * Better smartlinking for rtti and init tables
  1130. Revision 1.3 2001/08/30 20:13:53 peter
  1131. * rtti/init table updates
  1132. * rttisym for reusable global rtti/init info
  1133. * support published for interfaces
  1134. Revision 1.2 2001/08/22 21:16:20 florian
  1135. * some interfaces related problems regarding
  1136. mapping of interface implementions fixed
  1137. Revision 1.1 2001/04/21 13:37:16 peter
  1138. * made tclassheader using class of to implement cpu dependent code
  1139. Revision 1.20 2001/04/18 22:01:54 peter
  1140. * registration of targets and assemblers
  1141. Revision 1.19 2001/04/13 01:22:07 peter
  1142. * symtable change to classes
  1143. * range check generation and errors fixed, make cycle DEBUG=1 works
  1144. * memory leaks fixed
  1145. Revision 1.18 2001/04/04 21:30:43 florian
  1146. * applied several fixes to get the DD8 Delphi Unit compiled
  1147. e.g. "forward"-interfaces are working now
  1148. Revision 1.17 2000/12/25 00:07:26 peter
  1149. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  1150. tlinkedlist objects)
  1151. Revision 1.16 2000/11/29 00:30:30 florian
  1152. * unused units removed from uses clause
  1153. * some changes for widestrings
  1154. Revision 1.15 2000/11/19 16:23:35 florian
  1155. *** empty log message ***
  1156. Revision 1.14 2000/11/12 23:24:10 florian
  1157. * interfaces are basically running
  1158. Revision 1.13 2000/11/08 00:07:40 florian
  1159. * potential range check error fixed
  1160. Revision 1.12 2000/11/06 23:13:53 peter
  1161. * uppercase manglednames
  1162. Revision 1.11 2000/11/04 17:31:00 florian
  1163. * fixed some problems of previous commit
  1164. Revision 1.10 2000/11/04 14:25:19 florian
  1165. + merged Attila's changes for interfaces, not tested yet
  1166. Revision 1.9 2000/11/01 23:04:37 peter
  1167. * tprocdef.fullprocname added for better casesensitve writing of
  1168. procedures
  1169. Revision 1.8 2000/10/31 22:02:47 peter
  1170. * symtable splitted, no real code changes
  1171. Revision 1.7 2000/10/14 10:14:47 peter
  1172. * moehrendorf oct 2000 rewrite
  1173. Revision 1.6 2000/09/24 21:19:50 peter
  1174. * delphi compile fixes
  1175. Revision 1.5 2000/09/24 15:06:17 peter
  1176. * use defines.inc
  1177. Revision 1.4 2000/08/27 16:11:51 peter
  1178. * moved some util functions from globals,cobjects to cutils
  1179. * splitted files into finput,fmodule
  1180. Revision 1.3 2000/07/13 12:08:26 michael
  1181. + patched to 1.1.0 with former 1.09patch from peter
  1182. Revision 1.2 2000/07/13 11:32:41 michael
  1183. + removed logs
  1184. }