pdecvar.pas 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  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 : 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=system_i386_go32v2) 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=system_i386_go32v2) 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. paramanager.create_param_loc_info(tabstractprocdef(tt.def));
  335. newtype.restype.def:=nil;
  336. tt.def.typesym:=nil;
  337. newtype.free;
  338. end;
  339. { Check for variable directives }
  340. if not symdone and (token=_ID) then
  341. begin
  342. { Check for C Variable declarations }
  343. if (m_cvar_support in aktmodeswitches) and
  344. not(is_record or is_object or is_threadvar) and
  345. (idtoken in [_EXPORT,_EXTERNAL,_PUBLIC,_CVAR]) then
  346. begin
  347. { only allowed for one var }
  348. vs:=tvarsym(sc.first);
  349. if assigned(vs.listnext) then
  350. Message(parser_e_absolute_only_one_var);
  351. { set type of the var }
  352. vs.vartype:=tt;
  353. vs.symoptions := vs.symoptions + dummysymoptions;
  354. { defaults }
  355. is_dll:=false;
  356. is_cdecl:=false;
  357. extern_var:=false;
  358. export_var:=false;
  359. C_name:=sorg;
  360. { cdecl }
  361. if idtoken=_CVAR then
  362. begin
  363. consume(_CVAR);
  364. consume(_SEMICOLON);
  365. is_cdecl:=true;
  366. C_name:=target_info.Cprefix+sorg;
  367. end;
  368. { external }
  369. if idtoken=_EXTERNAL then
  370. begin
  371. consume(_EXTERNAL);
  372. extern_var:=true;
  373. end;
  374. { export }
  375. if idtoken in [_EXPORT,_PUBLIC] then
  376. begin
  377. consume(_ID);
  378. if extern_var or
  379. (symtablestack.symtabletype in [parasymtable,localsymtable]) then
  380. Message(parser_e_not_external_and_export)
  381. else
  382. export_var:=true;
  383. end;
  384. { external and export need a name after when no cdecl is used }
  385. if not is_cdecl then
  386. begin
  387. { dll name ? }
  388. if (extern_var) and (idtoken<>_NAME) then
  389. begin
  390. is_dll:=true;
  391. dll_name:=get_stringconst;
  392. end;
  393. consume(_NAME);
  394. C_name:=get_stringconst;
  395. end;
  396. { consume the ; when export or external is used }
  397. if extern_var or export_var then
  398. consume(_SEMICOLON);
  399. { set some vars options }
  400. if is_dll then
  401. include(vs.varoptions,vo_is_dll_var)
  402. else
  403. include(vs.varoptions,vo_is_C_var);
  404. vs.set_mangledname(C_Name);
  405. if export_var then
  406. begin
  407. inc(vs.refs);
  408. include(vs.varoptions,vo_is_exported);
  409. end;
  410. if extern_var then
  411. include(vs.varoptions,vo_is_external);
  412. { insert in the datasegment when it is not external }
  413. if not extern_var then
  414. symtablestack.insertvardata(vs);
  415. { now we can insert it in the import lib if its a dll, or
  416. add it to the externals }
  417. if extern_var then
  418. begin
  419. if is_dll then
  420. begin
  421. if not(current_module.uses_imports) then
  422. begin
  423. current_module.uses_imports:=true;
  424. importlib.preparelib(current_module.modulename^);
  425. end;
  426. importlib.importvariable(vs,C_name,dll_name);
  427. end
  428. else
  429. if target_info.DllScanSupported then
  430. current_module.Externals.insert(tExternalsItem.create(vs.mangledname));
  431. end;
  432. symdone:=true;
  433. end
  434. else
  435. if (is_object) and (cs_static_keyword in aktmoduleswitches) and (idtoken=_STATIC) then
  436. begin
  437. include(current_object_option,sp_static);
  438. insert_syms(sc,tt,false,dummysymoptions);
  439. exclude(current_object_option,sp_static);
  440. consume(_STATIC);
  441. consume(_SEMICOLON);
  442. symdone:=true;
  443. end;
  444. end;
  445. { insert it in the symtable, if not done yet }
  446. if not symdone then
  447. begin
  448. { save object option, because we can turn of the sp_published }
  449. if (sp_published in current_object_option) and
  450. not(is_class(tt.def)) then
  451. begin
  452. Message(parser_e_cant_publish_that);
  453. exclude(current_object_option,sp_published);
  454. end
  455. else
  456. if (sp_published in current_object_option) and
  457. not(oo_can_have_published in tobjectdef(tt.def).objectoptions) then
  458. begin
  459. Message(parser_e_only_publishable_classes_can__be_published);
  460. exclude(current_object_option,sp_published);
  461. end;
  462. insert_syms(sc,tt,is_threadvar,dummysymoptions);
  463. current_object_option:=old_current_object_option;
  464. end;
  465. end;
  466. { Check for Case }
  467. if is_record and (token=_CASE) then
  468. begin
  469. maxsize:=0;
  470. maxalignment:=0;
  471. consume(_CASE);
  472. sorg:=orgpattern;
  473. hs:=pattern;
  474. searchsym(hs,srsym,srsymtable);
  475. { may be only a type: }
  476. if assigned(srsym) and (srsym.typ in [typesym,unitsym]) then
  477. begin
  478. { for records, don't search the recordsymtable for
  479. the symbols of the types }
  480. oldsymtablestack:=symtablestack;
  481. symtablestack:=symtablestack.next;
  482. read_type(casetype,'');
  483. symtablestack:=oldsymtablestack;
  484. end
  485. else
  486. begin
  487. consume(_ID);
  488. consume(_COLON);
  489. { for records, don't search the recordsymtable for
  490. the symbols of the types }
  491. oldsymtablestack:=symtablestack;
  492. symtablestack:=symtablestack.next;
  493. read_type(casetype,'');
  494. symtablestack:=oldsymtablestack;
  495. vs:=tvarsym.create(sorg,vs_value,casetype);
  496. symtablestack.insert(vs);
  497. symtablestack.insertvardata(vs);
  498. end;
  499. if not(is_ordinal(casetype.def)) or is_64bitint(casetype.def) then
  500. Message(type_e_ordinal_expr_expected);
  501. consume(_OF);
  502. UnionSymtable:=trecordsymtable.create;
  503. Unionsymtable.next:=symtablestack;
  504. registerdef:=false;
  505. UnionDef:=trecorddef.create(unionsymtable);
  506. uniondef.isunion:=true;
  507. if assigned(symtablestack.defowner) then
  508. Uniondef.owner:=symtablestack.defowner.owner;
  509. registerdef:=true;
  510. symtablestack:=UnionSymtable;
  511. startvarrecsize:=symtablestack.datasize;
  512. startvarrecalign:=symtablestack.dataalignment;
  513. repeat
  514. repeat
  515. pt:=comp_expr(true);
  516. if not(pt.nodetype=ordconstn) then
  517. Message(cg_e_illegal_expression);
  518. pt.free;
  519. if token=_COMMA then
  520. consume(_COMMA)
  521. else
  522. break;
  523. until false;
  524. consume(_COLON);
  525. { read the vars }
  526. consume(_LKLAMMER);
  527. inc(variantrecordlevel);
  528. if token<>_RKLAMMER then
  529. read_var_decs(true,false,false);
  530. dec(variantrecordlevel);
  531. consume(_RKLAMMER);
  532. { calculates maximal variant size }
  533. maxsize:=max(maxsize,symtablestack.datasize);
  534. maxalignment:=max(maxalignment,symtablestack.dataalignment);
  535. { the items of the next variant are overlayed }
  536. symtablestack.datasize:=startvarrecsize;
  537. symtablestack.dataalignment:=startvarrecalign;
  538. if (token<>_END) and (token<>_RKLAMMER) then
  539. consume(_SEMICOLON)
  540. else
  541. break;
  542. until (token=_END) or (token=_RKLAMMER);
  543. { at last set the record size to that of the biggest variant }
  544. symtablestack.datasize:=maxsize;
  545. symtablestack.dataalignment:=maxalignment;
  546. uniontype.def:=uniondef;
  547. uniontype.sym:=nil;
  548. UnionSym:=tvarsym.create('$case',vs_value,uniontype);
  549. symtablestack:=symtablestack.next;
  550. { we do NOT call symtablestack.insert
  551. on purpose PM }
  552. if aktalignment.recordalignmax=-1 then
  553. begin
  554. {$ifdef i386}
  555. if maxalignment>2 then
  556. minalignment:=4
  557. else if maxalignment>1 then
  558. minalignment:=2
  559. else
  560. minalignment:=1;
  561. {$else}
  562. {$ifdef m68k}
  563. minalignment:=2;
  564. {$endif}
  565. minalignment:=1;
  566. {$endif}
  567. end
  568. else
  569. minalignment:=maxalignment;
  570. usedalign:=used_align(maxalignment,minalignment,maxalignment);
  571. offset:=align(symtablestack.datasize,usedalign);
  572. symtablestack.datasize:=offset+unionsymtable.datasize;
  573. if maxalignment>symtablestack.dataalignment then
  574. symtablestack.dataalignment:=maxalignment;
  575. trecordsymtable(Unionsymtable).Insert_in(symtablestack,offset);
  576. Unionsym.owner:=nil;
  577. unionsym.free;
  578. uniondef.owner:=nil;
  579. uniondef.free;
  580. end;
  581. block_type:=old_block_type;
  582. current_object_option:=old_current_object_option;
  583. { free the list }
  584. sc.free;
  585. end;
  586. end.
  587. {
  588. $Log$
  589. Revision 1.47 2003-05-09 17:47:03 peter
  590. * self moved to hidden parameter
  591. * removed hdisposen,hnewn,selfn
  592. Revision 1.46 2003/04/25 20:59:33 peter
  593. * removed funcretn,funcretsym, function result is now in varsym
  594. and aliases for result and function name are added using absolutesym
  595. * vs_hidden parameter for funcret passed in parameter
  596. * vs_hidden fixes
  597. * writenode changed to printnode and released from extdebug
  598. * -vp option added to generate a tree.log with the nodetree
  599. * nicer printnode for statements, callnode
  600. Revision 1.45 2003/03/17 18:56:02 peter
  601. * fix crash with duplicate id
  602. Revision 1.44 2003/01/02 11:14:02 michael
  603. + Patch from peter to support initial values for local variables
  604. Revision 1.43 2002/12/27 15:22:20 peter
  605. * don't allow initialized threadvars
  606. Revision 1.42 2002/12/07 14:04:59 carl
  607. * convert some vars from longint -> byte
  608. Revision 1.41 2002/11/29 22:31:19 carl
  609. + unimplemented hint directive added
  610. * hint directive parsing implemented
  611. * warning on these directives
  612. Revision 1.40 2002/11/25 17:43:21 peter
  613. * splitted defbase in defutil,symutil,defcmp
  614. * merged isconvertable and is_equal into compare_defs(_ext)
  615. * made operator search faster by walking the list only once
  616. Revision 1.39 2002/11/15 16:29:31 peter
  617. * made tasmsymbol.refs private (merged)
  618. Revision 1.38 2002/11/15 01:58:53 peter
  619. * merged changes from 1.0.7 up to 04-11
  620. - -V option for generating bug report tracing
  621. - more tracing for option parsing
  622. - errors for cdecl and high()
  623. - win32 import stabs
  624. - win32 records<=8 are returned in eax:edx (turned off by default)
  625. - heaptrc update
  626. - more info for temp management in .s file with EXTDEBUG
  627. Revision 1.37 2002/10/05 15:18:43 carl
  628. * fix heap leaks
  629. Revision 1.36 2002/10/05 12:43:26 carl
  630. * fixes for Delphi 6 compilation
  631. (warning : Some features do not work under Delphi)
  632. Revision 1.35 2002/10/04 20:53:05 carl
  633. * bugfix of crash
  634. Revision 1.34 2002/10/03 21:22:01 carl
  635. * don't make the vars regable if they are absolute and their definitions
  636. are not the same.
  637. Revision 1.33 2002/09/16 18:08:45 peter
  638. * fix setting of sp_static
  639. Revision 1.32 2002/09/09 17:34:15 peter
  640. * tdicationary.replace added to replace and item in a dictionary. This
  641. is only allowed for the same name
  642. * varsyms are inserted in symtable before the types are parsed. This
  643. fixes the long standing "var longint : longint" bug
  644. - consume_idlist and idstringlist removed. The loops are inserted
  645. at the callers place and uses the symtable for duplicate id checking
  646. Revision 1.31 2002/08/25 19:25:20 peter
  647. * sym.insert_in_data removed
  648. * symtable.insertvardata/insertconstdata added
  649. * removed insert_in_data call from symtable.insert, it needs to be
  650. called separatly. This allows to deref the address calculation
  651. * procedures now calculate the parast addresses after the procedure
  652. directives are parsed. This fixes the cdecl parast problem
  653. * push_addr_param has an extra argument that specifies if cdecl is used
  654. or not
  655. Revision 1.30 2002/07/29 21:23:44 florian
  656. * more fixes for the ppc
  657. + wrappers for the tcnvnode.first_* stuff introduced
  658. Revision 1.29 2002/07/26 21:15:40 florian
  659. * rewrote the system handling
  660. Revision 1.28 2002/07/20 11:57:55 florian
  661. * types.pas renamed to defbase.pas because D6 contains a types
  662. unit so this would conflicts if D6 programms are compiled
  663. + Willamette/SSE2 instructions to assembler added
  664. Revision 1.27 2002/06/10 13:41:26 jonas
  665. * fixed bug 1985
  666. Revision 1.26 2002/05/18 13:34:12 peter
  667. * readded missing revisions
  668. Revision 1.25 2002/05/16 19:46:43 carl
  669. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  670. + try to fix temp allocation (still in ifdef)
  671. + generic constructor calls
  672. + start of tassembler / tmodulebase class cleanup
  673. Revision 1.23 2002/04/21 18:57:24 peter
  674. * fixed memleaks when file can't be opened
  675. }