nobj.pas 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377
  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 : pprocdeflist;
  190. pt : pprocdeftree;
  191. begin
  192. if tsym(p).typ=procsym then
  193. begin
  194. hp:=tprocsym(p).defs;
  195. while assigned(hp) do
  196. begin
  197. if (po_msgint in hp^.def.procoptions) then
  198. begin
  199. new(pt);
  200. pt^.data:=hp^.def;
  201. pt^.l:=nil;
  202. pt^.r:=nil;
  203. insertint(pt,root);
  204. end;
  205. hp:=hp^.next;
  206. end;
  207. end;
  208. end;
  209. procedure tclassheader.insertmsgstr(p : tnamedindexitem);
  210. var
  211. hp : pprocdeflist;
  212. pt : pprocdeftree;
  213. begin
  214. if tsym(p).typ=procsym then
  215. begin
  216. hp:=tprocsym(p).defs;
  217. while assigned(hp) do
  218. begin
  219. if (po_msgstr in hp^.def.procoptions) then
  220. begin
  221. new(pt);
  222. pt^.data:=hp^.def;
  223. pt^.l:=nil;
  224. pt^.r:=nil;
  225. insertstr(pt,root);
  226. end;
  227. hp:=hp^.next;
  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. if assigned(tprocsym(p).defs^.next) then
  388. internalerror(1209992);
  389. hp:=tprocsym(p).defs^.def;
  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 : pprocdeflist;
  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. { inserts all definitions }
  435. hp:=tprocsym(sym).defs;
  436. while assigned(hp) do
  437. begin
  438. new(procdefcoll);
  439. procdefcoll^.data:=hp^.def;
  440. procdefcoll^.next:=symcoll^.data;
  441. symcoll^.data:=procdefcoll;
  442. { if it's a virtual method }
  443. if (po_virtualmethod in hp^.def.procoptions) then
  444. begin
  445. { then it gets a number ... }
  446. hp^.def.extnumber:=nextvirtnumber;
  447. { and we inc the number }
  448. inc(nextvirtnumber);
  449. has_virtual_method:=true;
  450. end;
  451. if (hp^.def.proctypeoption=potype_constructor) then
  452. has_constructor:=true;
  453. { check, if a method should be overridden }
  454. if (po_overridingmethod in hp^.def.procoptions) then
  455. MessagePos1(hp^.def.fileinfo,parser_e_nothing_to_be_overridden,_class.objname^+'.'+_name+hp^.def.demangled_paras);
  456. { next overloaded method }
  457. hp:=hp^.next;
  458. end;
  459. end;
  460. procedure newdefentry;
  461. begin
  462. new(procdefcoll);
  463. procdefcoll^.data:=hp^.def;
  464. procdefcoll^.next:=symcoll^.data;
  465. symcoll^.data:=procdefcoll;
  466. { if it's a virtual method }
  467. if (po_virtualmethod in hp^.def.procoptions) then
  468. begin
  469. { then it gets a number ... }
  470. hp^.def.extnumber:=nextvirtnumber;
  471. { and we inc the number }
  472. inc(nextvirtnumber);
  473. has_virtual_method:=true;
  474. end;
  475. if (hp^.def.proctypeoption=potype_constructor) then
  476. has_constructor:=true;
  477. { check, if a method should be overridden }
  478. if (po_overridingmethod in hp^.def.procoptions) then
  479. MessagePos1(hp^.def.fileinfo,parser_e_nothing_to_be_overridden,_class.objname^+'.'+_name+hp^.def.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).defs;
  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^.def.para,cp_all) and
  505. (
  506. (po_virtualmethod in procdefcoll^.data.procoptions) or
  507. (po_virtualmethod in hp^.def.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^.def.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^.def._class then
  522. Message1(parser_w_should_use_override,hp^.def.fullprocname);
  523. end
  524. else
  525. if _class=hp^.def._class then
  526. begin
  527. if (po_virtualmethod in procdefcoll^.data.procoptions) then
  528. Message1(parser_w_overloaded_are_not_both_virtual,
  529. hp^.def.fullprocname)
  530. else
  531. Message1(parser_w_overloaded_are_not_both_non_virtual,
  532. hp^.def.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.proccalloption<>hp^.def.proccalloption) or
  543. (procdefcoll^.data.proctypeoption<>hp^.def.proctypeoption) or
  544. ((procdefcoll^.data.procoptions-
  545. [po_abstractmethod,po_overridingmethod,po_assembler,po_overload])<>
  546. (hp^.def.procoptions-[po_abstractmethod,po_overridingmethod,po_assembler,po_overload])) then
  547. Message1(parser_e_header_dont_match_forward,hp^.def.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^.def.procoptions) then
  553. begin
  554. { warn only if it is the first time,
  555. we hide the method }
  556. if _class=hp^.def._class then
  557. Message1(parser_w_should_use_override,hp^.def.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^.def.rettype.def)) and
  564. not((procdefcoll^.data.rettype.def.deftype=objectdef) and
  565. (hp^.def.rettype.def.deftype=objectdef) and
  566. is_class(procdefcoll^.data.rettype.def) and
  567. is_class(hp^.def.rettype.def) and
  568. (tobjectdef(hp^.def.rettype.def).is_related(
  569. tobjectdef(procdefcoll^.data.rettype.def)))) then
  570. Message2(parser_e_overridden_methods_not_same_ret,hp^.def.fullprocnamewithret,
  571. procdefcoll^.data.fullprocnamewithret);
  572. { now set the number }
  573. hp^.def.extnumber:=procdefcoll^.data.extnumber;
  574. { and exchange }
  575. procdefcoll^.data:=hp^.def;
  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^.def;
  587. procdefcoll^.next:=symcoll^.data;
  588. symcoll^.data:=procdefcoll;
  589. { if the method is virtual ... }
  590. if (po_virtualmethod in hp^.def.procoptions) then
  591. begin
  592. { ... it will get a number }
  593. hp^.def.extnumber:=nextvirtnumber;
  594. inc(nextvirtnumber);
  595. end;
  596. { check, if a method should be overridden }
  597. if (po_overridingmethod in hp^.def.procoptions) then
  598. MessagePos1(hp^.def.fileinfo,parser_e_nothing_to_be_overridden,
  599. hp^.def.fullprocname);
  600. end;
  601. handlenextdef:
  602. hp:=hp^.next;
  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 not(is_interface(_class)) and
  650. has_virtual_method and
  651. not(has_constructor) then
  652. Message1(parser_w_virtual_without_constructor,_class.objname^);
  653. end;
  654. {**************************************
  655. Interface tables
  656. **************************************}
  657. function tclassheader.gintfgetvtbllabelname(intfindex: integer): string;
  658. begin
  659. gintfgetvtbllabelname:='VTBL_'+current_module.modulename^+'$_'+upper(_class.objname^)+
  660. '_$$_'+upper(_class.implementedinterfaces.interfaces(intfindex).objname^);
  661. end;
  662. procedure tclassheader.gintfcreatevtbl(intfindex: integer; rawdata,rawcode: TAAsmoutput);
  663. var
  664. implintf: timplementedinterfaces;
  665. curintf: tobjectdef;
  666. proccount: integer;
  667. tmps: string;
  668. i: longint;
  669. begin
  670. implintf:=_class.implementedinterfaces;
  671. curintf:=implintf.interfaces(intfindex);
  672. if (cs_create_smart in aktmoduleswitches) then
  673. rawdata.concat(Tai_symbol.Createname_global(gintfgetvtbllabelname(intfindex),0))
  674. else
  675. rawdata.concat(Tai_symbol.Createname(gintfgetvtbllabelname(intfindex),0));
  676. proccount:=implintf.implproccount(intfindex);
  677. for i:=1 to proccount do
  678. begin
  679. tmps:=implintf.implprocs(intfindex,i).mangledname+'_$$_'+upper(curintf.objname^);
  680. { create wrapper code }
  681. cgintfwrapper(rawcode,implintf.implprocs(intfindex,i),tmps,implintf.ioffsets(intfindex)^);
  682. { create reference }
  683. rawdata.concat(Tai_const_symbol.Createname(tmps));
  684. end;
  685. end;
  686. procedure tclassheader.gintfgenentry(intfindex, contintfindex: integer; rawdata: TAAsmoutput);
  687. var
  688. implintf: timplementedinterfaces;
  689. curintf: tobjectdef;
  690. tmplabel: tasmlabel;
  691. i: longint;
  692. begin
  693. implintf:=_class.implementedinterfaces;
  694. curintf:=implintf.interfaces(intfindex);
  695. { GUID }
  696. if curintf.objecttype in [odt_interfacecom] then
  697. begin
  698. { label for GUID }
  699. getdatalabel(tmplabel);
  700. rawdata.concat(Tai_label.Create(tmplabel));
  701. rawdata.concat(Tai_const.Create_32bit(curintf.iidguid.D1));
  702. rawdata.concat(Tai_const.Create_16bit(curintf.iidguid.D2));
  703. rawdata.concat(Tai_const.Create_16bit(curintf.iidguid.D3));
  704. for i:=Low(curintf.iidguid.D4) to High(curintf.iidguid.D4) do
  705. rawdata.concat(Tai_const.Create_8bit(curintf.iidguid.D4[i]));
  706. dataSegment.concat(Tai_const_symbol.Create(tmplabel));
  707. end
  708. else
  709. begin
  710. { nil for Corba interfaces }
  711. dataSegment.concat(Tai_const.Create_32bit(0)); { nil }
  712. end;
  713. { VTable }
  714. dataSegment.concat(Tai_const_symbol.Createname(gintfgetvtbllabelname(contintfindex)));
  715. { IOffset field }
  716. dataSegment.concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)^));
  717. { IIDStr }
  718. getdatalabel(tmplabel);
  719. rawdata.concat(Tai_label.Create(tmplabel));
  720. rawdata.concat(Tai_const.Create_8bit(length(curintf.iidstr^)));
  721. if curintf.objecttype=odt_interfacecom then
  722. rawdata.concat(Tai_string.Create(upper(curintf.iidstr^)))
  723. else
  724. rawdata.concat(Tai_string.Create(curintf.iidstr^));
  725. dataSegment.concat(Tai_const_symbol.Create(tmplabel));
  726. end;
  727. procedure tclassheader.gintfoptimizevtbls(implvtbl : plongint);
  728. type
  729. tcompintfentry = record
  730. weight: longint;
  731. compintf: longint;
  732. end;
  733. { Max 1000 interface in the class header interfaces it's enough imho }
  734. tcompintfs = packed array[1..1000] of tcompintfentry;
  735. pcompintfs = ^tcompintfs;
  736. tequals = packed array[1..1000] of longint;
  737. pequals = ^tequals;
  738. var
  739. max: longint;
  740. equals: pequals;
  741. compats: pcompintfs;
  742. i: longint;
  743. j: longint;
  744. w: longint;
  745. cij: boolean;
  746. cji: boolean;
  747. begin
  748. max:=_class.implementedinterfaces.count;
  749. if max>High(tequals) then
  750. Internalerror(200006135);
  751. getmem(compats,sizeof(tcompintfentry)*max);
  752. getmem(equals,sizeof(longint)*max);
  753. fillchar(compats^,sizeof(tcompintfentry)*max,0);
  754. fillchar(equals^,sizeof(longint)*max,0);
  755. { ismergepossible is a containing relation
  756. meaning of ismergepossible(a,b,w) =
  757. if implementorfunction map of a is contained implementorfunction map of b
  758. imp(a,b) and imp(b,c) => imp(a,c) ; imp(a,b) and imp(b,a) => a == b
  759. }
  760. { the order is very important for correct allocation }
  761. for i:=1 to max do
  762. begin
  763. for j:=i+1 to max do
  764. begin
  765. cij:=_class.implementedinterfaces.isimplmergepossible(i,j,w);
  766. cji:=_class.implementedinterfaces.isimplmergepossible(j,i,w);
  767. if cij and cji then { i equal j }
  768. begin
  769. { get minimum index of equal }
  770. if equals^[j]=0 then
  771. equals^[j]:=i;
  772. end
  773. else if cij then
  774. begin
  775. { get minimum index of maximum weight }
  776. if compats^[i].weight<w then
  777. begin
  778. compats^[i].weight:=w;
  779. compats^[i].compintf:=j;
  780. end;
  781. end
  782. else if cji then
  783. begin
  784. { get minimum index of maximum weight }
  785. if (compats^[j].weight<w) then
  786. begin
  787. compats^[j].weight:=w;
  788. compats^[j].compintf:=i;
  789. end;
  790. end;
  791. end;
  792. end;
  793. for i:=1 to max do
  794. begin
  795. if compats^[i].compintf<>0 then
  796. implvtbl[i]:=compats^[i].compintf
  797. else if equals^[i]<>0 then
  798. implvtbl[i]:=equals^[i]
  799. else
  800. implvtbl[i]:=i;
  801. end;
  802. freemem(compats,sizeof(tcompintfentry)*max);
  803. freemem(equals,sizeof(longint)*max);
  804. end;
  805. procedure tclassheader.gintfwritedata;
  806. var
  807. rawdata,rawcode: taasmoutput;
  808. impintfindexes: plongint;
  809. max: longint;
  810. i: longint;
  811. begin
  812. max:=_class.implementedinterfaces.count;
  813. getmem(impintfindexes,(max+1)*sizeof(longint));
  814. gintfoptimizevtbls(impintfindexes);
  815. rawdata:=TAAsmOutput.Create;
  816. rawcode:=TAAsmOutput.Create;
  817. dataSegment.concat(Tai_const.Create_16bit(max));
  818. { Two pass, one for allocation and vtbl creation }
  819. for i:=1 to max do
  820. begin
  821. if impintfindexes[i]=i then { if implement itself }
  822. begin
  823. { allocate a pointer in the object memory }
  824. with tstoredsymtable(_class.symtable) do
  825. begin
  826. if (dataalignment>=target_info.size_of_pointer) then
  827. datasize:=align(datasize,dataalignment)
  828. else
  829. datasize:=align(datasize,target_info.size_of_pointer);
  830. _class.implementedinterfaces.ioffsets(i)^:=datasize;
  831. datasize:=datasize+target_info.size_of_pointer;
  832. end;
  833. { write vtbl }
  834. gintfcreatevtbl(i,rawdata,rawcode);
  835. end;
  836. end;
  837. { second pass: for fill interfacetable and remained ioffsets }
  838. for i:=1 to max do
  839. begin
  840. if i<>impintfindexes[i] then { why execute x:=x ? }
  841. with _class.implementedinterfaces do
  842. ioffsets(i)^:=ioffsets(impintfindexes[i])^;
  843. gintfgenentry(i,impintfindexes[i],rawdata);
  844. end;
  845. dataSegment.concatlist(rawdata);
  846. rawdata.free;
  847. codeSegment.concatlist(rawcode);
  848. rawcode.free;
  849. freemem(impintfindexes,(max+1)*sizeof(longint));
  850. end;
  851. function tclassheader.gintfgetcprocdef(proc: tprocdef;const name: string): tprocdef;
  852. var
  853. sym: tprocsym;
  854. implprocdef : pprocdeflist;
  855. begin
  856. gintfgetcprocdef:=nil;
  857. sym:=tprocsym(search_class_member(_class,name));
  858. if assigned(sym) and (sym.typ=procsym) then
  859. begin
  860. implprocdef:=sym.defs;
  861. while assigned(implprocdef) do
  862. begin
  863. if equal_paras(proc.para,implprocdef^.def.para,cp_none) and
  864. (proc.proccalloption=implprocdef^.def.proccalloption) then
  865. begin
  866. gintfgetcprocdef:=implprocdef^.def;
  867. exit;
  868. end;
  869. implprocdef:=implprocdef^.next;
  870. end;
  871. end;
  872. end;
  873. procedure tclassheader.gintfdoonintf(intf: tobjectdef; intfindex: longint);
  874. var
  875. i: longint;
  876. proc: tprocdef;
  877. procname: string; { for error }
  878. mappedname: string;
  879. nextexist: pointer;
  880. implprocdef: tprocdef;
  881. begin
  882. for i:=1 to intf.symtable.defindex.count do
  883. begin
  884. proc:=tprocdef(intf.symtable.defindex.search(i));
  885. if proc.deftype=procdef then
  886. begin
  887. procname:='';
  888. implprocdef:=nil;
  889. nextexist:=nil;
  890. repeat
  891. mappedname:=_class.implementedinterfaces.getmappings(intfindex,proc.procsym.name,nextexist);
  892. if procname='' then
  893. procname:=proc.procsym.name;
  894. //mappedname; { for error messages }
  895. if mappedname<>'' then
  896. implprocdef:=gintfgetcprocdef(proc,mappedname);
  897. until assigned(implprocdef) or not assigned(nextexist);
  898. if not assigned(implprocdef) then
  899. implprocdef:=gintfgetcprocdef(proc,proc.procsym.name);
  900. if procname='' then
  901. procname:=proc.procsym.name;
  902. if assigned(implprocdef) then
  903. _class.implementedinterfaces.addimplproc(intfindex,implprocdef)
  904. else
  905. Message1(sym_e_id_not_found,procname);
  906. end;
  907. end;
  908. end;
  909. procedure tclassheader.gintfwalkdowninterface(intf: tobjectdef; intfindex: longint);
  910. begin
  911. if assigned(intf.childof) then
  912. gintfwalkdowninterface(intf.childof,intfindex);
  913. gintfdoonintf(intf,intfindex);
  914. end;
  915. function tclassheader.genintftable: tasmlabel;
  916. var
  917. intfindex: longint;
  918. curintf: tobjectdef;
  919. intftable: tasmlabel;
  920. begin
  921. { 1. step collect implementor functions into the implementedinterfaces.implprocs }
  922. for intfindex:=1 to _class.implementedinterfaces.count do
  923. begin
  924. curintf:=_class.implementedinterfaces.interfaces(intfindex);
  925. gintfwalkdowninterface(curintf,intfindex);
  926. end;
  927. { 2. step calc required fieldcount and their offsets in the object memory map
  928. and write data }
  929. getdatalabel(intftable);
  930. dataSegment.concat(Tai_label.Create(intftable));
  931. gintfwritedata;
  932. _class.implementedinterfaces.clearimplprocs; { release temporary information }
  933. genintftable:=intftable;
  934. end;
  935. { Write interface identifiers to the data section }
  936. procedure tclassheader.writeinterfaceids;
  937. var
  938. i: longint;
  939. s1,s2 : string;
  940. begin
  941. if _class.owner.name=nil then
  942. s1:=''
  943. else
  944. s1:=upper(_class.owner.name^);
  945. if _class.objname=nil then
  946. s2:=''
  947. else
  948. s2:=upper(_class.objname^);
  949. s1:=s1+'$_'+s2;
  950. if _class.isiidguidvalid then
  951. begin
  952. if (cs_create_smart in aktmoduleswitches) then
  953. dataSegment.concat(Tai_cut.Create);
  954. dataSegment.concat(Tai_symbol.Createname_global('IID$_'+s1,0));
  955. dataSegment.concat(Tai_const.Create_32bit(longint(_class.iidguid.D1)));
  956. dataSegment.concat(Tai_const.Create_16bit(_class.iidguid.D2));
  957. dataSegment.concat(Tai_const.Create_16bit(_class.iidguid.D3));
  958. for i:=Low(_class.iidguid.D4) to High(_class.iidguid.D4) do
  959. dataSegment.concat(Tai_const.Create_8bit(_class.iidguid.D4[i]));
  960. end;
  961. if (cs_create_smart in aktmoduleswitches) then
  962. dataSegment.concat(Tai_cut.Create);
  963. dataSegment.concat(Tai_symbol.Createname_global('IIDSTR$_'+s1,0));
  964. dataSegment.concat(Tai_const.Create_8bit(length(_class.iidstr^)));
  965. dataSegment.concat(Tai_string.Create(_class.iidstr^));
  966. end;
  967. procedure tclassheader.writevirtualmethods(List:TAAsmoutput);
  968. var
  969. symcoll : psymcoll;
  970. procdefcoll : pprocdefcoll;
  971. i : longint;
  972. begin
  973. { walk trough all numbers for virtual methods and search }
  974. { the method }
  975. for i:=0 to nextvirtnumber-1 do
  976. begin
  977. symcoll:=wurzel;
  978. { walk trough all symbols }
  979. while assigned(symcoll) do
  980. begin
  981. { walk trough all methods }
  982. procdefcoll:=symcoll^.data;
  983. while assigned(procdefcoll) do
  984. begin
  985. { writes the addresses to the VMT }
  986. { but only this which are declared as virtual }
  987. if procdefcoll^.data.extnumber=i then
  988. begin
  989. if (po_virtualmethod in procdefcoll^.data.procoptions) then
  990. begin
  991. { if a method is abstract, then is also the }
  992. { class abstract and it's not allow to }
  993. { generates an instance }
  994. if (po_abstractmethod in procdefcoll^.data.procoptions) then
  995. begin
  996. include(_class.objectoptions,oo_has_abstract);
  997. List.concat(Tai_const_symbol.Createname('FPC_ABSTRACTERROR'));
  998. end
  999. else
  1000. begin
  1001. List.concat(Tai_const_symbol.createname(procdefcoll^.data.mangledname));
  1002. end;
  1003. end;
  1004. end;
  1005. procdefcoll:=procdefcoll^.next;
  1006. end;
  1007. symcoll:=symcoll^.next;
  1008. end;
  1009. end;
  1010. end;
  1011. { generates the vmt for classes as well as for objects }
  1012. procedure tclassheader.writevmt;
  1013. var
  1014. methodnametable,intmessagetable,
  1015. strmessagetable,classnamelabel,
  1016. fieldtablelabel : tasmlabel;
  1017. {$ifdef WITHDMT}
  1018. dmtlabel : tasmlabel;
  1019. {$endif WITHDMT}
  1020. interfacetable : tasmlabel;
  1021. begin
  1022. {$ifdef WITHDMT}
  1023. dmtlabel:=gendmt;
  1024. {$endif WITHDMT}
  1025. if (cs_create_smart in aktmoduleswitches) then
  1026. dataSegment.concat(Tai_cut.Create);
  1027. { write tables for classes, this must be done before the actual
  1028. class is written, because we need the labels defined }
  1029. if is_class(_class) then
  1030. begin
  1031. { interface table }
  1032. if _class.implementedinterfaces.count>0 then
  1033. begin
  1034. if (cs_create_smart in aktmoduleswitches) then
  1035. codeSegment.concat(Tai_cut.Create);
  1036. interfacetable:=genintftable;
  1037. end;
  1038. methodnametable:=genpublishedmethodstable;
  1039. fieldtablelabel:=_class.generate_field_table;
  1040. { write class name }
  1041. getdatalabel(classnamelabel);
  1042. dataSegment.concat(Tai_label.Create(classnamelabel));
  1043. dataSegment.concat(Tai_const.Create_8bit(length(_class.objname^)));
  1044. dataSegment.concat(Tai_string.Create(_class.objname^));
  1045. { generate message and dynamic tables }
  1046. if (oo_has_msgstr in _class.objectoptions) then
  1047. strmessagetable:=genstrmsgtab;
  1048. if (oo_has_msgint in _class.objectoptions) then
  1049. intmessagetable:=genintmsgtab
  1050. else
  1051. dataSegment.concat(Tai_const.Create_32bit(0));
  1052. end;
  1053. { write debug info }
  1054. {$ifdef GDB}
  1055. if (cs_debuginfo in aktmoduleswitches) then
  1056. begin
  1057. do_count_dbx:=true;
  1058. if assigned(_class.owner) and assigned(_class.owner.name) then
  1059. dataSegment.concat(Tai_stabs.Create(strpnew('"vmt_'+_class.owner.name^+_class.name+':S'+
  1060. typeglobalnumber('__vtbl_ptr_type')+'",'+tostr(N_STSYM)+',0,0,'+_class.vmt_mangledname)));
  1061. end;
  1062. {$endif GDB}
  1063. dataSegment.concat(Tai_symbol.Createdataname_global(_class.vmt_mangledname,0));
  1064. { determine the size with symtable.datasize, because }
  1065. { size gives back 4 for classes }
  1066. dataSegment.concat(Tai_const.Create_32bit(_class.symtable.datasize));
  1067. dataSegment.concat(Tai_const.Create_32bit(-_class.symtable.datasize));
  1068. {$ifdef WITHDMT}
  1069. if _class.classtype=ct_object then
  1070. begin
  1071. if assigned(dmtlabel) then
  1072. dataSegment.concat(Tai_const_symbol.Create(dmtlabel)))
  1073. else
  1074. dataSegment.concat(Tai_const.Create_32bit(0));
  1075. end;
  1076. {$endif WITHDMT}
  1077. { write pointer to parent VMT, this isn't implemented in TP }
  1078. { but this is not used in FPC ? (PM) }
  1079. { it's not used yet, but the delphi-operators as and is need it (FK) }
  1080. { it is not written for parents that don't have any vmt !! }
  1081. if assigned(_class.childof) and
  1082. (oo_has_vmt in _class.childof.objectoptions) then
  1083. dataSegment.concat(Tai_const_symbol.Createname(_class.childof.vmt_mangledname))
  1084. else
  1085. dataSegment.concat(Tai_const.Create_32bit(0));
  1086. { write extended info for classes, for the order see rtl/inc/objpash.inc }
  1087. if is_class(_class) then
  1088. begin
  1089. { pointer to class name string }
  1090. dataSegment.concat(Tai_const_symbol.Create(classnamelabel));
  1091. { pointer to dynamic table }
  1092. if (oo_has_msgint in _class.objectoptions) then
  1093. dataSegment.concat(Tai_const_symbol.Create(intmessagetable))
  1094. else
  1095. dataSegment.concat(Tai_const.Create_32bit(0));
  1096. { pointer to method table }
  1097. if assigned(methodnametable) then
  1098. dataSegment.concat(Tai_const_symbol.Create(methodnametable))
  1099. else
  1100. dataSegment.concat(Tai_const.Create_32bit(0));
  1101. { pointer to field table }
  1102. dataSegment.concat(Tai_const_symbol.Create(fieldtablelabel));
  1103. { pointer to type info of published section }
  1104. if (oo_can_have_published in _class.objectoptions) then
  1105. dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(fullrtti)))
  1106. else
  1107. dataSegment.concat(Tai_const.Create_32bit(0));
  1108. { inittable for con-/destruction, for classes this is always generated }
  1109. dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(initrtti)));
  1110. { auto table }
  1111. dataSegment.concat(Tai_const.Create_32bit(0));
  1112. { interface table }
  1113. if _class.implementedinterfaces.count>0 then
  1114. dataSegment.concat(Tai_const_symbol.Create(interfacetable))
  1115. else
  1116. dataSegment.concat(Tai_const.Create_32bit(0));
  1117. { table for string messages }
  1118. if (oo_has_msgstr in _class.objectoptions) then
  1119. dataSegment.concat(Tai_const_symbol.Create(strmessagetable))
  1120. else
  1121. dataSegment.concat(Tai_const.Create_32bit(0));
  1122. end;
  1123. { write virtual methods }
  1124. writevirtualmethods(dataSegment);
  1125. { write the size of the VMT }
  1126. dataSegment.concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
  1127. end;
  1128. initialization
  1129. cclassheader:=tclassheader;
  1130. end.
  1131. {
  1132. $Log$
  1133. Revision 1.8 2001-11-02 22:58:02 peter
  1134. * procsym definition rewrite
  1135. Revision 1.7 2001/10/25 21:22:35 peter
  1136. * calling convention rewrite
  1137. Revision 1.6 2001/10/20 19:28:38 peter
  1138. * interface 2 guid support
  1139. * guid constants support
  1140. Revision 1.5 2001/10/20 17:20:14 peter
  1141. * fixed generation of rtti for virtualmethods
  1142. Revision 1.4 2001/09/19 11:04:42 michael
  1143. * Smartlinking with interfaces fixed
  1144. * Better smartlinking for rtti and init tables
  1145. Revision 1.3 2001/08/30 20:13:53 peter
  1146. * rtti/init table updates
  1147. * rttisym for reusable global rtti/init info
  1148. * support published for interfaces
  1149. Revision 1.2 2001/08/22 21:16:20 florian
  1150. * some interfaces related problems regarding
  1151. mapping of interface implementions fixed
  1152. Revision 1.1 2001/04/21 13:37:16 peter
  1153. * made tclassheader using class of to implement cpu dependent code
  1154. Revision 1.20 2001/04/18 22:01:54 peter
  1155. * registration of targets and assemblers
  1156. Revision 1.19 2001/04/13 01:22:07 peter
  1157. * symtable change to classes
  1158. * range check generation and errors fixed, make cycle DEBUG=1 works
  1159. * memory leaks fixed
  1160. Revision 1.18 2001/04/04 21:30:43 florian
  1161. * applied several fixes to get the DD8 Delphi Unit compiled
  1162. e.g. "forward"-interfaces are working now
  1163. Revision 1.17 2000/12/25 00:07:26 peter
  1164. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  1165. tlinkedlist objects)
  1166. Revision 1.16 2000/11/29 00:30:30 florian
  1167. * unused units removed from uses clause
  1168. * some changes for widestrings
  1169. Revision 1.15 2000/11/19 16:23:35 florian
  1170. *** empty log message ***
  1171. Revision 1.14 2000/11/12 23:24:10 florian
  1172. * interfaces are basically running
  1173. Revision 1.13 2000/11/08 00:07:40 florian
  1174. * potential range check error fixed
  1175. Revision 1.12 2000/11/06 23:13:53 peter
  1176. * uppercase manglednames
  1177. Revision 1.11 2000/11/04 17:31:00 florian
  1178. * fixed some problems of previous commit
  1179. Revision 1.10 2000/11/04 14:25:19 florian
  1180. + merged Attila's changes for interfaces, not tested yet
  1181. Revision 1.9 2000/11/01 23:04:37 peter
  1182. * tprocdef.fullprocname added for better casesensitve writing of
  1183. procedures
  1184. Revision 1.8 2000/10/31 22:02:47 peter
  1185. * symtable splitted, no real code changes
  1186. Revision 1.7 2000/10/14 10:14:47 peter
  1187. * moehrendorf oct 2000 rewrite
  1188. Revision 1.6 2000/09/24 21:19:50 peter
  1189. * delphi compile fixes
  1190. Revision 1.5 2000/09/24 15:06:17 peter
  1191. * use defines.inc
  1192. Revision 1.4 2000/08/27 16:11:51 peter
  1193. * moved some util functions from globals,cobjects to cutils
  1194. * splitted files into finput,fmodule
  1195. Revision 1.3 2000/07/13 12:08:26 michael
  1196. + patched to 1.1.0 with former 1.09patch from peter
  1197. Revision 1.2 2000/07/13 11:32:41 michael
  1198. + removed logs
  1199. }