pdecvar.pas 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Parses variable declarations. Used for var statement and record
  5. definitions
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit pdecvar;
  20. {$i fpcdefs.inc}
  21. interface
  22. procedure read_var_decs(is_record,is_object,is_threadvar:boolean);
  23. implementation
  24. uses
  25. { common }
  26. cutils,cclasses,
  27. { global }
  28. globtype,globals,tokens,verbose,
  29. systems,
  30. { symtable }
  31. symconst,symbase,symtype,symdef,symsym,symtable,defutil,
  32. fmodule,paramgr,
  33. { pass 1 }
  34. node,
  35. nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,
  36. { parser }
  37. scanner,
  38. pbase,pexpr,ptype,ptconst,pdecsub,
  39. { link }
  40. import
  41. {$ifdef Delphi}
  42. ,dmisc
  43. ,sysutils
  44. {$endif}
  45. ;
  46. const
  47. variantrecordlevel : longint = 0;
  48. procedure read_var_decs(is_record,is_object,is_threadvar:boolean);
  49. { reads the filed of a record into a }
  50. { symtablestack, if record=false }
  51. { variants are forbidden, so this procedure }
  52. { can be used to read object fields }
  53. { if absolute is true, ABSOLUTE and file }
  54. { types are allowed }
  55. { => the procedure is also used to read }
  56. { a sequence of variable declaration }
  57. procedure insert_syms(sc : tsinglelist;tt : ttype;is_threadvar : boolean; addsymopts : tsymoptions);
  58. { inserts the symbols of sc in st with def as definition or sym as ttypesym, sc is disposed }
  59. var
  60. vs,vs2 : tvarsym;
  61. begin
  62. vs:=tvarsym(sc.first);
  63. while assigned(vs) do
  64. begin
  65. vs.vartype:=tt;
  66. { insert any additional hint directives }
  67. vs.symoptions := vs.symoptions + addsymopts;
  68. if (sp_static in current_object_option) then
  69. include(vs.symoptions,sp_static);
  70. if is_threadvar then
  71. include(vs.varoptions,vo_is_thread_var);
  72. { static data fields are inserted in the globalsymtable }
  73. if (symtablestack.symtabletype=objectsymtable) and
  74. (sp_static in current_object_option) then
  75. begin
  76. vs2:=tvarsym.create('$'+lower(symtablestack.name^)+'_'+vs.name,vs_value,tt);
  77. symtablestack.defowner.owner.insert(vs2);
  78. symtablestack.defowner.owner.insertvardata(vs2);
  79. end
  80. else
  81. begin
  82. { external data is not possible here }
  83. symtablestack.insertvardata(vs);
  84. end;
  85. vs:=tvarsym(vs.listnext);
  86. end;
  87. end;
  88. var
  89. sc : tsinglelist;
  90. old_block_type : tblock_type;
  91. oldsymtablestack : tsymtable;
  92. symdone : boolean;
  93. { to handle absolute }
  94. abssym : tabsolutesym;
  95. { c var }
  96. newtype : ttypesym;
  97. is_dll,
  98. is_gpc_name,is_cdecl,
  99. extern_var,export_var : boolean;
  100. old_current_object_option : tsymoptions;
  101. hs,sorg,C_name,dll_name : string;
  102. tt,casetype : ttype;
  103. { Delphi initialized vars }
  104. tconstsym : ttypedconstsym;
  105. { maxsize contains the max. size of a variant }
  106. { startvarrec contains the start of the variant part of a record }
  107. maxsize, startvarrecsize : longint;
  108. usedalign,
  109. minalignment,maxalignment,startvarrecalign : byte;
  110. pt : tnode;
  111. vs,vs2 : tvarsym;
  112. srsym : tsym;
  113. srsymtable : tsymtable;
  114. unionsymtable : tsymtable;
  115. offset : longint;
  116. uniondef : trecorddef;
  117. unionsym : tvarsym;
  118. uniontype : ttype;
  119. dummysymoptions : tsymoptions;
  120. begin
  121. old_current_object_option:=current_object_option;
  122. { all variables are public if not in a object declaration }
  123. if not is_object then
  124. current_object_option:=[sp_public];
  125. old_block_type:=block_type;
  126. block_type:=bt_type;
  127. is_gpc_name:=false;
  128. { Force an expected ID error message }
  129. if not (token in [_ID,_CASE,_END]) then
  130. consume(_ID);
  131. { read vars }
  132. sc:=tsinglelist.create;
  133. while (token=_ID) and
  134. not(is_object and (idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED])) do
  135. begin
  136. sorg:=orgpattern;
  137. sc.reset;
  138. repeat
  139. vs:=tvarsym.create(orgpattern,vs_value,generrortype);
  140. symtablestack.insert(vs);
  141. if assigned(vs.owner) then
  142. sc.insert(vs)
  143. else
  144. vs.free;
  145. consume(_ID);
  146. until not try_to_consume(_COMMA);
  147. consume(_COLON);
  148. if (m_gpc in aktmodeswitches) and
  149. not(is_record or is_object or is_threadvar) and
  150. (token=_ID) and (orgpattern='__asmname__') then
  151. begin
  152. consume(_ID);
  153. C_name:=get_stringconst;
  154. Is_gpc_name:=true;
  155. end;
  156. { this is needed for Delphi mode at least
  157. but should be OK for all modes !! (PM) }
  158. ignore_equal:=true;
  159. if is_record then
  160. begin
  161. { for records, don't search the recordsymtable for
  162. the symbols of the types }
  163. oldsymtablestack:=symtablestack;
  164. symtablestack:=symtablestack.next;
  165. read_type(tt,'');
  166. symtablestack:=oldsymtablestack;
  167. end
  168. else
  169. read_type(tt,'');
  170. { types that use init/final are not allowed in variant parts, but
  171. classes are allowed }
  172. if (variantrecordlevel>0) and
  173. (tt.def.needs_inittable and not is_class(tt.def)) then
  174. Message(parser_e_cant_use_inittable_here);
  175. ignore_equal:=false;
  176. symdone:=false;
  177. if is_gpc_name then
  178. begin
  179. vs:=tvarsym(sc.first);
  180. if assigned(vs.listnext) then
  181. Message(parser_e_absolute_only_one_var);
  182. vs.vartype:=tt;
  183. include(vs.varoptions,vo_is_C_var);
  184. vs.set_mangledname(target_info.Cprefix+sorg);
  185. include(vs.varoptions,vo_is_external);
  186. symdone:=true;
  187. end;
  188. { check for absolute }
  189. if not symdone and
  190. (idtoken=_ABSOLUTE) and not(is_record or is_object or is_threadvar) then
  191. begin
  192. consume(_ABSOLUTE);
  193. abssym:=nil;
  194. { only allowed for one var }
  195. vs:=tvarsym(sc.first);
  196. if assigned(vs.listnext) then
  197. Message(parser_e_absolute_only_one_var);
  198. { parse the rest }
  199. pt:=expr;
  200. { transform a procvar calln to loadn }
  201. if pt.nodetype=calln then
  202. load_procvar_from_calln(pt);
  203. { check allowed absolute types }
  204. if (pt.nodetype=stringconstn) or
  205. (is_constcharnode(pt)) then
  206. begin
  207. abssym:=tabsolutesym.create(vs.realname,tt);
  208. abssym.fileinfo:=vs.fileinfo;
  209. if pt.nodetype=stringconstn then
  210. hs:=strpas(tstringconstnode(pt).value_str)
  211. else
  212. hs:=chr(tordconstnode(pt).value);
  213. consume(token);
  214. abssym.abstyp:=toasm;
  215. abssym.asmname:=stringdup(hs);
  216. { replace the varsym }
  217. symtablestack.replace(vs,abssym);
  218. vs.free;
  219. end
  220. { variable }
  221. else if (pt.nodetype=loadn) then
  222. begin
  223. { we should check the result type of srsym }
  224. if not (tloadnode(pt).symtableentry.typ in [varsym,typedconstsym]) then
  225. Message(parser_e_absolute_only_to_var_or_const);
  226. abssym:=tabsolutesym.create(vs.realname,tt);
  227. abssym.fileinfo:=vs.fileinfo;
  228. abssym.abstyp:=tovar;
  229. abssym.ref:=tstoredsym(tloadnode(pt).symtableentry);
  230. symtablestack.replace(vs,abssym);
  231. vs.free;
  232. { the variable cannot be put into a register
  233. if the size definition is not the same.
  234. }
  235. if tloadnode(pt).symtableentry.typ = varsym then
  236. begin
  237. if abssym.vartype.def <>
  238. tvarsym(tloadnode(pt).symtableentry).vartype.def then
  239. tvarsym(tloadnode(pt).symtableentry).varoptions:=
  240. tvarsym(tloadnode(pt).symtableentry).varoptions-[vo_regable,vo_fpuregable]
  241. end;
  242. end
  243. { address }
  244. else if is_constintnode(pt) and
  245. ((target_info.system in [system_i386_go32v2,system_i386_watcom]) or
  246. (m_objfpc in aktmodeswitches) or
  247. (m_delphi in aktmodeswitches)) then
  248. begin
  249. abssym:=tabsolutesym.create(vs.realname,tt);
  250. abssym.fileinfo:=vs.fileinfo;
  251. abssym.abstyp:=toaddr;
  252. abssym.absseg:=false;
  253. abssym.address:=tordconstnode(pt).value;
  254. if (target_info.system in [system_i386_go32v2,system_i386_watcom]) and
  255. try_to_consume(_COLON) then
  256. begin
  257. pt.free;
  258. pt:=expr;
  259. if is_constintnode(pt) then
  260. begin
  261. abssym.address:=abssym.address shl 4+tordconstnode(pt).value;
  262. abssym.absseg:=true;
  263. end
  264. else
  265. Message(type_e_ordinal_expr_expected);
  266. end;
  267. symtablestack.replace(vs,abssym);
  268. vs.free;
  269. end
  270. else
  271. Message(parser_e_absolute_only_to_var_or_const);
  272. if assigned(abssym) then
  273. begin
  274. { try to consume the hint directives with absolute symbols }
  275. dummysymoptions:=[];
  276. try_consume_hintdirective(dummysymoptions);
  277. abssym.symoptions := abssym.symoptions + dummysymoptions;
  278. end;
  279. pt.free;
  280. symdone:=true;
  281. end;
  282. { Handling of Delphi typed const = initialized vars ! }
  283. { When should this be rejected ?
  284. - in parasymtable
  285. - in record or object
  286. - ... (PM) }
  287. if (token=_EQUAL) and
  288. not(m_tp7 in aktmodeswitches) and
  289. not(symtablestack.symtabletype in [parasymtable]) and
  290. not is_record and
  291. not is_object then
  292. begin
  293. vs:=tvarsym(sc.first);
  294. if assigned(vs.listnext) then
  295. Message(parser_e_initialized_only_one_var);
  296. if is_threadvar then
  297. Message(parser_e_initialized_not_for_threadvar);
  298. if symtablestack.symtabletype=localsymtable then
  299. begin
  300. consume(_EQUAL);
  301. tconstsym:=ttypedconstsym.createtype('default'+vs.realname,tt,false);
  302. vs.defaultconstsym:=tconstsym;
  303. symtablestack.insert(tconstsym);
  304. symtablestack.insertconstdata(tconstsym);
  305. readtypedconst(tt,tconstsym,false);
  306. end
  307. else
  308. begin
  309. tconstsym:=ttypedconstsym.createtype(vs.realname,tt,true);
  310. tconstsym.fileinfo:=vs.fileinfo;
  311. symtablestack.replace(vs,tconstsym);
  312. vs.free;
  313. symtablestack.insertconstdata(tconstsym);
  314. consume(_EQUAL);
  315. readtypedconst(tt,tconstsym,true);
  316. symdone:=true;
  317. end;
  318. end;
  319. { if the symbol is not completely handled, then try to parse the
  320. hint directives }
  321. if not symdone then
  322. begin
  323. dummysymoptions:=[];
  324. try_consume_hintdirective(dummysymoptions);
  325. end;
  326. { for a record there doesn't need to be a ; before the END or ) }
  327. if not((is_record or is_object) and (token in [_END,_RKLAMMER])) then
  328. consume(_SEMICOLON);
  329. { procvar handling }
  330. if (tt.def.deftype=procvardef) and (tt.def.typesym=nil) then
  331. begin
  332. newtype:=ttypesym.create('unnamed',tt);
  333. parse_var_proc_directives(tsym(newtype));
  334. newtype.restype.def:=nil;
  335. tt.def.typesym:=nil;
  336. newtype.free;
  337. end;
  338. { Check for variable directives }
  339. if not symdone and (token=_ID) then
  340. begin
  341. { Check for C Variable declarations }
  342. if (m_cvar_support in aktmodeswitches) and
  343. not(is_record or is_object or is_threadvar) and
  344. (idtoken in [_EXPORT,_EXTERNAL,_PUBLIC,_CVAR]) then
  345. begin
  346. { only allowed for one var }
  347. vs:=tvarsym(sc.first);
  348. if assigned(vs.listnext) then
  349. Message(parser_e_absolute_only_one_var);
  350. { set type of the var }
  351. vs.vartype:=tt;
  352. vs.symoptions := vs.symoptions + dummysymoptions;
  353. { defaults }
  354. is_dll:=false;
  355. is_cdecl:=false;
  356. extern_var:=false;
  357. export_var:=false;
  358. C_name:=sorg;
  359. { cdecl }
  360. if idtoken=_CVAR then
  361. begin
  362. consume(_CVAR);
  363. consume(_SEMICOLON);
  364. is_cdecl:=true;
  365. C_name:=target_info.Cprefix+sorg;
  366. end;
  367. { external }
  368. if idtoken=_EXTERNAL then
  369. begin
  370. consume(_EXTERNAL);
  371. extern_var:=true;
  372. end;
  373. { export }
  374. if idtoken in [_EXPORT,_PUBLIC] then
  375. begin
  376. consume(_ID);
  377. if extern_var or
  378. (symtablestack.symtabletype in [parasymtable,localsymtable]) then
  379. Message(parser_e_not_external_and_export)
  380. else
  381. export_var:=true;
  382. end;
  383. { external and export need a name after when no cdecl is used }
  384. if not is_cdecl then
  385. begin
  386. { dll name ? }
  387. if (extern_var) and (idtoken<>_NAME) then
  388. begin
  389. is_dll:=true;
  390. dll_name:=get_stringconst;
  391. end;
  392. consume(_NAME);
  393. C_name:=get_stringconst;
  394. end;
  395. { consume the ; when export or external is used }
  396. if extern_var or export_var then
  397. consume(_SEMICOLON);
  398. { set some vars options }
  399. if is_dll then
  400. include(vs.varoptions,vo_is_dll_var)
  401. else
  402. include(vs.varoptions,vo_is_C_var);
  403. vs.set_mangledname(C_Name);
  404. if export_var then
  405. begin
  406. inc(vs.refs);
  407. include(vs.varoptions,vo_is_exported);
  408. end;
  409. if extern_var then
  410. include(vs.varoptions,vo_is_external);
  411. { insert in the datasegment when it is not external }
  412. if not extern_var then
  413. symtablestack.insertvardata(vs);
  414. { now we can insert it in the import lib if its a dll, or
  415. add it to the externals }
  416. if extern_var then
  417. begin
  418. if is_dll then
  419. begin
  420. if not(current_module.uses_imports) then
  421. begin
  422. current_module.uses_imports:=true;
  423. importlib.preparelib(current_module.modulename^);
  424. end;
  425. importlib.importvariable(vs,C_name,dll_name);
  426. end
  427. else
  428. if target_info.DllScanSupported then
  429. current_module.Externals.insert(tExternalsItem.create(vs.mangledname));
  430. end;
  431. symdone:=true;
  432. end
  433. else
  434. if (is_object) and (cs_static_keyword in aktmoduleswitches) and (idtoken=_STATIC) then
  435. begin
  436. include(current_object_option,sp_static);
  437. insert_syms(sc,tt,false,dummysymoptions);
  438. exclude(current_object_option,sp_static);
  439. consume(_STATIC);
  440. consume(_SEMICOLON);
  441. symdone:=true;
  442. end;
  443. end;
  444. { insert it in the symtable, if not done yet }
  445. if not symdone then
  446. begin
  447. { save object option, because we can turn of the sp_published }
  448. if (sp_published in current_object_option) and
  449. not(is_class(tt.def)) then
  450. begin
  451. Message(parser_e_cant_publish_that);
  452. exclude(current_object_option,sp_published);
  453. { recover by changing access type to public }
  454. vs2:=tvarsym(sc.first);
  455. while assigned (vs2) do
  456. begin
  457. exclude(vs2.symoptions,sp_published);
  458. include(vs2.symoptions,sp_public);
  459. vs2:=tvarsym(vs2.listnext);
  460. end;
  461. end
  462. else
  463. if (sp_published in current_object_option) and
  464. not(oo_can_have_published in tobjectdef(tt.def).objectoptions) then
  465. begin
  466. Message(parser_e_only_publishable_classes_can__be_published);
  467. exclude(current_object_option,sp_published);
  468. end;
  469. insert_syms(sc,tt,is_threadvar,dummysymoptions);
  470. current_object_option:=old_current_object_option;
  471. end;
  472. end;
  473. { Check for Case }
  474. if is_record and (token=_CASE) then
  475. begin
  476. maxsize:=0;
  477. maxalignment:=0;
  478. consume(_CASE);
  479. sorg:=orgpattern;
  480. hs:=pattern;
  481. searchsym(hs,srsym,srsymtable);
  482. { may be only a type: }
  483. if assigned(srsym) and (srsym.typ in [typesym,unitsym]) then
  484. begin
  485. { for records, don't search the recordsymtable for
  486. the symbols of the types }
  487. oldsymtablestack:=symtablestack;
  488. symtablestack:=symtablestack.next;
  489. read_type(casetype,'');
  490. symtablestack:=oldsymtablestack;
  491. end
  492. else
  493. begin
  494. consume(_ID);
  495. consume(_COLON);
  496. { for records, don't search the recordsymtable for
  497. the symbols of the types }
  498. oldsymtablestack:=symtablestack;
  499. symtablestack:=symtablestack.next;
  500. read_type(casetype,'');
  501. symtablestack:=oldsymtablestack;
  502. vs:=tvarsym.create(sorg,vs_value,casetype);
  503. symtablestack.insert(vs);
  504. symtablestack.insertvardata(vs);
  505. end;
  506. if not(is_ordinal(casetype.def)) or is_64bitint(casetype.def) then
  507. Message(type_e_ordinal_expr_expected);
  508. consume(_OF);
  509. UnionSymtable:=trecordsymtable.create;
  510. Unionsymtable.next:=symtablestack;
  511. registerdef:=false;
  512. UnionDef:=trecorddef.create(unionsymtable);
  513. uniondef.isunion:=true;
  514. if assigned(symtablestack.defowner) then
  515. Uniondef.owner:=symtablestack.defowner.owner;
  516. registerdef:=true;
  517. symtablestack:=UnionSymtable;
  518. startvarrecsize:=symtablestack.datasize;
  519. startvarrecalign:=symtablestack.dataalignment;
  520. repeat
  521. repeat
  522. pt:=comp_expr(true);
  523. if not(pt.nodetype=ordconstn) then
  524. Message(cg_e_illegal_expression);
  525. pt.free;
  526. if token=_COMMA then
  527. consume(_COMMA)
  528. else
  529. break;
  530. until false;
  531. consume(_COLON);
  532. { read the vars }
  533. consume(_LKLAMMER);
  534. inc(variantrecordlevel);
  535. if token<>_RKLAMMER then
  536. read_var_decs(true,false,false);
  537. dec(variantrecordlevel);
  538. consume(_RKLAMMER);
  539. { calculates maximal variant size }
  540. maxsize:=max(maxsize,symtablestack.datasize);
  541. maxalignment:=max(maxalignment,symtablestack.dataalignment);
  542. { the items of the next variant are overlayed }
  543. symtablestack.datasize:=startvarrecsize;
  544. symtablestack.dataalignment:=startvarrecalign;
  545. if (token<>_END) and (token<>_RKLAMMER) then
  546. consume(_SEMICOLON)
  547. else
  548. break;
  549. until (token=_END) or (token=_RKLAMMER);
  550. { at last set the record size to that of the biggest variant }
  551. symtablestack.datasize:=maxsize;
  552. symtablestack.dataalignment:=maxalignment;
  553. uniontype.def:=uniondef;
  554. uniontype.sym:=nil;
  555. UnionSym:=tvarsym.create('$case',vs_value,uniontype);
  556. symtablestack:=symtablestack.next;
  557. { we do NOT call symtablestack.insert
  558. on purpose PM }
  559. if aktalignment.recordalignmax=-1 then
  560. begin
  561. {$ifdef i386}
  562. if maxalignment>2 then
  563. minalignment:=4
  564. else if maxalignment>1 then
  565. minalignment:=2
  566. else
  567. minalignment:=1;
  568. {$else}
  569. {$ifdef m68k}
  570. minalignment:=2;
  571. {$endif}
  572. minalignment:=1;
  573. {$endif}
  574. end
  575. else
  576. minalignment:=maxalignment;
  577. usedalign:=used_align(maxalignment,minalignment,maxalignment);
  578. offset:=align(symtablestack.datasize,usedalign);
  579. symtablestack.datasize:=offset+unionsymtable.datasize;
  580. if maxalignment>symtablestack.dataalignment then
  581. symtablestack.dataalignment:=maxalignment;
  582. trecordsymtable(Unionsymtable).Insert_in(symtablestack,offset);
  583. Unionsym.owner:=nil;
  584. unionsym.free;
  585. uniondef.owner:=nil;
  586. uniondef.free;
  587. end;
  588. block_type:=old_block_type;
  589. current_object_option:=old_current_object_option;
  590. { free the list }
  591. sc.free;
  592. end;
  593. end.
  594. {
  595. $Log$
  596. Revision 1.50 2003-09-07 14:14:51 florian
  597. * proper error recovering from invalid published fields
  598. Revision 1.49 2003/09/05 17:41:12 florian
  599. * merged Wiktor's Watcom patches in 1.1
  600. Revision 1.48 2003/07/02 22:18:04 peter
  601. * paraloc splitted in callerparaloc,calleeparaloc
  602. * sparc calling convention updates
  603. Revision 1.47 2003/05/09 17:47:03 peter
  604. * self moved to hidden parameter
  605. * removed hdisposen,hnewn,selfn
  606. Revision 1.46 2003/04/25 20:59:33 peter
  607. * removed funcretn,funcretsym, function result is now in varsym
  608. and aliases for result and function name are added using absolutesym
  609. * vs_hidden parameter for funcret passed in parameter
  610. * vs_hidden fixes
  611. * writenode changed to printnode and released from extdebug
  612. * -vp option added to generate a tree.log with the nodetree
  613. * nicer printnode for statements, callnode
  614. Revision 1.45 2003/03/17 18:56:02 peter
  615. * fix crash with duplicate id
  616. Revision 1.44 2003/01/02 11:14:02 michael
  617. + Patch from peter to support initial values for local variables
  618. Revision 1.43 2002/12/27 15:22:20 peter
  619. * don't allow initialized threadvars
  620. Revision 1.42 2002/12/07 14:04:59 carl
  621. * convert some vars from longint -> byte
  622. Revision 1.41 2002/11/29 22:31:19 carl
  623. + unimplemented hint directive added
  624. * hint directive parsing implemented
  625. * warning on these directives
  626. Revision 1.40 2002/11/25 17:43:21 peter
  627. * splitted defbase in defutil,symutil,defcmp
  628. * merged isconvertable and is_equal into compare_defs(_ext)
  629. * made operator search faster by walking the list only once
  630. Revision 1.39 2002/11/15 16:29:31 peter
  631. * made tasmsymbol.refs private (merged)
  632. Revision 1.38 2002/11/15 01:58:53 peter
  633. * merged changes from 1.0.7 up to 04-11
  634. - -V option for generating bug report tracing
  635. - more tracing for option parsing
  636. - errors for cdecl and high()
  637. - win32 import stabs
  638. - win32 records<=8 are returned in eax:edx (turned off by default)
  639. - heaptrc update
  640. - more info for temp management in .s file with EXTDEBUG
  641. Revision 1.37 2002/10/05 15:18:43 carl
  642. * fix heap leaks
  643. Revision 1.36 2002/10/05 12:43:26 carl
  644. * fixes for Delphi 6 compilation
  645. (warning : Some features do not work under Delphi)
  646. Revision 1.35 2002/10/04 20:53:05 carl
  647. * bugfix of crash
  648. Revision 1.34 2002/10/03 21:22:01 carl
  649. * don't make the vars regable if they are absolute and their definitions
  650. are not the same.
  651. Revision 1.33 2002/09/16 18:08:45 peter
  652. * fix setting of sp_static
  653. Revision 1.32 2002/09/09 17:34:15 peter
  654. * tdicationary.replace added to replace and item in a dictionary. This
  655. is only allowed for the same name
  656. * varsyms are inserted in symtable before the types are parsed. This
  657. fixes the long standing "var longint : longint" bug
  658. - consume_idlist and idstringlist removed. The loops are inserted
  659. at the callers place and uses the symtable for duplicate id checking
  660. Revision 1.31 2002/08/25 19:25:20 peter
  661. * sym.insert_in_data removed
  662. * symtable.insertvardata/insertconstdata added
  663. * removed insert_in_data call from symtable.insert, it needs to be
  664. called separatly. This allows to deref the address calculation
  665. * procedures now calculate the parast addresses after the procedure
  666. directives are parsed. This fixes the cdecl parast problem
  667. * push_addr_param has an extra argument that specifies if cdecl is used
  668. or not
  669. Revision 1.30 2002/07/29 21:23:44 florian
  670. * more fixes for the ppc
  671. + wrappers for the tcnvnode.first_* stuff introduced
  672. Revision 1.29 2002/07/26 21:15:40 florian
  673. * rewrote the system handling
  674. Revision 1.28 2002/07/20 11:57:55 florian
  675. * types.pas renamed to defbase.pas because D6 contains a types
  676. unit so this would conflicts if D6 programms are compiled
  677. + Willamette/SSE2 instructions to assembler added
  678. Revision 1.27 2002/06/10 13:41:26 jonas
  679. * fixed bug 1985
  680. Revision 1.26 2002/05/18 13:34:12 peter
  681. * readded missing revisions
  682. Revision 1.25 2002/05/16 19:46:43 carl
  683. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  684. + try to fix temp allocation (still in ifdef)
  685. + generic constructor calls
  686. + start of tassembler / tmodulebase class cleanup
  687. Revision 1.23 2002/04/21 18:57:24 peter
  688. * fixed memleaks when file can't be opened
  689. }