ptype.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  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. is_func,
  428. enumdupmsg : boolean;
  429. begin
  430. tt.reset;
  431. case token of
  432. _STRING,_FILE:
  433. begin
  434. single_type(tt,hs,false);
  435. end;
  436. _LKLAMMER:
  437. begin
  438. consume(_LKLAMMER);
  439. { allow negativ value_str }
  440. l:=-1;
  441. enumdupmsg:=false;
  442. aktenumdef:=tenumdef.create;
  443. repeat
  444. s:=orgpattern;
  445. defpos:=akttokenpos;
  446. consume(_ID);
  447. { only allow assigning of specific numbers under fpc mode }
  448. if not(m_tp7 in aktmodeswitches) and
  449. (
  450. { in fpc mode also allow := to be compatible
  451. with previous 1.0.x versions }
  452. ((m_fpc in aktmodeswitches) and
  453. try_to_consume(_ASSIGNMENT)) or
  454. try_to_consume(_EQUAL)
  455. ) then
  456. begin
  457. p:=comp_expr(true);
  458. if (p.nodetype=ordconstn) then
  459. begin
  460. { we expect an integer or an enum of the
  461. same type }
  462. if is_integer(p.resulttype.def) or
  463. is_char(p.resulttype.def) or
  464. equal_defs(p.resulttype.def,aktenumdef) then
  465. v:=tordconstnode(p).value
  466. else
  467. Message2(type_e_incompatible_types,p.resulttype.def.typename,s32bittype.def.typename);
  468. end
  469. else
  470. Message(cg_e_illegal_expression);
  471. p.free;
  472. { please leave that a note, allows type save }
  473. { declarations in the win32 units ! }
  474. if (v<=l) and (not enumdupmsg) then
  475. begin
  476. Message(parser_n_duplicate_enum);
  477. enumdupmsg:=true;
  478. end;
  479. l:=v;
  480. end
  481. else
  482. inc(l);
  483. storepos:=akttokenpos;
  484. akttokenpos:=defpos;
  485. constsymtable.insert(tenumsym.create(s,aktenumdef,l));
  486. akttokenpos:=storepos;
  487. until not try_to_consume(_COMMA);
  488. tt.setdef(aktenumdef);
  489. consume(_RKLAMMER);
  490. end;
  491. _ARRAY:
  492. begin
  493. array_dec;
  494. end;
  495. _SET:
  496. begin
  497. consume(_SET);
  498. consume(_OF);
  499. read_type(tt2,'');
  500. if assigned(tt2.def) then
  501. begin
  502. case tt2.def.deftype of
  503. { don't forget that min can be negativ PM }
  504. enumdef :
  505. if tenumdef(tt2.def).min>=0 then
  506. tt.setdef(tsetdef.create(tt2,tenumdef(tt2.def).max))
  507. else
  508. Message(sym_e_ill_type_decl_set);
  509. orddef :
  510. begin
  511. case torddef(tt2.def).typ of
  512. uchar :
  513. tt.setdef(tsetdef.create(tt2,255));
  514. u8bit,u16bit,u32bit,
  515. s8bit,s16bit,s32bit :
  516. begin
  517. if (torddef(tt2.def).low>=0) then
  518. tt.setdef(tsetdef.create(tt2,torddef(tt2.def).high))
  519. else
  520. Message(sym_e_ill_type_decl_set);
  521. end;
  522. else
  523. Message(sym_e_ill_type_decl_set);
  524. end;
  525. end;
  526. else
  527. Message(sym_e_ill_type_decl_set);
  528. end;
  529. end
  530. else
  531. tt:=generrortype;
  532. end;
  533. _CARET:
  534. begin
  535. consume(_CARET);
  536. single_type(tt2,hs,typecanbeforward);
  537. tt.setdef(tpointerdef.create(tt2));
  538. end;
  539. _RECORD:
  540. begin
  541. tt.setdef(record_dec);
  542. end;
  543. _PACKED:
  544. begin
  545. consume(_PACKED);
  546. if token=_ARRAY then
  547. array_dec
  548. else
  549. begin
  550. oldaktpackrecords:=aktalignment.recordalignmax;
  551. aktalignment.recordalignmax:=1;
  552. if token in [_CLASS,_OBJECT] then
  553. tt.setdef(object_dec(name,nil))
  554. else
  555. tt.setdef(record_dec);
  556. aktalignment.recordalignmax:=oldaktpackrecords;
  557. end;
  558. end;
  559. _CLASS,
  560. _CPPCLASS,
  561. _INTERFACE,
  562. _OBJECT:
  563. begin
  564. tt.setdef(object_dec(name,nil));
  565. end;
  566. _PROCEDURE,
  567. _FUNCTION:
  568. begin
  569. is_func:=(token=_FUNCTION);
  570. consume(token);
  571. pd:=tprocvardef.create(normal_function_level);
  572. if token=_LKLAMMER then
  573. parse_parameter_dec(pd);
  574. if is_func then
  575. begin
  576. consume(_COLON);
  577. single_type(pd.rettype,hs,false);
  578. end;
  579. if token=_OF then
  580. begin
  581. consume(_OF);
  582. consume(_OBJECT);
  583. include(pd.procoptions,po_methodpointer);
  584. check_self_para(pd);
  585. end;
  586. { Add implicit hidden parameters and function result }
  587. calc_parast(pd);
  588. tt.def:=pd;
  589. end;
  590. else
  591. expr_type;
  592. end;
  593. if tt.def=nil then
  594. tt:=generrortype;
  595. end;
  596. end.
  597. {
  598. $Log$
  599. Revision 1.54 2003-05-09 17:47:03 peter
  600. * self moved to hidden parameter
  601. * removed hdisposen,hnewn,selfn
  602. Revision 1.53 2003/04/27 11:21:34 peter
  603. * aktprocdef renamed to current_procdef
  604. * procinfo renamed to current_procinfo
  605. * procinfo will now be stored in current_module so it can be
  606. cleaned up properly
  607. * gen_main_procsym changed to create_main_proc and release_main_proc
  608. to also generate a tprocinfo structure
  609. * fixed unit implicit initfinal
  610. Revision 1.52 2003/04/27 07:29:51 peter
  611. * current_procdef cleanup, current_procdef is now always nil when parsing
  612. a new procdef declaration
  613. * aktprocsym removed
  614. * lexlevel removed, use symtable.symtablelevel instead
  615. * implicit init/final code uses the normal genentry/genexit
  616. * funcret state checking updated for new funcret handling
  617. Revision 1.51 2003/04/25 20:59:34 peter
  618. * removed funcretn,funcretsym, function result is now in varsym
  619. and aliases for result and function name are added using absolutesym
  620. * vs_hidden parameter for funcret passed in parameter
  621. * vs_hidden fixes
  622. * writenode changed to printnode and released from extdebug
  623. * -vp option added to generate a tree.log with the nodetree
  624. * nicer printnode for statements, callnode
  625. Revision 1.50 2003/01/05 15:54:15 florian
  626. + added proper support of type = type <type>; for simple types
  627. Revision 1.49 2003/01/03 23:50:41 peter
  628. * also allow = in fpc mode to assign enums
  629. Revision 1.48 2003/01/02 19:49:00 peter
  630. * update self parameter only for methodpointer and methods
  631. Revision 1.47 2002/12/21 13:07:34 peter
  632. * type redefine fix for tb0437
  633. Revision 1.46 2002/11/25 17:43:23 peter
  634. * splitted defbase in defutil,symutil,defcmp
  635. * merged isconvertable and is_equal into compare_defs(_ext)
  636. * made operator search faster by walking the list only once
  637. Revision 1.45 2002/09/27 21:13:29 carl
  638. * low-highval always checked if limit ober 2GB is reached (to avoid overflow)
  639. Revision 1.44 2002/09/10 16:26:39 peter
  640. * safety check for typesym added for incomplete type def check
  641. Revision 1.43 2002/09/09 19:34:07 peter
  642. * check for incomplete types in the current symtable when parsing
  643. forwarddef. Maybe this shall be delphi/tp only
  644. Revision 1.42 2002/07/20 11:57:56 florian
  645. * types.pas renamed to defbase.pas because D6 contains a types
  646. unit so this would conflicts if D6 programms are compiled
  647. + Willamette/SSE2 instructions to assembler added
  648. Revision 1.41 2002/05/18 13:34:16 peter
  649. * readded missing revisions
  650. Revision 1.40 2002/05/16 19:46:44 carl
  651. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  652. + try to fix temp allocation (still in ifdef)
  653. + generic constructor calls
  654. + start of tassembler / tmodulebase class cleanup
  655. Revision 1.38 2002/05/12 16:53:10 peter
  656. * moved entry and exitcode to ncgutil and cgobj
  657. * foreach gets extra argument for passing local data to the
  658. iterator function
  659. * -CR checks also class typecasts at runtime by changing them
  660. into as
  661. * fixed compiler to cycle with the -CR option
  662. * fixed stabs with elf writer, finally the global variables can
  663. be watched
  664. * removed a lot of routines from cga unit and replaced them by
  665. calls to cgobj
  666. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  667. u32bit then the other is typecasted also to u32bit without giving
  668. a rangecheck warning/error.
  669. * fixed pascal calling method with reversing also the high tree in
  670. the parast, detected by tcalcst3 test
  671. Revision 1.37 2002/04/19 15:46:03 peter
  672. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  673. in most cases and not written to the ppu
  674. * add mangeledname_prefix() routine to generate the prefix of
  675. manglednames depending on the current procedure, object and module
  676. * removed static procprefix since the mangledname is now build only
  677. on demand from tprocdef.mangledname
  678. Revision 1.36 2002/04/16 16:12:47 peter
  679. * give error when using enums with jumps as array index
  680. * allow char as enum value
  681. Revision 1.35 2002/04/04 19:06:04 peter
  682. * removed unused units
  683. * use tlocation.size in cg.a_*loc*() routines
  684. Revision 1.34 2002/01/24 18:25:49 peter
  685. * implicit result variable generation for assembler routines
  686. * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
  687. Revision 1.33 2002/01/15 16:13:34 jonas
  688. * fixed web bugs 1758 and 1760
  689. Revision 1.32 2002/01/06 12:08:15 peter
  690. * removed uauto from orddef, use new range_to_basetype generating
  691. the correct ordinal type for a range
  692. }