ptype.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Does parsing types for Free Pascal
  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. unit ptype;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. globtype,symtype;
  23. const
  24. { forward types should only be possible inside a TYPE statement }
  25. typecanbeforward : boolean = false;
  26. var
  27. { hack, which allows to use the current parsed }
  28. { object type as function argument type }
  29. testcurobject : byte;
  30. curobjectname : stringid;
  31. { reads a string, file type or a type id and returns a name and }
  32. { tdef }
  33. procedure single_type(var tt:ttype;var s : string;isforwarddef:boolean);
  34. procedure read_type(var tt:ttype;const name : stringid);
  35. { reads a type definition }
  36. { to a appropriating tdef, s gets the name of }
  37. { the type to allow name mangling }
  38. procedure id_type(var tt : ttype;var s : string;isforwarddef:boolean);
  39. implementation
  40. uses
  41. { common }
  42. cutils,
  43. { global }
  44. globals,tokens,verbose,
  45. systems,
  46. { target }
  47. paramgr,
  48. { symtable }
  49. symconst,symbase,symdef,symsym,symtable,
  50. defutil,defcmp,
  51. { pass 1 }
  52. node,
  53. nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,
  54. { parser }
  55. scanner,
  56. pbase,pexpr,pdecsub,pdecvar,pdecobj;
  57. procedure id_type(var tt : ttype;var s : string;isforwarddef:boolean);
  58. { reads a type definition }
  59. { to a appropriating tdef, s gets the name of }
  60. { the type to allow name mangling }
  61. var
  62. is_unit_specific : boolean;
  63. pos : tfileposinfo;
  64. srsym : tsym;
  65. srsymtable : tsymtable;
  66. sorg : stringid;
  67. begin
  68. s:=pattern;
  69. sorg:=orgpattern;
  70. pos:=akttokenpos;
  71. { classes can be used also in classes }
  72. if (curobjectname=pattern) and is_class_or_interface(aktobjectdef) then
  73. begin
  74. tt.setdef(aktobjectdef);
  75. consume(_ID);
  76. exit;
  77. end;
  78. { objects can be parameters }
  79. if (testcurobject=2) and (curobjectname=pattern) then
  80. begin
  81. tt.setdef(aktobjectdef);
  82. consume(_ID);
  83. exit;
  84. end;
  85. { try to load the symbol to see if it's a unitsym }
  86. is_unit_specific:=false;
  87. searchsym(s,srsym,srsymtable);
  88. consume(_ID);
  89. if assigned(srsym) and
  90. (srsym.typ=unitsym) then
  91. begin
  92. is_unit_specific:=true;
  93. consume(_POINT);
  94. if srsym.owner.unitid=0 then
  95. begin
  96. srsym:=searchsymonlyin(tunitsym(srsym).unitsymtable,pattern);
  97. pos:=akttokenpos;
  98. s:=pattern;
  99. end
  100. else
  101. srsym:=nil;
  102. consume(_ID);
  103. end;
  104. { Types are first defined with an error def before assigning
  105. the real type so check if it's an errordef. if so then
  106. give an error. Only check for typesyms in the current symbol
  107. table as forwarddef are not resolved directly }
  108. if assigned(srsym) and
  109. (srsym.typ=typesym) and
  110. (srsym.owner=symtablestack) and
  111. (ttypesym(srsym).restype.def.deftype=errordef) then
  112. begin
  113. Message1(type_e_type_is_not_completly_defined,ttypesym(srsym).realname);
  114. tt:=generrortype;
  115. exit;
  116. end;
  117. { are we parsing a possible forward def ? }
  118. if isforwarddef and
  119. not(is_unit_specific) then
  120. begin
  121. tt.setdef(tforwarddef.create(s,pos));
  122. exit;
  123. end;
  124. { unknown sym ? }
  125. if not assigned(srsym) then
  126. begin
  127. Message1(sym_e_id_not_found,sorg);
  128. tt:=generrortype;
  129. exit;
  130. end;
  131. { type sym ? }
  132. if (srsym.typ<>typesym) then
  133. begin
  134. Message(type_e_type_id_expected);
  135. tt:=generrortype;
  136. exit;
  137. end;
  138. { Give an error when referring to an errordef }
  139. if (ttypesym(srsym).restype.def.deftype=errordef) then
  140. begin
  141. Message(sym_e_error_in_type_def);
  142. tt:=generrortype;
  143. exit;
  144. end;
  145. { Use the definitions for current unit, because
  146. they can be refered from the parameters and symbols are not
  147. loaded at that time. Only write the definition when the
  148. symbol is the real owner of the definition (not a redefine) }
  149. if (ttypesym(srsym).owner.unitid=0) and
  150. ((ttypesym(srsym).restype.def.typesym=nil) or
  151. (srsym=ttypesym(srsym).restype.def.typesym)) then
  152. tt.setdef(ttypesym(srsym).restype.def)
  153. else
  154. tt.setsym(srsym);
  155. end;
  156. procedure single_type(var tt:ttype;var s : string;isforwarddef:boolean);
  157. { reads a string, file type or a type id and returns a name and }
  158. { tdef }
  159. var
  160. hs : string;
  161. t2 : ttype;
  162. begin
  163. case token of
  164. _STRING:
  165. begin
  166. string_dec(tt);
  167. s:='STRING';
  168. end;
  169. _FILE:
  170. begin
  171. consume(_FILE);
  172. if token=_OF then
  173. begin
  174. consume(_OF);
  175. single_type(t2,hs,false);
  176. tt.setdef(tfiledef.createtyped(t2));
  177. s:='FILE$OF$'+hs;
  178. end
  179. else
  180. begin
  181. tt:=cfiletype;
  182. s:='FILE';
  183. end;
  184. end;
  185. _ID:
  186. begin
  187. id_type(tt,s,isforwarddef);
  188. end;
  189. else
  190. begin
  191. message(type_e_type_id_expected);
  192. s:='<unknown>';
  193. tt:=generrortype;
  194. end;
  195. end;
  196. end;
  197. { reads a record declaration }
  198. function record_dec : tdef;
  199. var
  200. symtable : tsymtable;
  201. storetypecanbeforward : boolean;
  202. old_object_option : tsymoptions;
  203. begin
  204. { create recdef }
  205. symtable:=trecordsymtable.create;
  206. record_dec:=trecorddef.create(symtable);
  207. { update symtable stack }
  208. symtable.next:=symtablestack;
  209. symtablestack:=symtable;
  210. { parse record }
  211. consume(_RECORD);
  212. old_object_option:=current_object_option;
  213. current_object_option:=[sp_public];
  214. storetypecanbeforward:=typecanbeforward;
  215. { for tp7 don't allow forward types }
  216. if m_tp7 in aktmodeswitches then
  217. typecanbeforward:=false;
  218. read_var_decs(true,false,false);
  219. consume(_END);
  220. typecanbeforward:=storetypecanbeforward;
  221. current_object_option:=old_object_option;
  222. { may be scale record size to a size of n*4 ? }
  223. symtablestack.datasize:=align(symtablestack.datasize,symtablestack.dataalignment);
  224. { restore symtable stack }
  225. symtablestack:=symtable.next;
  226. end;
  227. { reads a type definition and returns a pointer to it }
  228. procedure read_type(var tt : ttype;const name : stringid);
  229. var
  230. pt : tnode;
  231. tt2 : ttype;
  232. aktenumdef : tenumdef;
  233. ap : tarraydef;
  234. s : stringid;
  235. l,v : TConstExprInt;
  236. oldaktpackrecords : longint;
  237. hs : string;
  238. defpos,storepos : tfileposinfo;
  239. procedure expr_type;
  240. var
  241. pt1,pt2 : tnode;
  242. lv,hv : TConstExprInt;
  243. begin
  244. { use of current parsed object ? }
  245. if (token=_ID) and (testcurobject=2) and (curobjectname=pattern) then
  246. begin
  247. consume(_ID);
  248. tt.setdef(aktobjectdef);
  249. exit;
  250. end;
  251. { classes can be used also in classes }
  252. if (curobjectname=pattern) and is_class_or_interface(aktobjectdef) then
  253. begin
  254. tt.setdef(aktobjectdef);
  255. consume(_ID);
  256. exit;
  257. end;
  258. { we can't accept a equal in type }
  259. pt1:=comp_expr(not(ignore_equal));
  260. if (token=_POINTPOINT) then
  261. begin
  262. consume(_POINTPOINT);
  263. { get high value of range }
  264. pt2:=comp_expr(not(ignore_equal));
  265. { make both the same type }
  266. inserttypeconv(pt1,pt2.resulttype);
  267. { both must be evaluated to constants now }
  268. if (pt1.nodetype=ordconstn) and
  269. (pt2.nodetype=ordconstn) then
  270. begin
  271. lv:=tordconstnode(pt1).value;
  272. hv:=tordconstnode(pt2).value;
  273. { Check bounds }
  274. if hv<lv then
  275. Message(cg_e_upper_lower_than_lower)
  276. else
  277. begin
  278. { All checks passed, create the new def }
  279. case pt1.resulttype.def.deftype of
  280. enumdef :
  281. tt.setdef(tenumdef.create_subrange(tenumdef(pt1.resulttype.def),lv,hv));
  282. orddef :
  283. begin
  284. if is_char(pt1.resulttype.def) then
  285. tt.setdef(torddef.create(uchar,lv,hv))
  286. else
  287. if is_boolean(pt1.resulttype.def) then
  288. tt.setdef(torddef.create(bool8bit,l,hv))
  289. else
  290. tt.setdef(torddef.create(range_to_basetype(lv,hv),lv,hv));
  291. end;
  292. end;
  293. end;
  294. end
  295. else
  296. Message(sym_e_error_in_type_def);
  297. pt2.free;
  298. end
  299. else
  300. begin
  301. { a simple type renaming }
  302. if (pt1.nodetype=typen) then
  303. tt:=ttypenode(pt1).resulttype
  304. else
  305. Message(sym_e_error_in_type_def);
  306. end;
  307. pt1.free;
  308. end;
  309. procedure array_dec;
  310. var
  311. lowval,
  312. highval : longint;
  313. arraytype : ttype;
  314. ht : ttype;
  315. procedure setdefdecl(const t:ttype);
  316. begin
  317. case t.def.deftype of
  318. enumdef :
  319. begin
  320. lowval:=tenumdef(t.def).min;
  321. highval:=tenumdef(t.def).max;
  322. if tenumdef(t.def).has_jumps then
  323. Message(type_e_array_index_enums_with_assign_not_possible);
  324. arraytype:=t;
  325. end;
  326. orddef :
  327. begin
  328. if torddef(t.def).typ in [uchar,
  329. u8bit,u16bit,
  330. s8bit,s16bit,s32bit,
  331. bool8bit,bool16bit,bool32bit,
  332. uwidechar] then
  333. begin
  334. lowval:=torddef(t.def).low;
  335. highval:=torddef(t.def).high;
  336. arraytype:=t;
  337. end
  338. else
  339. Message1(parser_e_type_cant_be_used_in_array_index,t.def.gettypename);
  340. end;
  341. else
  342. Message(sym_e_error_in_type_def);
  343. end;
  344. end;
  345. begin
  346. consume(_ARRAY);
  347. { open array? }
  348. if token=_LECKKLAMMER then
  349. begin
  350. consume(_LECKKLAMMER);
  351. { defaults }
  352. arraytype:=generrortype;
  353. lowval:=longint($80000000);
  354. highval:=$7fffffff;
  355. tt.reset;
  356. repeat
  357. { read the expression and check it, check apart if the
  358. declaration is an enum declaration because that needs to
  359. be parsed by readtype (PFV) }
  360. if token=_LKLAMMER then
  361. begin
  362. read_type(ht,'');
  363. setdefdecl(ht);
  364. end
  365. else
  366. begin
  367. pt:=expr;
  368. if pt.nodetype=typen then
  369. setdefdecl(pt.resulttype)
  370. else
  371. begin
  372. if (pt.nodetype=rangen) then
  373. begin
  374. if (trangenode(pt).left.nodetype=ordconstn) and
  375. (trangenode(pt).right.nodetype=ordconstn) then
  376. begin
  377. lowval:=tordconstnode(trangenode(pt).left).value;
  378. highval:=tordconstnode(trangenode(pt).right).value;
  379. if highval<lowval then
  380. begin
  381. Message(parser_e_array_lower_less_than_upper_bound);
  382. highval:=lowval;
  383. end;
  384. arraytype:=trangenode(pt).right.resulttype;
  385. end
  386. else
  387. Message(type_e_cant_eval_constant_expr);
  388. end
  389. else
  390. Message(sym_e_error_in_type_def)
  391. end;
  392. pt.free;
  393. end;
  394. { create arraydef }
  395. if not assigned(tt.def) then
  396. begin
  397. ap:=tarraydef.create(lowval,highval,arraytype);
  398. tt.setdef(ap);
  399. end
  400. else
  401. begin
  402. ap.elementtype.setdef(tarraydef.create(lowval,highval,arraytype));
  403. ap:=tarraydef(ap.elementtype.def);
  404. end;
  405. if token=_COMMA then
  406. consume(_COMMA)
  407. else
  408. break;
  409. until false;
  410. consume(_RECKKLAMMER);
  411. end
  412. else
  413. begin
  414. ap:=tarraydef.create(0,-1,s32bittype);
  415. ap.IsDynamicArray:=true;
  416. tt.setdef(ap);
  417. end;
  418. consume(_OF);
  419. read_type(tt2,'');
  420. { if no error, set element type }
  421. if assigned(ap) then
  422. ap.setelementtype(tt2);
  423. end;
  424. var
  425. p : tnode;
  426. pd : tabstractprocdef;
  427. enumdupmsg : boolean;
  428. begin
  429. tt.reset;
  430. case token of
  431. _STRING,_FILE:
  432. begin
  433. single_type(tt,hs,false);
  434. end;
  435. _LKLAMMER:
  436. begin
  437. consume(_LKLAMMER);
  438. { allow negativ value_str }
  439. l:=-1;
  440. enumdupmsg:=false;
  441. aktenumdef:=tenumdef.create;
  442. repeat
  443. s:=orgpattern;
  444. defpos:=akttokenpos;
  445. consume(_ID);
  446. { only allow assigning of specific numbers under fpc mode }
  447. if not(m_tp7 in aktmodeswitches) and
  448. (
  449. { in fpc mode also allow := to be compatible
  450. with previous 1.0.x versions }
  451. ((m_fpc in aktmodeswitches) and
  452. try_to_consume(_ASSIGNMENT)) or
  453. try_to_consume(_EQUAL)
  454. ) then
  455. begin
  456. p:=comp_expr(true);
  457. if (p.nodetype=ordconstn) then
  458. begin
  459. { we expect an integer or an enum of the
  460. same type }
  461. if is_integer(p.resulttype.def) or
  462. is_char(p.resulttype.def) or
  463. equal_defs(p.resulttype.def,aktenumdef) then
  464. v:=tordconstnode(p).value
  465. else
  466. Message2(type_e_incompatible_types,p.resulttype.def.typename,s32bittype.def.typename);
  467. end
  468. else
  469. Message(cg_e_illegal_expression);
  470. p.free;
  471. { please leave that a note, allows type save }
  472. { declarations in the win32 units ! }
  473. if (v<=l) and (not enumdupmsg) then
  474. begin
  475. Message(parser_n_duplicate_enum);
  476. enumdupmsg:=true;
  477. end;
  478. l:=v;
  479. end
  480. else
  481. inc(l);
  482. storepos:=akttokenpos;
  483. akttokenpos:=defpos;
  484. constsymtable.insert(tenumsym.create(s,aktenumdef,l));
  485. akttokenpos:=storepos;
  486. until not try_to_consume(_COMMA);
  487. tt.setdef(aktenumdef);
  488. consume(_RKLAMMER);
  489. end;
  490. _ARRAY:
  491. begin
  492. array_dec;
  493. end;
  494. _SET:
  495. begin
  496. consume(_SET);
  497. consume(_OF);
  498. read_type(tt2,'');
  499. if assigned(tt2.def) then
  500. begin
  501. case tt2.def.deftype of
  502. { don't forget that min can be negativ PM }
  503. enumdef :
  504. if tenumdef(tt2.def).min>=0 then
  505. tt.setdef(tsetdef.create(tt2,tenumdef(tt2.def).max))
  506. else
  507. Message(sym_e_ill_type_decl_set);
  508. orddef :
  509. begin
  510. case torddef(tt2.def).typ of
  511. uchar :
  512. tt.setdef(tsetdef.create(tt2,255));
  513. u8bit,u16bit,u32bit,
  514. s8bit,s16bit,s32bit :
  515. begin
  516. if (torddef(tt2.def).low>=0) then
  517. tt.setdef(tsetdef.create(tt2,torddef(tt2.def).high))
  518. else
  519. Message(sym_e_ill_type_decl_set);
  520. end;
  521. else
  522. Message(sym_e_ill_type_decl_set);
  523. end;
  524. end;
  525. else
  526. Message(sym_e_ill_type_decl_set);
  527. end;
  528. end
  529. else
  530. tt:=generrortype;
  531. end;
  532. _CARET:
  533. begin
  534. consume(_CARET);
  535. single_type(tt2,hs,typecanbeforward);
  536. tt.setdef(tpointerdef.create(tt2));
  537. end;
  538. _RECORD:
  539. begin
  540. tt.setdef(record_dec);
  541. end;
  542. _PACKED:
  543. begin
  544. consume(_PACKED);
  545. if token=_ARRAY then
  546. array_dec
  547. else
  548. begin
  549. oldaktpackrecords:=aktalignment.recordalignmax;
  550. aktalignment.recordalignmax:=1;
  551. if token in [_CLASS,_OBJECT] then
  552. tt.setdef(object_dec(name,nil))
  553. else
  554. tt.setdef(record_dec);
  555. aktalignment.recordalignmax:=oldaktpackrecords;
  556. end;
  557. end;
  558. _CLASS,
  559. _CPPCLASS,
  560. _INTERFACE,
  561. _OBJECT:
  562. begin
  563. tt.setdef(object_dec(name,nil));
  564. end;
  565. _PROCEDURE:
  566. begin
  567. consume(_PROCEDURE);
  568. tt.setdef(tprocvardef.create(normal_function_level));
  569. if token=_LKLAMMER then
  570. parse_parameter_dec(tprocvardef(tt.def));
  571. if token=_OF then
  572. begin
  573. consume(_OF);
  574. consume(_OBJECT);
  575. include(tprocvardef(tt.def).procoptions,po_methodpointer);
  576. check_self_para(tprocvardef(tt.def));
  577. end;
  578. end;
  579. _FUNCTION:
  580. begin
  581. consume(_FUNCTION);
  582. pd:=tprocvardef.create(normal_function_level);
  583. if token=_LKLAMMER then
  584. parse_parameter_dec(pd);
  585. consume(_COLON);
  586. single_type(pd.rettype,hs,false);
  587. if token=_OF then
  588. begin
  589. consume(_OF);
  590. consume(_OBJECT);
  591. include(pd.procoptions,po_methodpointer);
  592. end;
  593. { Add implicit hidden parameters and function result }
  594. calc_parast(pd);
  595. tt.def:=pd;
  596. end;
  597. else
  598. expr_type;
  599. end;
  600. if tt.def=nil then
  601. tt:=generrortype;
  602. end;
  603. end.
  604. {
  605. $Log$
  606. Revision 1.53 2003-04-27 11:21:34 peter
  607. * aktprocdef renamed to current_procdef
  608. * procinfo renamed to current_procinfo
  609. * procinfo will now be stored in current_module so it can be
  610. cleaned up properly
  611. * gen_main_procsym changed to create_main_proc and release_main_proc
  612. to also generate a tprocinfo structure
  613. * fixed unit implicit initfinal
  614. Revision 1.52 2003/04/27 07:29:51 peter
  615. * current_procdef cleanup, current_procdef is now always nil when parsing
  616. a new procdef declaration
  617. * aktprocsym removed
  618. * lexlevel removed, use symtable.symtablelevel instead
  619. * implicit init/final code uses the normal genentry/genexit
  620. * funcret state checking updated for new funcret handling
  621. Revision 1.51 2003/04/25 20:59:34 peter
  622. * removed funcretn,funcretsym, function result is now in varsym
  623. and aliases for result and function name are added using absolutesym
  624. * vs_hidden parameter for funcret passed in parameter
  625. * vs_hidden fixes
  626. * writenode changed to printnode and released from extdebug
  627. * -vp option added to generate a tree.log with the nodetree
  628. * nicer printnode for statements, callnode
  629. Revision 1.50 2003/01/05 15:54:15 florian
  630. + added proper support of type = type <type>; for simple types
  631. Revision 1.49 2003/01/03 23:50:41 peter
  632. * also allow = in fpc mode to assign enums
  633. Revision 1.48 2003/01/02 19:49:00 peter
  634. * update self parameter only for methodpointer and methods
  635. Revision 1.47 2002/12/21 13:07:34 peter
  636. * type redefine fix for tb0437
  637. Revision 1.46 2002/11/25 17:43:23 peter
  638. * splitted defbase in defutil,symutil,defcmp
  639. * merged isconvertable and is_equal into compare_defs(_ext)
  640. * made operator search faster by walking the list only once
  641. Revision 1.45 2002/09/27 21:13:29 carl
  642. * low-highval always checked if limit ober 2GB is reached (to avoid overflow)
  643. Revision 1.44 2002/09/10 16:26:39 peter
  644. * safety check for typesym added for incomplete type def check
  645. Revision 1.43 2002/09/09 19:34:07 peter
  646. * check for incomplete types in the current symtable when parsing
  647. forwarddef. Maybe this shall be delphi/tp only
  648. Revision 1.42 2002/07/20 11:57:56 florian
  649. * types.pas renamed to defbase.pas because D6 contains a types
  650. unit so this would conflicts if D6 programms are compiled
  651. + Willamette/SSE2 instructions to assembler added
  652. Revision 1.41 2002/05/18 13:34:16 peter
  653. * readded missing revisions
  654. Revision 1.40 2002/05/16 19:46:44 carl
  655. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  656. + try to fix temp allocation (still in ifdef)
  657. + generic constructor calls
  658. + start of tassembler / tmodulebase class cleanup
  659. Revision 1.38 2002/05/12 16:53:10 peter
  660. * moved entry and exitcode to ncgutil and cgobj
  661. * foreach gets extra argument for passing local data to the
  662. iterator function
  663. * -CR checks also class typecasts at runtime by changing them
  664. into as
  665. * fixed compiler to cycle with the -CR option
  666. * fixed stabs with elf writer, finally the global variables can
  667. be watched
  668. * removed a lot of routines from cga unit and replaced them by
  669. calls to cgobj
  670. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  671. u32bit then the other is typecasted also to u32bit without giving
  672. a rangecheck warning/error.
  673. * fixed pascal calling method with reversing also the high tree in
  674. the parast, detected by tcalcst3 test
  675. Revision 1.37 2002/04/19 15:46:03 peter
  676. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  677. in most cases and not written to the ppu
  678. * add mangeledname_prefix() routine to generate the prefix of
  679. manglednames depending on the current procedure, object and module
  680. * removed static procprefix since the mangledname is now build only
  681. on demand from tprocdef.mangledname
  682. Revision 1.36 2002/04/16 16:12:47 peter
  683. * give error when using enums with jumps as array index
  684. * allow char as enum value
  685. Revision 1.35 2002/04/04 19:06:04 peter
  686. * removed unused units
  687. * use tlocation.size in cg.a_*loc*() routines
  688. Revision 1.34 2002/01/24 18:25:49 peter
  689. * implicit result variable generation for assembler routines
  690. * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
  691. Revision 1.33 2002/01/15 16:13:34 jonas
  692. * fixed web bugs 1758 and 1760
  693. Revision 1.32 2002/01/06 12:08:15 peter
  694. * removed uauto from orddef, use new range_to_basetype generating
  695. the correct ordinal type for a range
  696. }