symsym.inc 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
  4. Implementation for the symbols types of the symtable
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. {****************************************************************************
  19. TSYM (base for all symtypes)
  20. ****************************************************************************}
  21. constructor tsym.init(const n : string);
  22. begin
  23. inherited initname(n);
  24. typ:=abstractsym;
  25. symoptions:=current_object_option;
  26. {$ifdef GDB}
  27. isstabwritten := false;
  28. {$endif GDB}
  29. fileinfo:=tokenpos;
  30. defref:=nil;
  31. refs:=0;
  32. lastwritten:=nil;
  33. refcount:=0;
  34. if (cs_browser in aktmoduleswitches) and make_ref then
  35. begin
  36. defref:=new(pref,init(defref,@tokenpos));
  37. inc(refcount);
  38. end;
  39. lastref:=defref;
  40. end;
  41. constructor tsym.load;
  42. begin
  43. inherited init;
  44. indexnr:=readword;
  45. setname(readstring);
  46. typ:=abstractsym;
  47. readsmallset(symoptions);
  48. readposinfo(fileinfo);
  49. lastref:=nil;
  50. defref:=nil;
  51. refs:=0;
  52. lastwritten:=nil;
  53. refcount:=0;
  54. {$ifdef GDB}
  55. isstabwritten := false;
  56. {$endif GDB}
  57. end;
  58. procedure tsym.load_references;
  59. var
  60. pos : tfileposinfo;
  61. move_last : boolean;
  62. begin
  63. move_last:=lastwritten=lastref;
  64. while (not current_ppu^.endofentry) do
  65. begin
  66. readposinfo(pos);
  67. inc(refcount);
  68. lastref:=new(pref,init(lastref,@pos));
  69. lastref^.is_written:=true;
  70. if refcount=1 then
  71. defref:=lastref;
  72. end;
  73. if move_last then
  74. lastwritten:=lastref;
  75. end;
  76. { big problem here :
  77. wrong refs were written because of
  78. interface parsing of other units PM
  79. moduleindex must be checked !! }
  80. function tsym.write_references : boolean;
  81. var
  82. ref : pref;
  83. symref_written,move_last : boolean;
  84. begin
  85. write_references:=false;
  86. if lastwritten=lastref then
  87. exit;
  88. { should we update lastref }
  89. move_last:=true;
  90. symref_written:=false;
  91. { write symbol refs }
  92. if assigned(lastwritten) then
  93. ref:=lastwritten
  94. else
  95. ref:=defref;
  96. while assigned(ref) do
  97. begin
  98. if ref^.moduleindex=current_module^.unit_index then
  99. begin
  100. { write address to this symbol }
  101. if not symref_written then
  102. begin
  103. writesymref(@self);
  104. symref_written:=true;
  105. end;
  106. writeposinfo(ref^.posinfo);
  107. ref^.is_written:=true;
  108. if move_last then
  109. lastwritten:=ref;
  110. end
  111. else if not ref^.is_written then
  112. move_last:=false
  113. else if move_last then
  114. lastwritten:=ref;
  115. ref:=ref^.nextref;
  116. end;
  117. if symref_written then
  118. current_ppu^.writeentry(ibsymref);
  119. write_references:=symref_written;
  120. end;
  121. {$ifdef BrowserLog}
  122. procedure tsym.add_to_browserlog;
  123. begin
  124. if assigned(defref) then
  125. begin
  126. browserlog.AddLog('***'+name+'***');
  127. browserlog.AddLogRefs(defref);
  128. end;
  129. end;
  130. {$endif BrowserLog}
  131. destructor tsym.done;
  132. begin
  133. if assigned(defref) then
  134. begin
  135. defref^.freechain;
  136. dispose(defref,done);
  137. end;
  138. inherited done;
  139. end;
  140. procedure tsym.write;
  141. begin
  142. writeword(indexnr);
  143. writestring(name);
  144. writesmallset(symoptions);
  145. writeposinfo(fileinfo);
  146. end;
  147. procedure tsym.prederef;
  148. begin
  149. end;
  150. procedure tsym.deref;
  151. begin
  152. end;
  153. function tsym.mangledname : string;
  154. begin
  155. mangledname:=name;
  156. end;
  157. { for most symbol types there is nothing to do at all }
  158. procedure tsym.insert_in_data;
  159. begin
  160. end;
  161. {$ifdef GDB}
  162. function tsym.stabstring : pchar;
  163. begin
  164. stabstring:=strpnew('"'+name+'",'+tostr(N_LSYM)+',0,'+
  165. tostr(fileinfo.line)+',0');
  166. end;
  167. procedure tsym.concatstabto(asmlist : paasmoutput);
  168. var stab_str : pchar;
  169. begin
  170. if not isstabwritten then
  171. begin
  172. stab_str := stabstring;
  173. { count_dbx(stab_str); moved to GDB.PAS }
  174. asmlist^.concat(new(pai_stabs,init(stab_str)));
  175. isstabwritten:=true;
  176. end;
  177. end;
  178. {$endif GDB}
  179. {****************************************************************************
  180. TLABELSYM
  181. ****************************************************************************}
  182. constructor tlabelsym.init(const n : string; l : pasmlabel);
  183. begin
  184. inherited init(n);
  185. typ:=labelsym;
  186. lab:=l;
  187. used:=false;
  188. defined:=false;
  189. code:=nil;
  190. end;
  191. constructor tlabelsym.load;
  192. begin
  193. tsym.load;
  194. typ:=labelsym;
  195. { this is all dummy
  196. it is only used for local browsing }
  197. lab:=nil;
  198. code:=nil;
  199. used:=false;
  200. defined:=true;
  201. end;
  202. destructor tlabelsym.done;
  203. begin
  204. inherited done;
  205. end;
  206. function tlabelsym.mangledname : string;
  207. begin
  208. mangledname:=lab^.name;
  209. end;
  210. procedure tlabelsym.write;
  211. begin
  212. if owner^.symtabletype in [unitsymtable,globalsymtable] then
  213. Message(sym_e_ill_label_decl)
  214. else
  215. begin
  216. tsym.write;
  217. current_ppu^.writeentry(iblabelsym);
  218. end;
  219. end;
  220. {****************************************************************************
  221. TUNITSYM
  222. ****************************************************************************}
  223. constructor tunitsym.init(const n : string;ref : punitsymtable);
  224. var
  225. old_make_ref : boolean;
  226. begin
  227. old_make_ref:=make_ref;
  228. make_ref:=false;
  229. inherited init(n);
  230. make_ref:=old_make_ref;
  231. typ:=unitsym;
  232. unitsymtable:=ref;
  233. prevsym:=ref^.unitsym;
  234. ref^.unitsym:=@self;
  235. refs:=0;
  236. end;
  237. constructor tunitsym.load;
  238. begin
  239. tsym.load;
  240. typ:=unitsym;
  241. unitsymtable:=punitsymtable(current_module^.globalsymtable);
  242. prevsym:=nil;
  243. end;
  244. { we need to remove it from the prevsym chain ! }
  245. procedure tunitsym.restoreunitsym;
  246. var pus,ppus : punitsym;
  247. begin
  248. if assigned(unitsymtable) then
  249. begin
  250. ppus:=nil;
  251. pus:=unitsymtable^.unitsym;
  252. if pus=@self then
  253. unitsymtable^.unitsym:=prevsym
  254. else while assigned(pus) do
  255. begin
  256. if pus=@self then
  257. begin
  258. ppus^.prevsym:=prevsym;
  259. break;
  260. end
  261. else
  262. begin
  263. ppus:=pus;
  264. pus:=ppus^.prevsym;
  265. end;
  266. end;
  267. end;
  268. prevsym:=nil;
  269. end;
  270. destructor tunitsym.done;
  271. begin
  272. restoreunitsym;
  273. inherited done;
  274. end;
  275. procedure tunitsym.write;
  276. begin
  277. tsym.write;
  278. current_ppu^.writeentry(ibunitsym);
  279. end;
  280. {$ifdef GDB}
  281. procedure tunitsym.concatstabto(asmlist : paasmoutput);
  282. begin
  283. {Nothing to write to stabs !}
  284. end;
  285. {$endif GDB}
  286. {****************************************************************************
  287. TPROCSYM
  288. ****************************************************************************}
  289. constructor tprocsym.init(const n : string);
  290. begin
  291. tsym.init(n);
  292. typ:=procsym;
  293. definition:=nil;
  294. owner:=nil;
  295. is_global := false;
  296. end;
  297. constructor tprocsym.load;
  298. begin
  299. tsym.load;
  300. typ:=procsym;
  301. definition:=pprocdef(readdefref);
  302. is_global := false;
  303. end;
  304. destructor tprocsym.done;
  305. begin
  306. { don't check if errors !! }
  307. if Errorcount=0 then
  308. check_forward;
  309. tsym.done;
  310. end;
  311. function tprocsym.mangledname : string;
  312. begin
  313. mangledname:=definition^.mangledname;
  314. end;
  315. function tprocsym.demangledname:string;
  316. begin
  317. demangledname:=name+definition^.demangled_paras;
  318. end;
  319. procedure tprocsym.write_parameter_lists;
  320. var
  321. p : pprocdef;
  322. begin
  323. p:=definition;
  324. while assigned(p) do
  325. begin
  326. { force the error to be printed }
  327. Verbose.Message1(sym_b_param_list,name+p^.demangled_paras);
  328. p:=p^.nextoverloaded;
  329. end;
  330. end;
  331. procedure tprocsym.check_forward;
  332. var
  333. pd : pprocdef;
  334. begin
  335. pd:=definition;
  336. while assigned(pd) do
  337. begin
  338. if pd^.forwarddef then
  339. begin
  340. if assigned(pd^._class) then
  341. MessagePos1(fileinfo,sym_e_forward_not_resolved,pd^._class^.objname^+'.'+demangledname)
  342. else
  343. MessagePos1(fileinfo,sym_e_forward_not_resolved,demangledname);
  344. { Turn futher error messages off }
  345. pd^.forwarddef:=false;
  346. end;
  347. pd:=pd^.nextoverloaded;
  348. { do not check defs of operators in other units }
  349. if assigned(pd) and (pd^.procsym<>@self) then
  350. pd:=nil;
  351. end;
  352. end;
  353. procedure tprocsym.deref;
  354. {$ifdef DONOTCHAINOPERATORS}
  355. var
  356. t : ttoken;
  357. last,pd : pprocdef;
  358. {$endif DONOTCHAINOPERATORS}
  359. begin
  360. resolvedef(pdef(definition));
  361. {$ifdef DONOTCHAINOPERATORS}
  362. if (definition^.proctypeoption=potype_operator) then
  363. begin
  364. last:=definition;
  365. while assigned(last^.nextoverloaded) do
  366. last:=last^.nextoverloaded;
  367. for t:=first_overloaded to last_overloaded do
  368. if (name=overloaded_names[t]) then
  369. begin
  370. if assigned(overloaded_operators[t]) then
  371. begin
  372. pd:=overloaded_operators[t]^.definition;
  373. { test if not already in list, bug report by KC Wong PM }
  374. while assigned(pd) do
  375. if pd=last then
  376. break
  377. else
  378. pd:=pd^.nextoverloaded;
  379. if pd=last then
  380. break;
  381. last^.nextoverloaded:=overloaded_operators[t]^.definition;
  382. end;
  383. overloaded_operators[t]:=@self;
  384. break;
  385. end;
  386. end;
  387. {$endif DONOTCHAINOPERATORS}
  388. end;
  389. procedure tprocsym.order_overloaded;
  390. var firstdef,currdef,lastdef,nextopdef : pprocdef;
  391. begin
  392. if not assigned(definition) then
  393. exit;
  394. firstdef:=definition;
  395. currdef:=definition;
  396. while assigned(currdef) and (currdef^.owner=firstdef^.owner) do
  397. begin
  398. currdef^.count:=false;
  399. currdef:=currdef^.nextoverloaded;
  400. end;
  401. nextopdef:=currdef;
  402. definition:=definition^.nextoverloaded;
  403. firstdef^.nextoverloaded:=nil;
  404. while (definition<>nextopdef) do
  405. begin
  406. currdef:=firstdef;
  407. lastdef:=definition;
  408. definition:=definition^.nextoverloaded;
  409. if lastdef^.mangledname<firstdef^.mangledname then
  410. begin
  411. lastdef^.nextoverloaded:=firstdef;
  412. firstdef:=lastdef;
  413. end
  414. else
  415. begin
  416. while assigned(currdef^.nextoverloaded) and
  417. (lastdef^.mangledname>currdef^.nextoverloaded^.mangledname) do
  418. currdef:=currdef^.nextoverloaded;
  419. lastdef^.nextoverloaded:=currdef^.nextoverloaded;
  420. currdef^.nextoverloaded:=lastdef;
  421. end;
  422. end;
  423. definition:=firstdef;
  424. currdef:=definition;
  425. while assigned(currdef) do
  426. begin
  427. currdef^.count:=true;
  428. lastdef:=currdef;
  429. currdef:=currdef^.nextoverloaded;
  430. end;
  431. lastdef^.nextoverloaded:=nextopdef;
  432. end;
  433. procedure tprocsym.write;
  434. begin
  435. tsym.write;
  436. writedefref(pdef(definition));
  437. current_ppu^.writeentry(ibprocsym);
  438. end;
  439. procedure tprocsym.load_references;
  440. (*var
  441. prdef,prdef2 : pprocdef;
  442. b : byte; *)
  443. begin
  444. inherited load_references;
  445. (*prdef:=definition;
  446. done in tsymtable.load_browser (PM)
  447. { take care about operators !! }
  448. if (current_module^.flags and uf_has_browser) <>0 then
  449. while assigned(prdef) and (prdef^.owner=definition^.owner) do
  450. begin
  451. b:=current_ppu^.readentry;
  452. if b<>ibdefref then
  453. Message(unit_f_ppu_read_error);
  454. prdef2:=pprocdef(readdefref);
  455. resolvedef(prdef2);
  456. if prdef<>prdef2 then
  457. Message(unit_f_ppu_read_error);
  458. prdef^.load_references;
  459. prdef:=prdef^.nextoverloaded;
  460. end; *)
  461. end;
  462. function tprocsym.write_references : boolean;
  463. var
  464. prdef : pprocdef;
  465. begin
  466. write_references:=false;
  467. if not inherited write_references then
  468. exit;
  469. write_references:=true;
  470. prdef:=definition;
  471. while assigned(prdef) and (prdef^.owner=definition^.owner) do
  472. begin
  473. prdef^.write_references;
  474. prdef:=prdef^.nextoverloaded;
  475. end;
  476. end;
  477. {$ifdef BrowserLog}
  478. procedure tprocsym.add_to_browserlog;
  479. var
  480. prdef : pprocdef;
  481. begin
  482. inherited add_to_browserlog;
  483. prdef:=definition;
  484. while assigned(prdef) do
  485. begin
  486. pprocdef(prdef)^.add_to_browserlog;
  487. prdef:=pprocdef(prdef)^.nextoverloaded;
  488. end;
  489. end;
  490. {$endif BrowserLog}
  491. {$ifdef GDB}
  492. function tprocsym.stabstring : pchar;
  493. Var RetType : Char;
  494. Obj,Info : String;
  495. stabsstr : string;
  496. p : pchar;
  497. begin
  498. obj := name;
  499. info := '';
  500. if is_global then
  501. RetType := 'F'
  502. else
  503. RetType := 'f';
  504. if assigned(owner) then
  505. begin
  506. if (owner^.symtabletype = objectsymtable) then
  507. obj := owner^.name^+'__'+name;
  508. { this code was correct only as long as the local symboltable
  509. of the parent had the same name as the function
  510. but this is no true anymore !! PM
  511. if (owner^.symtabletype=localsymtable) and assigned(owner^.name) then
  512. info := ','+name+','+owner^.name^; }
  513. if (owner^.symtabletype=localsymtable) and assigned(owner^.defowner) and
  514. assigned(pprocdef(owner^.defowner)^.procsym) then
  515. info := ','+name+','+pprocdef(owner^.defowner)^.procsym^.name;
  516. end;
  517. stabsstr:=definition^.mangledname;
  518. getmem(p,length(stabsstr)+255);
  519. strpcopy(p,'"'+obj+':'+RetType
  520. +definition^.rettype.def^.numberstring+info+'",'+tostr(n_function)
  521. +',0,'+
  522. tostr(aktfilepos.line)
  523. +',');
  524. strpcopy(strend(p),stabsstr);
  525. stabstring:=strnew(p);
  526. freemem(p,length(stabsstr)+255);
  527. end;
  528. procedure tprocsym.concatstabto(asmlist : paasmoutput);
  529. begin
  530. if (pocall_internproc in definition^.proccalloptions) then exit;
  531. if not isstabwritten then
  532. asmlist^.concat(new(pai_stabs,init(stabstring)));
  533. isstabwritten := true;
  534. if assigned(definition^.parast) then
  535. definition^.parast^.concatstabto(asmlist);
  536. if assigned(definition^.localst) then
  537. definition^.localst^.concatstabto(asmlist);
  538. definition^.is_def_stab_written := true;
  539. end;
  540. {$endif GDB}
  541. {****************************************************************************
  542. TPROGRAMSYM
  543. ****************************************************************************}
  544. constructor tprogramsym.init(const n : string);
  545. begin
  546. inherited init(n);
  547. typ:=programsym;
  548. end;
  549. {****************************************************************************
  550. TERRORSYM
  551. ****************************************************************************}
  552. constructor terrorsym.init;
  553. begin
  554. inherited init('');
  555. typ:=errorsym;
  556. end;
  557. {****************************************************************************
  558. TPROPERTYSYM
  559. ****************************************************************************}
  560. constructor tpropertysym.init(const n : string);
  561. begin
  562. inherited init(n);
  563. typ:=propertysym;
  564. propoptions:=[];
  565. index:=0;
  566. default:=0;
  567. proptype.reset;
  568. indextype.reset;
  569. new(readaccess,init);
  570. new(writeaccess,init);
  571. new(storedaccess,init);
  572. end;
  573. constructor tpropertysym.load;
  574. begin
  575. inherited load;
  576. typ:=propertysym;
  577. readsmallset(propoptions);
  578. if (ppo_is_override in propoptions) then
  579. begin
  580. propoverriden:=ppropertysym(readsymref);
  581. { we need to have these objects initialized }
  582. new(readaccess,init);
  583. new(writeaccess,init);
  584. new(storedaccess,init);
  585. end
  586. else
  587. begin
  588. proptype.load;
  589. index:=readlong;
  590. default:=readlong;
  591. indextype.load;
  592. new(readaccess,load);
  593. new(writeaccess,load);
  594. new(storedaccess,load);
  595. end;
  596. end;
  597. destructor tpropertysym.done;
  598. begin
  599. dispose(readaccess,done);
  600. dispose(writeaccess,done);
  601. dispose(storedaccess,done);
  602. inherited done;
  603. end;
  604. procedure tpropertysym.deref;
  605. begin
  606. if (ppo_is_override in propoptions) then
  607. begin
  608. resolvesym(psym(propoverriden));
  609. dooverride(propoverriden);
  610. end
  611. else
  612. begin
  613. proptype.resolve;
  614. indextype.resolve;
  615. readaccess^.resolve;
  616. writeaccess^.resolve;
  617. storedaccess^.resolve;
  618. end;
  619. end;
  620. function tpropertysym.getsize : longint;
  621. begin
  622. getsize:=0;
  623. end;
  624. procedure tpropertysym.write;
  625. begin
  626. tsym.write;
  627. writesmallset(propoptions);
  628. if (ppo_is_override in propoptions) then
  629. writesymref(propoverriden)
  630. else
  631. begin
  632. proptype.write;
  633. writelong(index);
  634. writelong(default);
  635. indextype.write;
  636. readaccess^.write;
  637. writeaccess^.write;
  638. storedaccess^.write;
  639. end;
  640. current_ppu^.writeentry(ibpropertysym);
  641. end;
  642. procedure tpropertysym.dooverride(overriden:ppropertysym);
  643. begin
  644. propoverriden:=overriden;
  645. proptype:=overriden^.proptype;
  646. propoptions:=overriden^.propoptions+[ppo_is_override];
  647. index:=overriden^.index;
  648. default:=overriden^.default;
  649. indextype:=overriden^.indextype;
  650. readaccess^.clear;
  651. readaccess:=overriden^.readaccess^.getcopy;
  652. writeaccess^.clear;
  653. writeaccess:=overriden^.writeaccess^.getcopy;
  654. storedaccess^.clear;
  655. storedaccess:=overriden^.storedaccess^.getcopy;
  656. end;
  657. {$ifdef GDB}
  658. function tpropertysym.stabstring : pchar;
  659. begin
  660. { !!!! don't know how to handle }
  661. stabstring:=strpnew('');
  662. end;
  663. procedure tpropertysym.concatstabto(asmlist : paasmoutput);
  664. begin
  665. { !!!! don't know how to handle }
  666. end;
  667. {$endif GDB}
  668. {****************************************************************************
  669. TFUNCRETSYM
  670. ****************************************************************************}
  671. constructor tfuncretsym.init(const n : string;approcinfo : pointer{pprocinfo});
  672. begin
  673. tsym.init(n);
  674. typ:=funcretsym;
  675. funcretprocinfo:=approcinfo;
  676. rettype:=pprocinfo(approcinfo)^.returntype;
  677. { address valid for ret in param only }
  678. { otherwise set by insert }
  679. address:=pprocinfo(approcinfo)^.return_offset;
  680. end;
  681. constructor tfuncretsym.load;
  682. begin
  683. tsym.load;
  684. rettype.load;
  685. address:=readlong;
  686. funcretprocinfo:=nil;
  687. typ:=funcretsym;
  688. end;
  689. destructor tfuncretsym.done;
  690. begin
  691. inherited done;
  692. end;
  693. procedure tfuncretsym.write;
  694. begin
  695. tsym.write;
  696. rettype.write;
  697. writelong(address);
  698. current_ppu^.writeentry(ibfuncretsym);
  699. end;
  700. procedure tfuncretsym.deref;
  701. begin
  702. rettype.resolve;
  703. end;
  704. {$ifdef GDB}
  705. procedure tfuncretsym.concatstabto(asmlist : paasmoutput);
  706. begin
  707. { Nothing to do here, it is done in genexitcode }
  708. end;
  709. {$endif GDB}
  710. procedure tfuncretsym.insert_in_data;
  711. var
  712. l : longint;
  713. begin
  714. { if retoffset is already set then reuse it, this is needed
  715. when inserting the result variable }
  716. if procinfo^.return_offset<>0 then
  717. address:=procinfo^.return_offset
  718. else
  719. begin
  720. { allocate space in local if ret in acc or in fpu }
  721. if ret_in_acc(procinfo^.returntype.def) or (procinfo^.returntype.def^.deftype=floatdef) then
  722. begin
  723. l:=rettype.def^.size;
  724. inc(owner^.datasize,l);
  725. {$ifdef m68k}
  726. { word alignment required for motorola }
  727. if (l=1) then
  728. inc(owner^.datasize,1)
  729. else
  730. {$endif}
  731. if (l>=4) and ((owner^.datasize and 3)<>0) then
  732. inc(owner^.datasize,4-(owner^.datasize and 3))
  733. else if (l>=2) and ((owner^.datasize and 1)<>0) then
  734. inc(owner^.datasize,2-(owner^.datasize and 1));
  735. address:=owner^.datasize;
  736. procinfo^.return_offset:=-owner^.datasize;
  737. end;
  738. end;
  739. end;
  740. {****************************************************************************
  741. TABSOLUTESYM
  742. ****************************************************************************}
  743. constructor tabsolutesym.init(const n : string;const tt : ttype);
  744. begin
  745. inherited init(n,tt);
  746. typ:=absolutesym;
  747. end;
  748. constructor tabsolutesym.initdef(const n : string;p : pdef);
  749. var
  750. t : ttype;
  751. begin
  752. t.setdef(p);
  753. tabsolutesym.init(n,t);
  754. end;
  755. constructor tabsolutesym.load;
  756. begin
  757. tvarsym.load;
  758. typ:=absolutesym;
  759. ref:=nil;
  760. address:=0;
  761. asmname:=nil;
  762. abstyp:=absolutetyp(readbyte);
  763. absseg:=false;
  764. case abstyp of
  765. tovar :
  766. begin
  767. asmname:=stringdup(readstring);
  768. ref:=srsym;
  769. end;
  770. toasm :
  771. asmname:=stringdup(readstring);
  772. toaddr :
  773. begin
  774. address:=readlong;
  775. absseg:=boolean(readbyte);
  776. end;
  777. end;
  778. end;
  779. procedure tabsolutesym.write;
  780. var
  781. hvo : tvaroptions;
  782. begin
  783. { Note: This needs to write everything of tvarsym.write }
  784. tsym.write;
  785. writebyte(byte(varspez));
  786. if read_member then
  787. writelong(address);
  788. { write only definition or definitionsym }
  789. vartype.write;
  790. hvo:=varoptions-[vo_regable];
  791. writesmallset(hvo);
  792. writebyte(byte(abstyp));
  793. case abstyp of
  794. tovar :
  795. writestring(ref^.name);
  796. toasm :
  797. writestring(asmname^);
  798. toaddr :
  799. begin
  800. writelong(address);
  801. writebyte(byte(absseg));
  802. end;
  803. end;
  804. current_ppu^.writeentry(ibabsolutesym);
  805. end;
  806. procedure tabsolutesym.deref;
  807. begin
  808. tvarsym.deref;
  809. if (abstyp=tovar) and (asmname<>nil) then
  810. begin
  811. { search previous loaded symtables }
  812. getsym(asmname^,false);
  813. if not(assigned(srsym)) then
  814. getsymonlyin(owner,asmname^);
  815. if not(assigned(srsym)) then
  816. srsym:=generrorsym;
  817. ref:=srsym;
  818. stringdispose(asmname);
  819. end;
  820. end;
  821. function tabsolutesym.mangledname : string;
  822. begin
  823. case abstyp of
  824. tovar :
  825. mangledname:=ref^.mangledname;
  826. toasm :
  827. mangledname:=asmname^;
  828. toaddr :
  829. mangledname:='$'+tostr(address);
  830. else
  831. internalerror(10002);
  832. end;
  833. end;
  834. procedure tabsolutesym.insert_in_data;
  835. begin
  836. end;
  837. {$ifdef GDB}
  838. procedure tabsolutesym.concatstabto(asmlist : paasmoutput);
  839. begin
  840. { I don't know how to handle this !! }
  841. end;
  842. {$endif GDB}
  843. {****************************************************************************
  844. TVARSYM
  845. ****************************************************************************}
  846. constructor tvarsym.init(const n : string;const tt : ttype);
  847. begin
  848. tsym.init(n);
  849. typ:=varsym;
  850. vartype:=tt;
  851. _mangledname:=nil;
  852. varspez:=vs_value;
  853. address:=0;
  854. localvarsym:=nil;
  855. refs:=0;
  856. varstate:=vs_used;
  857. varoptions:=[];
  858. { can we load the value into a register ? }
  859. if tt.def^.is_intregable then
  860. include(varoptions,vo_regable)
  861. else
  862. exclude(varoptions,vo_regable);
  863. if tt.def^.is_fpuregable then
  864. include(varoptions,vo_fpuregable)
  865. else
  866. exclude(varoptions,vo_fpuregable);
  867. reg:=R_NO;
  868. end;
  869. constructor tvarsym.init_dll(const n : string;const tt : ttype);
  870. begin
  871. tvarsym.init(n,tt);
  872. {$ifdef INCLUDEOK}
  873. include(varoptions,vo_is_dll_var);
  874. {$else}
  875. varoptions:=varoptions+[vo_is_dll_var];
  876. {$endif}
  877. end;
  878. constructor tvarsym.init_C(const n,mangled : string;const tt : ttype);
  879. begin
  880. tvarsym.init(n,tt);
  881. {$ifdef INCLUDEOK}
  882. include(varoptions,vo_is_C_var);
  883. {$else}
  884. varoptions:=varoptions+[vo_is_C_var];
  885. {$endif}
  886. setmangledname(mangled);
  887. end;
  888. constructor tvarsym.initdef(const n : string;p : pdef);
  889. var
  890. t : ttype;
  891. begin
  892. t.setdef(p);
  893. tvarsym.init(n,t);
  894. end;
  895. constructor tvarsym.load;
  896. begin
  897. tsym.load;
  898. typ:=varsym;
  899. _mangledname:=nil;
  900. reg:=R_NO;
  901. refs := 0;
  902. varstate:=vs_used;
  903. varspez:=tvarspez(readbyte);
  904. if read_member then
  905. address:=readlong
  906. else
  907. address:=0;
  908. localvarsym:=nil;
  909. vartype.load;
  910. readsmallset(varoptions);
  911. if (vo_is_C_var in varoptions) then
  912. setmangledname(readstring);
  913. end;
  914. destructor tvarsym.done;
  915. begin
  916. strdispose(_mangledname);
  917. inherited done;
  918. end;
  919. procedure tvarsym.deref;
  920. begin
  921. vartype.resolve;
  922. end;
  923. procedure tvarsym.write;
  924. var
  925. hvo : tvaroptions;
  926. begin
  927. tsym.write;
  928. writebyte(byte(varspez));
  929. if read_member then
  930. writelong(address);
  931. vartype.write;
  932. { symbols which are load are never candidates for a register,
  933. turn off the regable }
  934. hvo:=varoptions-[vo_regable];
  935. writesmallset(hvo);
  936. if (vo_is_C_var in varoptions) then
  937. writestring(mangledname);
  938. current_ppu^.writeentry(ibvarsym);
  939. end;
  940. procedure tvarsym.setmangledname(const s : string);
  941. begin
  942. _mangledname:=strpnew(s);
  943. end;
  944. function tvarsym.mangledname : string;
  945. var
  946. prefix : string;
  947. begin
  948. if assigned(_mangledname) then
  949. begin
  950. mangledname:=strpas(_mangledname);
  951. exit;
  952. end;
  953. case owner^.symtabletype of
  954. staticsymtable :
  955. if (cs_create_smart in aktmoduleswitches) then
  956. prefix:='_'+owner^.name^+'$$$_'
  957. else
  958. prefix:='_';
  959. unitsymtable,
  960. globalsymtable :
  961. prefix:=
  962. 'U_'+owner^.name^+'_';
  963. else
  964. Message(sym_e_invalid_call_tvarsymmangledname);
  965. end;
  966. mangledname:=prefix+name;
  967. end;
  968. function tvarsym.getsize : longint;
  969. begin
  970. if assigned(vartype.def) then
  971. getsize:=vartype.def^.size
  972. else
  973. getsize:=0;
  974. end;
  975. function tvarsym.getvaluesize : longint;
  976. begin
  977. if assigned(vartype.def) and
  978. (varspez=vs_value) and
  979. ((vartype.def^.deftype<>arraydef) or
  980. (Parraydef(vartype.def)^.highrange>=Parraydef(vartype.def)^.lowrange)) then
  981. getvaluesize:=vartype.def^.size
  982. else
  983. getvaluesize:=0;
  984. end;
  985. function tvarsym.getpushsize : longint;
  986. begin
  987. if assigned(vartype.def) then
  988. begin
  989. case varspez of
  990. vs_var :
  991. getpushsize:=target_os.size_of_pointer;
  992. vs_value,
  993. vs_const :
  994. begin
  995. if push_addr_param(vartype.def) then
  996. getpushsize:=target_os.size_of_pointer
  997. else
  998. getpushsize:=vartype.def^.size;
  999. end;
  1000. end;
  1001. end
  1002. else
  1003. getpushsize:=0;
  1004. end;
  1005. function data_align(length : longint) : longint;
  1006. begin
  1007. (* this is useless under go32v2 at least
  1008. because the section are only align to dword
  1009. if length>8 then
  1010. data_align:=16
  1011. else if length>4 then
  1012. data_align:=8
  1013. else *)
  1014. if length>2 then
  1015. data_align:=4
  1016. else
  1017. if length>1 then
  1018. data_align:=2
  1019. else
  1020. data_align:=1;
  1021. end;
  1022. procedure tvarsym.insert_in_data;
  1023. var
  1024. varalign,
  1025. l,ali,modulo : longint;
  1026. storefilepos : tfileposinfo;
  1027. begin
  1028. if (vo_is_external in varoptions) then
  1029. exit;
  1030. { handle static variables of objects especially }
  1031. if read_member and (owner^.symtabletype=objectsymtable) and
  1032. (sp_static in symoptions) then
  1033. begin
  1034. { the data filed is generated in parser.pas
  1035. with a tobject_FIELDNAME variable }
  1036. { this symbol can't be loaded to a register }
  1037. {$ifdef INCLUDEOK}
  1038. exclude(varoptions,vo_regable);
  1039. exclude(varoptions,vo_fpuregable);
  1040. {$else}
  1041. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1042. {$endif}
  1043. end
  1044. else
  1045. if not(read_member) then
  1046. begin
  1047. { made problems with parameters etc. ! (FK) }
  1048. { check for instance of an abstract object or class }
  1049. {
  1050. if (pvarsym(sym)^.definition^.deftype=objectdef) and
  1051. ((pobjectdef(pvarsym(sym)^.definition)^.options and oo_is_abstract)<>0) then
  1052. Message(sym_e_no_instance_of_abstract_object);
  1053. }
  1054. storefilepos:=aktfilepos;
  1055. aktfilepos:=tokenpos;
  1056. if (vo_is_thread_var in varoptions) then
  1057. l:=4
  1058. else
  1059. l:=getvaluesize;
  1060. case owner^.symtabletype of
  1061. stt_exceptsymtable:
  1062. { can contain only one symbol, address calculated later }
  1063. ;
  1064. localsymtable :
  1065. begin
  1066. varstate:=vs_declared;
  1067. modulo:=owner^.datasize and 3;
  1068. {$ifdef m68k}
  1069. { word alignment required for motorola }
  1070. if (l=1) then
  1071. l:=2
  1072. else
  1073. {$endif}
  1074. {
  1075. if (cs_optimize in aktglobalswitches) and
  1076. (aktoptprocessor in [classp5,classp6]) and
  1077. (l>=8) and ((owner^.datasize and 7)<>0) then
  1078. inc(owner^.datasize,8-(owner^.datasize and 7))
  1079. else
  1080. }
  1081. begin
  1082. if (l>=4) and (modulo<>0) then
  1083. inc(l,4-modulo)
  1084. else
  1085. if (l>=2) and ((modulo and 1)<>0) then
  1086. inc(l,2-(modulo and 1));
  1087. end;
  1088. inc(owner^.datasize,l);
  1089. address:=owner^.datasize;
  1090. end;
  1091. staticsymtable :
  1092. begin
  1093. { enable unitialized warning for local symbols }
  1094. varstate:=vs_declared;
  1095. if (cs_create_smart in aktmoduleswitches) then
  1096. bsssegment^.concat(new(pai_cut,init));
  1097. ali:=data_align(l);
  1098. if ali>1 then
  1099. begin
  1100. modulo:=owner^.datasize mod ali;
  1101. if modulo>0 then
  1102. inc(owner^.datasize,ali-modulo);
  1103. end;
  1104. {$ifdef GDB}
  1105. if cs_debuginfo in aktmoduleswitches then
  1106. concatstabto(bsssegment);
  1107. {$endif GDB}
  1108. if (cs_create_smart in aktmoduleswitches) or
  1109. DLLSource or
  1110. (vo_is_C_var in varoptions) then
  1111. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)))
  1112. else
  1113. bsssegment^.concat(new(pai_datablock,init(mangledname,l)));
  1114. { increase datasize }
  1115. inc(owner^.datasize,l);
  1116. { this symbol can't be loaded to a register }
  1117. {$ifdef INCLUDEOK}
  1118. exclude(varoptions,vo_regable);
  1119. exclude(varoptions,vo_fpuregable);
  1120. {$else}
  1121. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1122. {$endif}
  1123. end;
  1124. globalsymtable :
  1125. begin
  1126. if (cs_create_smart in aktmoduleswitches) then
  1127. bsssegment^.concat(new(pai_cut,init));
  1128. ali:=data_align(l);
  1129. if ali>1 then
  1130. begin
  1131. modulo:=owner^.datasize mod ali;
  1132. if modulo>0 then
  1133. inc(owner^.datasize,ali-modulo);
  1134. end;
  1135. {$ifdef GDB}
  1136. if cs_debuginfo in aktmoduleswitches then
  1137. concatstabto(bsssegment);
  1138. {$endif GDB}
  1139. bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)));
  1140. inc(owner^.datasize,l);
  1141. { this symbol can't be loaded to a register }
  1142. {$ifdef INCLUDEOK}
  1143. exclude(varoptions,vo_regable);
  1144. exclude(varoptions,vo_fpuregable);
  1145. {$else}
  1146. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1147. {$endif}
  1148. end;
  1149. recordsymtable,
  1150. objectsymtable :
  1151. begin
  1152. { this symbol can't be loaded to a register }
  1153. {$ifdef INCLUDEOK}
  1154. exclude(varoptions,vo_regable);
  1155. exclude(varoptions,vo_fpuregable);
  1156. {$else}
  1157. varoptions:=varoptions-[vo_regable,vo_fpuregable];
  1158. {$endif}
  1159. { get the alignment size }
  1160. if (aktpackrecords=packrecord_C) then
  1161. begin
  1162. varalign:=vartype.def^.alignment;
  1163. if varalign=0 then
  1164. begin
  1165. if (owner^.dataalignment<4) then
  1166. begin
  1167. if (l>=4) then
  1168. owner^.dataalignment:=4
  1169. else
  1170. if (owner^.dataalignment<2) and (l>=2) then
  1171. owner^.dataalignment:=2;
  1172. end;
  1173. end;
  1174. end
  1175. else
  1176. varalign:=0;
  1177. { align record and object fields }
  1178. if (l=1) or (varalign=1) or (owner^.dataalignment=1) then
  1179. begin
  1180. address:=owner^.datasize;
  1181. inc(owner^.datasize,l)
  1182. end
  1183. else
  1184. if (l=2) or (varalign=2) or (owner^.dataalignment=2) then
  1185. begin
  1186. owner^.datasize:=(owner^.datasize+1) and (not 1);
  1187. address:=owner^.datasize;
  1188. inc(owner^.datasize,l)
  1189. end
  1190. else
  1191. if (l<=4) or (varalign=4) or (owner^.dataalignment=4) then
  1192. begin
  1193. owner^.datasize:=(owner^.datasize+3) and (not 3);
  1194. address:=owner^.datasize;
  1195. inc(owner^.datasize,l);
  1196. end
  1197. else
  1198. if (l<=8) or (owner^.dataalignment=8) then
  1199. begin
  1200. owner^.datasize:=(owner^.datasize+7) and (not 7);
  1201. address:=owner^.datasize;
  1202. inc(owner^.datasize,l);
  1203. end
  1204. else
  1205. if (l<=16) or (owner^.dataalignment=16) then
  1206. begin
  1207. owner^.datasize:=(owner^.datasize+15) and (not 15);
  1208. address:=owner^.datasize;
  1209. inc(owner^.datasize,l);
  1210. end
  1211. else
  1212. if (l<=32) or (owner^.dataalignment=32) then
  1213. begin
  1214. owner^.datasize:=(owner^.datasize+31) and (not 31);
  1215. address:=owner^.datasize;
  1216. inc(owner^.datasize,l);
  1217. end;
  1218. end;
  1219. parasymtable :
  1220. begin
  1221. { here we need the size of a push instead of the
  1222. size of the data }
  1223. l:=getpushsize;
  1224. varstate:=vs_assigned;
  1225. address:=owner^.datasize;
  1226. owner^.datasize:=align(owner^.datasize+l,target_os.stackalignment);
  1227. end
  1228. else
  1229. begin
  1230. modulo:=owner^.datasize and 3;
  1231. if (l>=4) and (modulo<>0) then
  1232. inc(owner^.datasize,4-modulo)
  1233. else
  1234. if (l>=2) and ((modulo and 1)<>0) then
  1235. inc(owner^.datasize);
  1236. address:=owner^.datasize;
  1237. inc(owner^.datasize,l);
  1238. end;
  1239. end;
  1240. aktfilepos:=storefilepos;
  1241. end;
  1242. end;
  1243. {$ifdef GDB}
  1244. function tvarsym.stabstring : pchar;
  1245. var
  1246. st : string[2];
  1247. begin
  1248. if (vartype.def^.deftype=objectdef) and
  1249. pobjectdef(vartype.def)^.is_class then
  1250. st:='*'
  1251. else
  1252. st:='';
  1253. if (owner^.symtabletype = objectsymtable) and
  1254. (sp_static in symoptions) then
  1255. begin
  1256. if (cs_gdb_gsym in aktglobalswitches) then st := 'G'+st else st := 'S'+st;
  1257. {$ifndef Delphi}
  1258. stabstring := strpnew('"'+owner^.name^+'__'+name+':'+st+
  1259. +vartype.def^.numberstring+'",'+
  1260. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1261. {$endif}
  1262. end
  1263. else if (owner^.symtabletype = globalsymtable) or
  1264. (owner^.symtabletype = unitsymtable) then
  1265. begin
  1266. { Here we used S instead of
  1267. because with G GDB doesn't look at the address field
  1268. but searches the same name or with a leading underscore
  1269. but these names don't exist in pascal !}
  1270. if (cs_gdb_gsym in aktglobalswitches) then st := 'G'+st else st := 'S'+st;
  1271. stabstring := strpnew('"'+name+':'+st
  1272. +vartype.def^.numberstring+'",'+
  1273. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1274. end
  1275. else if owner^.symtabletype = staticsymtable then
  1276. begin
  1277. stabstring := strpnew('"'+name+':S'+st
  1278. +vartype.def^.numberstring+'",'+
  1279. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname);
  1280. end
  1281. else if (owner^.symtabletype in [parasymtable,inlineparasymtable]) then
  1282. begin
  1283. case varspez of
  1284. vs_var : st := 'v'+st;
  1285. vs_value,
  1286. vs_const : if push_addr_param(vartype.def) then
  1287. st := 'v'+st { should be 'i' but 'i' doesn't work }
  1288. else
  1289. st := 'p'+st;
  1290. end;
  1291. stabstring := strpnew('"'+name+':'+st
  1292. +vartype.def^.numberstring+'",'+
  1293. tostr(N_PSYM)+',0,'+tostr(fileinfo.line)+','+
  1294. tostr(address+owner^.address_fixup));
  1295. {offset to ebp => will not work if the framepointer is esp
  1296. so some optimizing will make things harder to debug }
  1297. end
  1298. else if (owner^.symtabletype in [localsymtable,inlinelocalsymtable]) then
  1299. {$ifdef i386}
  1300. if reg<>R_NO then
  1301. begin
  1302. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1303. { this is the register order for GDB}
  1304. stabstring:=strpnew('"'+name+':r'+st
  1305. +vartype.def^.numberstring+'",'+
  1306. tostr(N_RSYM)+',0,'+
  1307. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1308. end
  1309. else
  1310. {$endif i386}
  1311. { I don't know if this will work (PM) }
  1312. if (vo_is_C_var in varoptions) then
  1313. stabstring := strpnew('"'+name+':S'+st
  1314. +vartype.def^.numberstring+'",'+
  1315. tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname)
  1316. else
  1317. stabstring := strpnew('"'+name+':'+st
  1318. +vartype.def^.numberstring+'",'+
  1319. tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',-'+tostr(address-owner^.address_fixup))
  1320. else
  1321. stabstring := inherited stabstring;
  1322. end;
  1323. procedure tvarsym.concatstabto(asmlist : paasmoutput);
  1324. {$ifdef i386}
  1325. var stab_str : pchar;
  1326. {$endif i386}
  1327. begin
  1328. inherited concatstabto(asmlist);
  1329. {$ifdef i386}
  1330. if (owner^.symtabletype=parasymtable) and
  1331. (reg<>R_NO) then
  1332. begin
  1333. { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eip", "ps", "cs", "ss", "ds", "es", "fs", "gs", }
  1334. { this is the register order for GDB}
  1335. stab_str:=strpnew('"'+name+':r'
  1336. +vartype.def^.numberstring+'",'+
  1337. tostr(N_RSYM)+',0,'+
  1338. tostr(fileinfo.line)+','+tostr(GDB_i386index[reg]));
  1339. asmlist^.concat(new(pai_stabs,init(stab_str)));
  1340. end;
  1341. {$endif i386}
  1342. end;
  1343. {$endif GDB}
  1344. {****************************************************************************
  1345. TTYPEDCONSTSYM
  1346. *****************************************************************************}
  1347. constructor ttypedconstsym.init(const n : string;p : pdef;really_const : boolean);
  1348. begin
  1349. tsym.init(n);
  1350. typ:=typedconstsym;
  1351. typedconsttype.setdef(p);
  1352. is_really_const:=really_const;
  1353. prefix:=stringdup(procprefix);
  1354. end;
  1355. constructor ttypedconstsym.inittype(const n : string;const tt : ttype;really_const : boolean);
  1356. begin
  1357. ttypedconstsym.init(n,nil,really_const);
  1358. typedconsttype:=tt;
  1359. end;
  1360. constructor ttypedconstsym.load;
  1361. begin
  1362. tsym.load;
  1363. typ:=typedconstsym;
  1364. typedconsttype.load;
  1365. prefix:=stringdup(readstring);
  1366. is_really_const:=boolean(readbyte);
  1367. end;
  1368. destructor ttypedconstsym.done;
  1369. begin
  1370. stringdispose(prefix);
  1371. tsym.done;
  1372. end;
  1373. function ttypedconstsym.mangledname : string;
  1374. begin
  1375. mangledname:='TC_'+prefix^+'_'+name;
  1376. end;
  1377. function ttypedconstsym.getsize : longint;
  1378. begin
  1379. if assigned(typedconsttype.def) then
  1380. getsize:=typedconsttype.def^.size
  1381. else
  1382. getsize:=0;
  1383. end;
  1384. procedure ttypedconstsym.deref;
  1385. begin
  1386. typedconsttype.resolve;
  1387. end;
  1388. procedure ttypedconstsym.write;
  1389. begin
  1390. tsym.write;
  1391. typedconsttype.write;
  1392. writestring(prefix^);
  1393. writebyte(byte(is_really_const));
  1394. current_ppu^.writeentry(ibtypedconstsym);
  1395. end;
  1396. procedure ttypedconstsym.insert_in_data;
  1397. var
  1398. curconstsegment : paasmoutput;
  1399. l,ali,modulo : longint;
  1400. storefilepos : tfileposinfo;
  1401. begin
  1402. storefilepos:=aktfilepos;
  1403. aktfilepos:=tokenpos;
  1404. if is_really_const then
  1405. curconstsegment:=consts
  1406. else
  1407. curconstsegment:=datasegment;
  1408. if (cs_create_smart in aktmoduleswitches) then
  1409. curconstsegment^.concat(new(pai_cut,init));
  1410. l:=getsize;
  1411. ali:=data_align(l);
  1412. if ali>1 then
  1413. begin
  1414. curconstsegment^.concat(new(pai_align,init(ali)));
  1415. modulo:=owner^.datasize mod ali;
  1416. if modulo>0 then
  1417. inc(owner^.datasize,ali-modulo);
  1418. end;
  1419. { Why was there no owner size update here ??? }
  1420. inc(owner^.datasize,l);
  1421. {$ifdef GDB}
  1422. if cs_debuginfo in aktmoduleswitches then
  1423. concatstabto(curconstsegment);
  1424. {$endif GDB}
  1425. if owner^.symtabletype=globalsymtable then
  1426. begin
  1427. curconstsegment^.concat(new(pai_symbol,initname_global(mangledname,getsize)));
  1428. end
  1429. else
  1430. if owner^.symtabletype<>unitsymtable then
  1431. begin
  1432. if (cs_create_smart in aktmoduleswitches) or
  1433. DLLSource then
  1434. curconstsegment^.concat(new(pai_symbol,initname_global(mangledname,getsize)))
  1435. else
  1436. curconstsegment^.concat(new(pai_symbol,initname(mangledname,getsize)));
  1437. end;
  1438. aktfilepos:=storefilepos;
  1439. end;
  1440. {$ifdef GDB}
  1441. function ttypedconstsym.stabstring : pchar;
  1442. var
  1443. st : char;
  1444. begin
  1445. if (cs_gdb_gsym in aktglobalswitches) and (owner^.symtabletype in [unitsymtable,globalsymtable]) then
  1446. st := 'G'
  1447. else
  1448. st := 'S';
  1449. stabstring := strpnew('"'+name+':'+st+
  1450. typedconsttype.def^.numberstring+'",'+tostr(n_STSYM)+',0,'+
  1451. tostr(fileinfo.line)+','+mangledname);
  1452. end;
  1453. {$endif GDB}
  1454. {****************************************************************************
  1455. TCONSTSYM
  1456. ****************************************************************************}
  1457. constructor tconstsym.init(const n : string;t : tconsttyp;v : longint);
  1458. begin
  1459. inherited init(n);
  1460. typ:=constsym;
  1461. consttyp:=t;
  1462. value:=v;
  1463. ResStrIndex:=0;
  1464. consttype.reset;
  1465. len:=0;
  1466. end;
  1467. constructor tconstsym.init_def(const n : string;t : tconsttyp;v : longint;def : pdef);
  1468. begin
  1469. inherited init(n);
  1470. typ:=constsym;
  1471. consttyp:=t;
  1472. value:=v;
  1473. consttype.setdef(def);
  1474. len:=0;
  1475. end;
  1476. constructor tconstsym.init_string(const n : string;t : tconsttyp;str:pchar;l:longint);
  1477. begin
  1478. inherited init(n);
  1479. typ:=constsym;
  1480. consttyp:=t;
  1481. value:=longint(str);
  1482. consttype.reset;
  1483. len:=l;
  1484. if t=constresourcestring then
  1485. ResStrIndex:=registerresourcestring(name,pchar(value),len);
  1486. end;
  1487. constructor tconstsym.load;
  1488. var
  1489. pd : pbestreal;
  1490. ps : pnormalset;
  1491. begin
  1492. tsym.load;
  1493. typ:=constsym;
  1494. consttype.reset;
  1495. consttyp:=tconsttyp(readbyte);
  1496. case consttyp of
  1497. constint,
  1498. constbool,
  1499. constchar :
  1500. value:=readlong;
  1501. constpointer,
  1502. constord :
  1503. begin
  1504. consttype.load;
  1505. value:=readlong;
  1506. end;
  1507. conststring,constresourcestring :
  1508. begin
  1509. len:=readlong;
  1510. getmem(pchar(value),len+1);
  1511. current_ppu^.getdata(pchar(value)^,len);
  1512. if consttyp=constresourcestring then
  1513. ResStrIndex:=readlong;
  1514. end;
  1515. constreal :
  1516. begin
  1517. new(pd);
  1518. pd^:=readreal;
  1519. value:=longint(pd);
  1520. end;
  1521. constset :
  1522. begin
  1523. consttype.load;
  1524. new(ps);
  1525. readnormalset(ps^);
  1526. value:=longint(ps);
  1527. end;
  1528. constnil : ;
  1529. else
  1530. Message1(unit_f_ppu_invalid_entry,tostr(ord(consttyp)));
  1531. end;
  1532. end;
  1533. destructor tconstsym.done;
  1534. begin
  1535. case consttyp of
  1536. conststring,constresourcestring :
  1537. freemem(pchar(value),len+1);
  1538. constreal :
  1539. dispose(pbestreal(value));
  1540. constset :
  1541. dispose(pnormalset(value));
  1542. end;
  1543. inherited done;
  1544. end;
  1545. function tconstsym.mangledname : string;
  1546. begin
  1547. mangledname:=name;
  1548. end;
  1549. procedure tconstsym.deref;
  1550. begin
  1551. if consttyp in [constord,constpointer,constset] then
  1552. consttype.resolve;
  1553. end;
  1554. procedure tconstsym.write;
  1555. begin
  1556. tsym.write;
  1557. writebyte(byte(consttyp));
  1558. case consttyp of
  1559. constnil : ;
  1560. constint,
  1561. constbool,
  1562. constchar :
  1563. writelong(value);
  1564. constpointer,
  1565. constord :
  1566. begin
  1567. consttype.write;
  1568. writelong(value);
  1569. end;
  1570. conststring,constresourcestring :
  1571. begin
  1572. writelong(len);
  1573. current_ppu^.putdata(pchar(value)^,len);
  1574. if consttyp=constresourcestring then
  1575. writelong(ResStrIndex);
  1576. end;
  1577. constreal :
  1578. writereal(pbestreal(value)^);
  1579. constset :
  1580. begin
  1581. consttype.write;
  1582. writenormalset(pointer(value)^);
  1583. end;
  1584. else
  1585. internalerror(13);
  1586. end;
  1587. current_ppu^.writeentry(ibconstsym);
  1588. end;
  1589. {$ifdef GDB}
  1590. function tconstsym.stabstring : pchar;
  1591. var st : string;
  1592. begin
  1593. {even GDB v4.16 only now 'i' 'r' and 'e' !!!}
  1594. case consttyp of
  1595. conststring : begin
  1596. { I had to remove ibm2ascii !! }
  1597. st := pstring(value)^;
  1598. {st := ibm2ascii(pstring(value)^);}
  1599. st := 's'''+st+'''';
  1600. end;
  1601. constbool,
  1602. constint,
  1603. constpointer,
  1604. constord,
  1605. constchar : st := 'i'+tostr(value);
  1606. constreal : begin
  1607. system.str(pbestreal(value)^,st);
  1608. st := 'r'+st;
  1609. end;
  1610. { if we don't know just put zero !! }
  1611. else st:='i0';
  1612. {***SETCONST}
  1613. {constset:;} {*** I don't know what to do with a set.}
  1614. { sets are not recognized by GDB}
  1615. {***}
  1616. end;
  1617. stabstring := strpnew('"'+name+':c='+st+'",'+tostr(N_function)+',0,'+
  1618. tostr(fileinfo.line)+',0');
  1619. end;
  1620. procedure tconstsym.concatstabto(asmlist : paasmoutput);
  1621. begin
  1622. if consttyp <> conststring then
  1623. inherited concatstabto(asmlist);
  1624. end;
  1625. {$endif GDB}
  1626. {****************************************************************************
  1627. TENUMSYM
  1628. ****************************************************************************}
  1629. constructor tenumsym.init(const n : string;def : penumdef;v : longint);
  1630. begin
  1631. tsym.init(n);
  1632. typ:=enumsym;
  1633. definition:=def;
  1634. value:=v;
  1635. if def^.min>v then
  1636. def^.setmin(v);
  1637. if def^.max<v then
  1638. def^.setmax(v);
  1639. order;
  1640. end;
  1641. constructor tenumsym.load;
  1642. begin
  1643. tsym.load;
  1644. typ:=enumsym;
  1645. definition:=penumdef(readdefref);
  1646. value:=readlong;
  1647. nextenum := Nil;
  1648. end;
  1649. procedure tenumsym.deref;
  1650. begin
  1651. resolvedef(pdef(definition));
  1652. order;
  1653. end;
  1654. procedure tenumsym.order;
  1655. var
  1656. sym : penumsym;
  1657. begin
  1658. sym := definition^.firstenum;
  1659. if sym = nil then
  1660. begin
  1661. definition^.firstenum := @self;
  1662. nextenum := nil;
  1663. exit;
  1664. end;
  1665. { reorder the symbols in increasing value }
  1666. if value < sym^.value then
  1667. begin
  1668. nextenum := sym;
  1669. definition^.firstenum := @self;
  1670. end
  1671. else
  1672. begin
  1673. while (sym^.value <= value) and assigned(sym^.nextenum) do
  1674. sym := sym^.nextenum;
  1675. nextenum := sym^.nextenum;
  1676. sym^.nextenum := @self;
  1677. end;
  1678. end;
  1679. procedure tenumsym.write;
  1680. begin
  1681. tsym.write;
  1682. writedefref(definition);
  1683. writelong(value);
  1684. current_ppu^.writeentry(ibenumsym);
  1685. end;
  1686. {$ifdef GDB}
  1687. procedure tenumsym.concatstabto(asmlist : paasmoutput);
  1688. begin
  1689. {enum elements have no stab !}
  1690. end;
  1691. {$EndIf GDB}
  1692. {****************************************************************************
  1693. TTYPESYM
  1694. ****************************************************************************}
  1695. constructor ttypesym.init(const n : string;const tt : ttype);
  1696. begin
  1697. tsym.init(n);
  1698. typ:=typesym;
  1699. restype:=tt;
  1700. {$ifdef GDB}
  1701. isusedinstab := false;
  1702. {$endif GDB}
  1703. {$ifdef SYNONYM}
  1704. if assigned(restype.def) then
  1705. begin
  1706. if not(assigned(restype.def^.typesym)) then
  1707. begin
  1708. restype.def^.typesym:=@self;
  1709. synonym:=nil;
  1710. {$ifdef INCLUDEOK}
  1711. include(symoptions,sp_primary_typesym);
  1712. {$else}
  1713. symoptions:=symoptions+[sp_primary_typesym];
  1714. {$endif}
  1715. end
  1716. else
  1717. begin
  1718. synonym:=restype.def^.typesym^.synonym;
  1719. restype.def^.typesym^.synonym:=@self;
  1720. end;
  1721. end;
  1722. {$else}
  1723. { register the typesym for the definition }
  1724. if assigned(restype.def) and
  1725. not(assigned(restype.def^.typesym)) then
  1726. restype.def^.typesym:=@self;
  1727. {$endif}
  1728. end;
  1729. constructor ttypesym.initdef(const n : string;d : pdef);
  1730. var
  1731. t : ttype;
  1732. begin
  1733. t.setdef(d);
  1734. ttypesym.init(n,t);
  1735. end;
  1736. constructor ttypesym.load;
  1737. begin
  1738. tsym.load;
  1739. typ:=typesym;
  1740. {$ifdef SYNONYM}
  1741. synonym:=nil;
  1742. {$endif}
  1743. {$ifdef GDB}
  1744. isusedinstab := false;
  1745. {$endif GDB}
  1746. restype.load;
  1747. end;
  1748. {$ifdef SYNONYM}
  1749. destructor ttypesym.done;
  1750. var
  1751. prevsym : ptypesym;
  1752. begin
  1753. if assigned(restype.def) then
  1754. begin
  1755. prevsym:=restype.def^.typesym;
  1756. if prevsym=@self then
  1757. restype.def^.typesym:=synonym;
  1758. while assigned(prevsym) do
  1759. begin
  1760. if (prevsym^.synonym=@self) then
  1761. begin
  1762. prevsym^.synonym:=synonym;
  1763. break;
  1764. end;
  1765. prevsym:=prevsym^.synonym;
  1766. end;
  1767. end;
  1768. synonym:=nil;
  1769. inherited done;
  1770. end;
  1771. {$endif}
  1772. procedure ttypesym.prederef;
  1773. begin
  1774. restype.resolve;
  1775. {$ifdef SYNONYM}
  1776. if assigned(restype.def) then
  1777. begin
  1778. if (sp_primary_typesym in symoptions) then
  1779. begin
  1780. if restype.def^.typesym<>@self then
  1781. synonym:=restype.def^.typesym;
  1782. restype.def^.typesym:=@self;
  1783. end
  1784. else
  1785. begin
  1786. if assigned(restype.def^.typesym) then
  1787. begin
  1788. synonym:=restype.def^.typesym^.synonym;
  1789. if restype.def^.typesym<>@self then
  1790. restype.def^.typesym^.synonym:=@self;
  1791. end
  1792. else
  1793. restype.def^.typesym:=@self;
  1794. end;
  1795. if (restype.def^.deftype=recorddef) and assigned(precorddef(restype.def)^.symtable) and
  1796. (restype.def^.typesym=@self) then
  1797. precorddef(restype.def)^.symtable^.name:=stringdup('record '+name);
  1798. end;
  1799. {$endif}
  1800. end;
  1801. procedure ttypesym.write;
  1802. begin
  1803. tsym.write;
  1804. restype.write;
  1805. current_ppu^.writeentry(ibtypesym);
  1806. end;
  1807. procedure ttypesym.load_references;
  1808. begin
  1809. inherited load_references;
  1810. if (restype.def^.deftype=recorddef) then
  1811. precorddef(restype.def)^.symtable^.load_browser;
  1812. if (restype.def^.deftype=objectdef) then
  1813. pobjectdef(restype.def)^.symtable^.load_browser;
  1814. end;
  1815. function ttypesym.write_references : boolean;
  1816. begin
  1817. if not inherited write_references then
  1818. { write address of this symbol if record or object
  1819. even if no real refs are there
  1820. because we need it for the symtable }
  1821. if (restype.def^.deftype=recorddef) or
  1822. (restype.def^.deftype=objectdef) then
  1823. begin
  1824. writesymref(@self);
  1825. current_ppu^.writeentry(ibsymref);
  1826. end;
  1827. write_references:=true;
  1828. if (restype.def^.deftype=recorddef) then
  1829. precorddef(restype.def)^.symtable^.write_browser;
  1830. if (restype.def^.deftype=objectdef) then
  1831. pobjectdef(restype.def)^.symtable^.write_browser;
  1832. end;
  1833. {$ifdef BrowserLog}
  1834. procedure ttypesym.add_to_browserlog;
  1835. begin
  1836. inherited add_to_browserlog;
  1837. if (restype.def^.deftype=recorddef) then
  1838. precorddef(restype.def)^.symtable^.writebrowserlog;
  1839. if (restype.def^.deftype=objectdef) then
  1840. pobjectdef(restype.def)^.symtable^.writebrowserlog;
  1841. end;
  1842. {$endif BrowserLog}
  1843. {$ifdef GDB}
  1844. function ttypesym.stabstring : pchar;
  1845. var
  1846. stabchar : string[2];
  1847. short : string;
  1848. begin
  1849. if restype.def^.deftype in tagtypes then
  1850. stabchar := 'Tt'
  1851. else
  1852. stabchar := 't';
  1853. short := '"'+name+':'+stabchar+restype.def^.numberstring
  1854. +'",'+tostr(N_LSYM)+',0,'+tostr(fileinfo.line)+',0';
  1855. stabstring := strpnew(short);
  1856. end;
  1857. procedure ttypesym.concatstabto(asmlist : paasmoutput);
  1858. begin
  1859. {not stabs for forward defs }
  1860. if assigned(restype.def) then
  1861. if (restype.def^.typesym = @self) then
  1862. restype.def^.concatstabto(asmlist)
  1863. else
  1864. inherited concatstabto(asmlist);
  1865. end;
  1866. {$endif GDB}
  1867. {****************************************************************************
  1868. TSYSSYM
  1869. ****************************************************************************}
  1870. constructor tsyssym.init(const n : string;l : longint);
  1871. begin
  1872. inherited init(n);
  1873. typ:=syssym;
  1874. number:=l;
  1875. end;
  1876. constructor tsyssym.load;
  1877. begin
  1878. tsym.load;
  1879. typ:=syssym;
  1880. number:=readlong;
  1881. end;
  1882. destructor tsyssym.done;
  1883. begin
  1884. inherited done;
  1885. end;
  1886. procedure tsyssym.write;
  1887. begin
  1888. tsym.write;
  1889. writelong(number);
  1890. current_ppu^.writeentry(ibsyssym);
  1891. end;
  1892. {$ifdef GDB}
  1893. procedure tsyssym.concatstabto(asmlist : paasmoutput);
  1894. begin
  1895. end;
  1896. {$endif GDB}
  1897. {****************************************************************************
  1898. TMACROSYM
  1899. ****************************************************************************}
  1900. constructor tmacrosym.init(const n : string);
  1901. begin
  1902. inherited init(n);
  1903. typ:=macrosym;
  1904. defined:=true;
  1905. defined_at_startup:=false;
  1906. is_used:=false;
  1907. buftext:=nil;
  1908. buflen:=0;
  1909. end;
  1910. destructor tmacrosym.done;
  1911. begin
  1912. if assigned(buftext) then
  1913. freemem(buftext,buflen);
  1914. inherited done;
  1915. end;
  1916. {
  1917. $Log$
  1918. Revision 1.146 2000-05-18 17:05:17 peter
  1919. * fixed size of const parameters in asm readers
  1920. Revision 1.145 2000/05/03 14:34:05 pierre
  1921. * fix the unitsym chain
  1922. Revision 1.144 2000/04/27 10:06:04 pierre
  1923. * fix for snapshot failue
  1924. * order_overloaded reintrocduced and adapted to operators
  1925. Revision 1.143 2000/04/26 08:54:19 pierre
  1926. * More changes for operator bug
  1927. Order_overloaded method removed because it conflicted with
  1928. new implementation where the defs are ordered
  1929. according to the unit loading order !
  1930. Revision 1.142 2000/04/19 08:24:41 pierre
  1931. * remove a memory leak with resourcestrings
  1932. Revision 1.141 2000/04/03 14:50:05 pierre
  1933. * avoid cyclic overloaded list for operators
  1934. Revision 1.140 2000/03/01 00:03:10 pierre
  1935. * fixes for locals in inlined procedures
  1936. fix for bug797
  1937. + stabs generation for inlined paras and locals
  1938. Revision 1.139 2000/02/11 13:53:49 pierre
  1939. * avoid stack overflow in tref.done (bug 846)
  1940. Revision 1.138 2000/02/09 13:23:05 peter
  1941. * log truncated
  1942. Revision 1.137 2000/02/04 08:47:10 florian
  1943. * better register variable allocation in -Or mode
  1944. Revision 1.136 2000/01/07 01:14:40 peter
  1945. * updated copyright to 2000
  1946. Revision 1.135 2000/01/03 19:26:04 peter
  1947. * fixed resolving of ttypesym which are reference from object/record
  1948. fields.
  1949. Revision 1.134 1999/12/20 21:42:37 pierre
  1950. + dllversion global variable
  1951. * FPC_USE_CPREFIX code removed, not necessary anymore
  1952. as we use .edata direct writing by default now.
  1953. Revision 1.133 1999/12/14 09:58:42 florian
  1954. + compiler checks now if a goto leaves an exception block
  1955. Revision 1.132 1999/12/01 12:42:33 peter
  1956. * fixed bug 698
  1957. * removed some notes about unused vars
  1958. Revision 1.131 1999/11/30 10:40:55 peter
  1959. + ttype, tsymlist
  1960. Revision 1.130 1999/11/26 00:19:12 peter
  1961. * property overriding dereference fix, but it need a bigger redesign
  1962. which i'll do tomorrow. This quick hack is for the lazarus ppl so
  1963. they can hack on mwcustomedit.
  1964. Revision 1.129 1999/11/21 01:42:37 pierre
  1965. * Nextoverloading ordering fix
  1966. Revision 1.128 1999/11/20 01:22:20 pierre
  1967. + cond FPC_USE_CPREFIX (needs also some RTL changes)
  1968. this allows to use unit global vars as DLL exports
  1969. (the underline prefix seems needed by dlltool)
  1970. Revision 1.127 1999/11/17 17:05:04 pierre
  1971. * Notes/hints changes
  1972. Revision 1.126 1999/11/15 22:00:48 peter
  1973. * labels used but not defined give error instead of warning, the warning
  1974. is now only with declared but not defined and not used.
  1975. Revision 1.125 1999/11/08 14:02:17 florian
  1976. * problem with "index X"-properties solved
  1977. * typed constants of class references are now allowed
  1978. Revision 1.124 1999/11/06 14:34:27 peter
  1979. * truncated log to 20 revs
  1980. Revision 1.123 1999/11/05 17:18:03 pierre
  1981. * local browsing works at first level
  1982. ie for function defined in interface or implementation
  1983. not yet for functions inside other functions
  1984. Revision 1.122 1999/10/21 16:41:41 florian
  1985. * problems with readln fixed: esi wasn't restored correctly when
  1986. reading ordinal fields of objects futher the register allocation
  1987. didn't take care of the extra register when reading ordinal values
  1988. * enumerations can now be used in constant indexes of properties
  1989. Revision 1.121 1999/10/01 08:02:48 peter
  1990. * forward type declaration rewritten
  1991. Revision 1.120 1999/09/27 23:44:58 peter
  1992. * procinfo is now a pointer
  1993. * support for result setting in sub procedure
  1994. Revision 1.119 1999/09/26 21:30:22 peter
  1995. + constant pointer support which can happend with typecasting like
  1996. const p=pointer(1)
  1997. * better procvar parsing in typed consts
  1998. Revision 1.118 1999/09/20 16:39:03 peter
  1999. * cs_create_smart instead of cs_smartlink
  2000. * -CX is create smartlink
  2001. * -CD is create dynamic, but does nothing atm.
  2002. }