symsym.inc 65 KB

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