psystem.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Load the system unit, create required defs for systemunit
  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 psystem;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. symbase;
  23. procedure insertinternsyms(p : tsymtable);
  24. procedure insert_intern_types(p : tsymtable);
  25. procedure readconstdefs;
  26. procedure createconstdefs;
  27. procedure registernodes;
  28. procedure registertais;
  29. implementation
  30. uses
  31. globals,globtype,
  32. symconst,symtype,symsym,symdef,symtable,
  33. aasmtai,aasmcpu,ncgutil,
  34. {$ifdef GDB}
  35. gdb,
  36. {$endif GDB}
  37. node,nbas,nflw,nset,ncon,ncnv,nld,nmem,ncal,nmat,nadd,ninl,nopt
  38. {$ifdef Delphi}
  39. ,dmisc
  40. ,sysutils
  41. {$endif}
  42. ;
  43. procedure insertinternsyms(p : tsymtable);
  44. {
  45. all intern procedures for the system unit
  46. }
  47. begin
  48. p.insert(tsyssym.create('Concat',in_concat_x));
  49. p.insert(tsyssym.create('Write',in_write_x));
  50. p.insert(tsyssym.create('WriteLn',in_writeln_x));
  51. p.insert(tsyssym.create('Assigned',in_assigned_x));
  52. p.insert(tsyssym.create('Read',in_read_x));
  53. p.insert(tsyssym.create('ReadLn',in_readln_x));
  54. p.insert(tsyssym.create('Ofs',in_ofs_x));
  55. p.insert(tsyssym.create('SizeOf',in_sizeof_x));
  56. p.insert(tsyssym.create('TypeOf',in_typeof_x));
  57. p.insert(tsyssym.create('Low',in_low_x));
  58. p.insert(tsyssym.create('High',in_high_x));
  59. p.insert(tsyssym.create('Seg',in_seg_x));
  60. p.insert(tsyssym.create('Ord',in_ord_x));
  61. p.insert(tsyssym.create('Pred',in_pred_x));
  62. p.insert(tsyssym.create('Succ',in_succ_x));
  63. p.insert(tsyssym.create('Exclude',in_exclude_x_y));
  64. p.insert(tsyssym.create('Include',in_include_x_y));
  65. p.insert(tsyssym.create('Break',in_break));
  66. p.insert(tsyssym.create('Exit',in_exit));
  67. p.insert(tsyssym.create('Continue',in_continue));
  68. p.insert(tsyssym.create('Dec',in_dec_x));
  69. p.insert(tsyssym.create('Inc',in_inc_x));
  70. p.insert(tsyssym.create('Str',in_str_x_string));
  71. p.insert(tsyssym.create('Assert',in_assert_x_y));
  72. p.insert(tsyssym.create('Val',in_val_x));
  73. p.insert(tsyssym.create('Addr',in_addr_x));
  74. p.insert(tsyssym.create('TypeInfo',in_typeinfo_x));
  75. p.insert(tsyssym.create('SetLength',in_setlength_x));
  76. p.insert(tsyssym.create('Copy',in_copy_x));
  77. p.insert(tsyssym.create('Initialize',in_initialize_x));
  78. p.insert(tsyssym.create('Finalize',in_finalize_x));
  79. p.insert(tsyssym.create('Length',in_length_x));
  80. p.insert(tsyssym.create('New',in_new_x));
  81. p.insert(tsyssym.create('Dispose',in_dispose_x));
  82. end;
  83. procedure insert_intern_types(p : tsymtable);
  84. {
  85. all the types inserted into the system unit
  86. }
  87. function addtype(const s:string;const t:ttype):ttypesym;
  88. begin
  89. result:=ttypesym.create(s,t);
  90. p.insert(result);
  91. { add init/final table if required }
  92. if t.def.needs_inittable then
  93. generate_inittable(result);
  94. end;
  95. procedure adddef(const s:string;def:tdef);
  96. var
  97. t : ttype;
  98. begin
  99. t.setdef(def);
  100. p.insert(ttypesym.create(s,t));
  101. end;
  102. var
  103. { several defs to simulate more or less C++ objects for GDB }
  104. vmttype,
  105. vmtarraytype : ttype;
  106. hrecst : trecordsymtable;
  107. begin
  108. {$ifdef cpufpemu}
  109. { Normal types }
  110. if (cs_fp_emulation in aktmoduleswitches) then
  111. begin
  112. addtype('Single',s32floattype);
  113. { extended size is the best real type for the target }
  114. addtype('Real',s32floattype);
  115. pbestrealtype:=@s32floattype;
  116. { extended size is the best real type for the target }
  117. addtype('Extended',pbestrealtype^);
  118. end
  119. else
  120. {$endif cpufpemu}
  121. begin
  122. addtype('Single',s32floattype);
  123. addtype('Double',s64floattype);
  124. { extended size is the best real type for the target }
  125. addtype('Extended',pbestrealtype^);
  126. addtype('Real',s64floattype);
  127. end;
  128. {$ifdef x86}
  129. adddef('Comp',tfloatdef.create(s64comp));
  130. {$endif x86}
  131. addtype('Currency',s64currencytype);
  132. addtype('Pointer',voidpointertype);
  133. addtype('FarPointer',voidfarpointertype);
  134. addtype('ShortString',cshortstringtype);
  135. addtype('LongString',clongstringtype);
  136. addtype('AnsiString',cansistringtype);
  137. addtype('WideString',cwidestringtype);
  138. addtype('Boolean',booltype);
  139. addtype('ByteBool',booltype);
  140. adddef('WordBool',torddef.create(bool16bit,0,1));
  141. adddef('LongBool',torddef.create(bool32bit,0,1));
  142. addtype('Char',cchartype);
  143. addtype('WideChar',cwidechartype);
  144. adddef('Text',tfiledef.createtext);
  145. addtype('Longword',u32inttype);
  146. addtype('QWord',u64inttype);
  147. addtype('Int64',s64inttype);
  148. adddef('TypedFile',tfiledef.createtyped(voidtype));
  149. addtype('Variant',cvarianttype);
  150. addtype('OleVariant',colevarianttype);
  151. { Internal types }
  152. addtype('$formal',cformaltype);
  153. addtype('$void',voidtype);
  154. addtype('$byte',u8inttype);
  155. addtype('$word',u16inttype);
  156. addtype('$ulong',u32inttype);
  157. addtype('$longint',s32inttype);
  158. addtype('$qword',u64inttype);
  159. addtype('$int64',s64inttype);
  160. addtype('$char',cchartype);
  161. addtype('$widechar',cwidechartype);
  162. addtype('$shortstring',cshortstringtype);
  163. addtype('$longstring',clongstringtype);
  164. addtype('$ansistring',cansistringtype);
  165. addtype('$widestring',cwidestringtype);
  166. addtype('$openshortstring',openshortstringtype);
  167. addtype('$boolean',booltype);
  168. addtype('$void_pointer',voidpointertype);
  169. addtype('$char_pointer',charpointertype);
  170. addtype('$void_farpointer',voidfarpointertype);
  171. addtype('$openchararray',openchararraytype);
  172. addtype('$file',cfiletype);
  173. addtype('$variant',cvarianttype);
  174. addtype('$olevariant',cvarianttype);
  175. addtype('$s32real',s32floattype);
  176. addtype('$s64real',s64floattype);
  177. addtype('$s80real',s80floattype);
  178. addtype('$s64currency',s64currencytype);
  179. { Add a type for virtual method tables }
  180. hrecst:=trecordsymtable.create(aktpackrecords);
  181. vmttype.setdef(trecorddef.create(hrecst));
  182. pvmttype.setdef(tpointerdef.create(vmttype));
  183. hrecst.insertfield(tvarsym.create('$parent',vs_value,pvmttype),true);
  184. hrecst.insertfield(tvarsym.create('$length',vs_value,s32inttype),true);
  185. hrecst.insertfield(tvarsym.create('$mlength',vs_value,s32inttype),true);
  186. vmtarraytype.setdef(tarraydef.create(0,1,s32inttype));
  187. tarraydef(vmtarraytype.def).setelementtype(voidpointertype);
  188. hrecst.insertfield(tvarsym.create('$__pfn',vs_value,vmtarraytype),true);
  189. addtype('$__vtbl_ptr_type',vmttype);
  190. addtype('$pvmt',pvmttype);
  191. vmtarraytype.setdef(tarraydef.create(0,1,s32inttype));
  192. tarraydef(vmtarraytype.def).setelementtype(pvmttype);
  193. addtype('$vtblarray',vmtarraytype);
  194. { Add a type for methodpointers }
  195. hrecst:=trecordsymtable.create(1);
  196. hrecst.insertfield(tvarsym.create('$proc',vs_value,voidpointertype),true);
  197. hrecst.insertfield(tvarsym.create('$self',vs_value,voidpointertype),true);
  198. methodpointertype.setdef(trecorddef.create(hrecst));
  199. addtype('$methodpointer',methodpointertype);
  200. { Add functions that require compiler magic }
  201. insertinternsyms(p);
  202. end;
  203. procedure readconstdefs;
  204. {
  205. Load all default definitions for consts from the system unit
  206. }
  207. begin
  208. globaldef('byte',u8inttype);
  209. globaldef('word',u16inttype);
  210. globaldef('ulong',u32inttype);
  211. globaldef('longint',s32inttype);
  212. globaldef('qword',u64inttype);
  213. globaldef('int64',s64inttype);
  214. globaldef('formal',cformaltype);
  215. globaldef('void',voidtype);
  216. globaldef('char',cchartype);
  217. globaldef('widechar',cwidechartype);
  218. globaldef('shortstring',cshortstringtype);
  219. globaldef('longstring',clongstringtype);
  220. globaldef('ansistring',cansistringtype);
  221. globaldef('widestring',cwidestringtype);
  222. globaldef('openshortstring',openshortstringtype);
  223. globaldef('openchararray',openchararraytype);
  224. globaldef('s32real',s32floattype);
  225. globaldef('s64real',s64floattype);
  226. globaldef('s80real',s80floattype);
  227. globaldef('s64currency',s64currencytype);
  228. globaldef('boolean',booltype);
  229. globaldef('void_pointer',voidpointertype);
  230. globaldef('char_pointer',charpointertype);
  231. globaldef('void_farpointer',voidfarpointertype);
  232. globaldef('file',cfiletype);
  233. globaldef('pvmt',pvmttype);
  234. globaldef('variant',cvarianttype);
  235. globaldef('olevariant',colevarianttype);
  236. globaldef('methodpointer',methodpointertype);
  237. {$ifdef cpu64bit}
  238. uinttype:=u64inttype;
  239. sinttype:=s64inttype;
  240. ptrinttype:=u64inttype;
  241. {$else cpu64bit}
  242. uinttype:=u32inttype;
  243. sinttype:=s32inttype;
  244. ptrinttype:=u32inttype;
  245. {$endif cpu64bit}
  246. end;
  247. procedure createconstdefs;
  248. {
  249. Create all default definitions for consts for the system unit
  250. }
  251. var
  252. oldregisterdef : boolean;
  253. begin
  254. { create definitions for constants }
  255. oldregisterdef:=registerdef;
  256. registerdef:=false;
  257. cformaltype.setdef(tformaldef.create);
  258. voidtype.setdef(torddef.create(uvoid,0,0));
  259. u8inttype.setdef(torddef.create(u8bit,0,255));
  260. u16inttype.setdef(torddef.create(u16bit,0,65535));
  261. u32inttype.setdef(torddef.create(u32bit,0,high(longword)));
  262. s32inttype.setdef(torddef.create(s32bit,low(longint),high(longint)));
  263. u64inttype.setdef(torddef.create(u64bit,low(qword),TConstExprInt(high(qword))));
  264. s64inttype.setdef(torddef.create(s64bit,low(int64),high(int64)));
  265. booltype.setdef(torddef.create(bool8bit,0,1));
  266. cchartype.setdef(torddef.create(uchar,0,255));
  267. cwidechartype.setdef(torddef.create(uwidechar,0,65535));
  268. cshortstringtype.setdef(tstringdef.createshort(255));
  269. { should we give a length to the default long and ansi string definition ?? }
  270. clongstringtype.setdef(tstringdef.createlong(-1));
  271. cansistringtype.setdef(tstringdef.createansi(-1));
  272. cwidestringtype.setdef(tstringdef.createwide(-1));
  273. { length=0 for shortstring is open string (needed for readln(string) }
  274. openshortstringtype.setdef(tstringdef.createshort(0));
  275. openchararraytype.setdef(tarraydef.create(0,-1,s32inttype));
  276. tarraydef(openchararraytype.def).setelementtype(cchartype);
  277. {$ifdef x86}
  278. s32floattype.setdef(tfloatdef.create(s32real));
  279. s64floattype.setdef(tfloatdef.create(s64real));
  280. s80floattype.setdef(tfloatdef.create(s80real));
  281. s64currencytype.setdef(tfloatdef.create(s64currency));
  282. {$endif x86}
  283. {$ifdef powerpc}
  284. s32floattype.setdef(tfloatdef.create(s32real));
  285. s64floattype.setdef(tfloatdef.create(s64real));
  286. s80floattype.setdef(tfloatdef.create(s80real));
  287. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  288. {$endif powerpc}
  289. {$ifdef sparc}
  290. s32floattype.setdef(tfloatdef.create(s32real));
  291. s64floattype.setdef(tfloatdef.create(s64real));
  292. s80floattype.setdef(tfloatdef.create(s80real));
  293. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  294. {$endif sparc}
  295. {$ifdef m68k}
  296. s32floattype.setdef(tfloatdef.create(s32real));
  297. s64floattype.setdef(tfloatdef.create(s64real));
  298. s80floattype.setdef(tfloatdef.create(s80real));
  299. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  300. {$endif}
  301. {$ifdef arm}
  302. s32floattype.setdef(tfloatdef.create(s32real));
  303. s64floattype.setdef(tfloatdef.create(s64real));
  304. s80floattype.setdef(tfloatdef.create(s80real));
  305. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  306. {$endif arm}
  307. {$ifdef cpu64bit}
  308. uinttype:=u64inttype;
  309. sinttype:=s64inttype;
  310. ptrinttype:=u64inttype;
  311. {$else cpu64bit}
  312. uinttype:=u32inttype;
  313. sinttype:=s32inttype;
  314. ptrinttype:=u32inttype;
  315. {$endif cpu64bit}
  316. { some other definitions }
  317. voidpointertype.setdef(tpointerdef.create(voidtype));
  318. charpointertype.setdef(tpointerdef.create(cchartype));
  319. voidfarpointertype.setdef(tpointerdef.createfar(voidtype));
  320. cfiletype.setdef(tfiledef.createuntyped);
  321. cvarianttype.setdef(tvariantdef.create(vt_normalvariant));
  322. colevarianttype.setdef(tvariantdef.create(vt_olevariant));
  323. registerdef:=oldregisterdef;
  324. end;
  325. procedure registernodes;
  326. {
  327. Register all possible nodes in the nodeclass array that
  328. will be used for loading the nodes from a ppu
  329. }
  330. begin
  331. nodeclass[addn]:=caddnode;
  332. nodeclass[muln]:=caddnode;
  333. nodeclass[subn]:=caddnode;
  334. nodeclass[divn]:=cmoddivnode;
  335. nodeclass[symdifn]:=caddnode;
  336. nodeclass[modn]:=cmoddivnode;
  337. nodeclass[assignn]:=cassignmentnode;
  338. nodeclass[loadn]:=cloadnode;
  339. nodeclass[rangen]:=crangenode;
  340. nodeclass[ltn]:=caddnode;
  341. nodeclass[lten]:=caddnode;
  342. nodeclass[gtn]:=caddnode;
  343. nodeclass[gten]:=caddnode;
  344. nodeclass[equaln]:=caddnode;
  345. nodeclass[unequaln]:=caddnode;
  346. nodeclass[inn]:=cinnode;
  347. nodeclass[orn]:=caddnode;
  348. nodeclass[xorn]:=caddnode;
  349. nodeclass[shrn]:=cshlshrnode;
  350. nodeclass[shln]:=cshlshrnode;
  351. nodeclass[slashn]:=caddnode;
  352. nodeclass[andn]:=caddnode;
  353. nodeclass[subscriptn]:=csubscriptnode;
  354. nodeclass[derefn]:=cderefnode;
  355. nodeclass[addrn]:=caddrnode;
  356. nodeclass[ordconstn]:=cordconstnode;
  357. nodeclass[typeconvn]:=ctypeconvnode;
  358. nodeclass[calln]:=ccallnode;
  359. nodeclass[callparan]:=ccallparanode;
  360. nodeclass[realconstn]:=crealconstnode;
  361. nodeclass[unaryminusn]:=cunaryminusnode;
  362. nodeclass[asmn]:=casmnode;
  363. nodeclass[vecn]:=cvecnode;
  364. nodeclass[pointerconstn]:=cpointerconstnode;
  365. nodeclass[stringconstn]:=cstringconstnode;
  366. nodeclass[notn]:=cnotnode;
  367. nodeclass[inlinen]:=cinlinenode;
  368. nodeclass[niln]:=cnilnode;
  369. nodeclass[errorn]:=cerrornode;
  370. nodeclass[typen]:=ctypenode;
  371. nodeclass[setelementn]:=csetelementnode;
  372. nodeclass[setconstn]:=csetconstnode;
  373. nodeclass[blockn]:=cblocknode;
  374. nodeclass[statementn]:=cstatementnode;
  375. nodeclass[ifn]:=cifnode;
  376. nodeclass[breakn]:=cbreaknode;
  377. nodeclass[continuen]:=ccontinuenode;
  378. nodeclass[whilerepeatn]:=cwhilerepeatnode;
  379. nodeclass[forn]:=cfornode;
  380. nodeclass[exitn]:=cexitnode;
  381. nodeclass[withn]:=cwithnode;
  382. nodeclass[casen]:=ccasenode;
  383. nodeclass[labeln]:=clabelnode;
  384. nodeclass[goton]:=cgotonode;
  385. nodeclass[tryexceptn]:=ctryexceptnode;
  386. nodeclass[raisen]:=craisenode;
  387. nodeclass[tryfinallyn]:=ctryfinallynode;
  388. nodeclass[onn]:=connode;
  389. nodeclass[isn]:=cisnode;
  390. nodeclass[asn]:=casnode;
  391. nodeclass[caretn]:=caddnode;
  392. nodeclass[starstarn]:=caddnode;
  393. nodeclass[arrayconstructorn]:=carrayconstructornode;
  394. nodeclass[arrayconstructorrangen]:=carrayconstructorrangenode;
  395. nodeclass[tempcreaten]:=ctempcreatenode;
  396. nodeclass[temprefn]:=ctemprefnode;
  397. nodeclass[tempdeleten]:=ctempdeletenode;
  398. nodeclass[addoptn]:=caddnode;
  399. nodeclass[nothingn]:=cnothingnode;
  400. nodeclass[loadvmtaddrn]:=cloadvmtaddrnode;
  401. nodeclass[guidconstn]:=cguidconstnode;
  402. nodeclass[rttin]:=crttinode;
  403. nodeclass[loadparentfpn]:=cloadparentfpnode;
  404. end;
  405. procedure registertais;
  406. {
  407. Register all possible tais in the taiclass array that
  408. will be used for loading the tais from a ppu
  409. }
  410. begin
  411. aiclass[ait_none]:=nil;
  412. aiclass[ait_align]:=tai_align;
  413. aiclass[ait_section]:=tai_section;
  414. aiclass[ait_comment]:=tai_comment;
  415. aiclass[ait_direct]:=tai_direct;
  416. aiclass[ait_string]:=tai_string;
  417. aiclass[ait_instruction]:=taicpu;
  418. aiclass[ait_datablock]:=tai_datablock;
  419. aiclass[ait_symbol]:=tai_symbol;
  420. aiclass[ait_symbol_end]:=tai_symbol_end;
  421. aiclass[ait_label]:=tai_label;
  422. aiclass[ait_const_64bit]:=tai_const;
  423. aiclass[ait_const_32bit]:=tai_const;
  424. aiclass[ait_const_16bit]:=tai_const;
  425. aiclass[ait_const_8bit]:=tai_const;
  426. aiclass[ait_const_symbol]:=tai_const_symbol;
  427. aiclass[ait_const_rva]:=tai_const_symbol;
  428. aiclass[ait_real_32bit]:=tai_real_32bit;
  429. aiclass[ait_real_64bit]:=tai_real_64bit;
  430. aiclass[ait_real_80bit]:=tai_real_80bit;
  431. aiclass[ait_comp_64bit]:=tai_comp_64bit;
  432. {$ifdef GDB}
  433. aiclass[ait_stabn]:=tai_stabn;
  434. aiclass[ait_stabs]:=tai_stabs;
  435. aiclass[ait_force_line]:=tai_force_line;
  436. aiclass[ait_stab_function_name]:=tai_stab_function_name;
  437. {$endif GDB}
  438. {$ifdef alpha}
  439. { the follow is for the DEC Alpha }
  440. aiclass[ait_frame]:=tai_frame;
  441. aiclass[ait_ent]:=tai_ent;
  442. {$endif alpha}
  443. {$ifdef m68k}
  444. {$warning FIXME: tai_labeled_instruction doesn't exists}
  445. // aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
  446. {$endif m68k}
  447. {$ifdef ia64}
  448. aiclass[ait_bundle]:=tai_bundle;
  449. aiclass[ait_stop]:=tai_stop;
  450. {$endif ia64}
  451. {$ifdef SPARC}
  452. // aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
  453. {$endif SPARC}
  454. aiclass[ait_cut]:=tai_cut;
  455. aiclass[ait_regalloc]:=tai_regalloc;
  456. aiclass[ait_tempalloc]:=tai_tempalloc;
  457. aiclass[ait_marker]:=tai_marker;
  458. end;
  459. end.
  460. {
  461. $Log$
  462. Revision 1.63 2004-02-26 16:16:38 peter
  463. * tai_const.create_ptr added
  464. Revision 1.62 2004/02/04 22:15:15 daniel
  465. * Rtti generation moved to ncgutil
  466. * Assmtai usage of symsym removed
  467. * operator overloading cleanup up
  468. Revision 1.61 2004/02/03 22:32:54 peter
  469. * renamed xNNbittype to xNNinttype
  470. * renamed registers32 to registersint
  471. * replace some s32bit,u32bit with torddef([su]inttype).def.typ
  472. Revision 1.60 2004/01/28 22:16:31 peter
  473. * more record alignment fixes
  474. Revision 1.59 2004/01/20 12:59:37 florian
  475. * common addnode code for x86-64 and i386
  476. Revision 1.58 2003/11/29 16:19:54 peter
  477. * Initialize() added
  478. Revision 1.57 2003/10/06 22:23:41 florian
  479. + added basic olevariant support
  480. Revision 1.56 2003/09/28 17:55:04 peter
  481. * parent framepointer changed to hidden parameter
  482. * tloadparentfpnode added
  483. Revision 1.55 2003/09/23 17:56:06 peter
  484. * locals and paras are allocated in the code generation
  485. * tvarsym.localloc contains the location of para/local when
  486. generating code for the current procedure
  487. Revision 1.54 2003/09/03 11:18:37 florian
  488. * fixed arm concatcopy
  489. + arm support in the common compiler sources added
  490. * moved some generic cg code around
  491. + tfputype added
  492. * ...
  493. Revision 1.53 2003/08/10 17:25:23 peter
  494. * fixed some reported bugs
  495. Revision 1.52 2003/05/26 21:17:18 peter
  496. * procinlinenode removed
  497. * aktexit2label removed, fast exit removed
  498. + tcallnode.inlined_pass_2 added
  499. Revision 1.51 2003/05/25 11:34:17 peter
  500. * methodpointer self pushing fixed
  501. Revision 1.50 2003/05/13 19:14:41 peter
  502. * failn removed
  503. * inherited result code check moven to pexpr
  504. Revision 1.49 2003/05/09 17:47:03 peter
  505. * self moved to hidden parameter
  506. * removed hdisposen,hnewn,selfn
  507. Revision 1.48 2003/05/01 07:59:42 florian
  508. * introduced defaultordconsttype to decribe the default size of ordinal constants
  509. on 64 bit CPUs it's equal to cs64bitdef while on 32 bit CPUs it's equal to s32bitdef
  510. + added defines CPU32 and CPU64 for 32 bit and 64 bit CPUs
  511. * int64s/qwords are allowed as for loop counter on 64 bit CPUs
  512. Revision 1.47 2003/04/25 20:59:34 peter
  513. * removed funcretn,funcretsym, function result is now in varsym
  514. and aliases for result and function name are added using absolutesym
  515. * vs_hidden parameter for funcret passed in parameter
  516. * vs_hidden fixes
  517. * writenode changed to printnode and released from extdebug
  518. * -vp option added to generate a tree.log with the nodetree
  519. * nicer printnode for statements, callnode
  520. Revision 1.46 2003/04/23 21:10:54 peter
  521. * fix compile for ppc,sparc,m68k
  522. Revision 1.45 2003/04/23 20:16:04 peter
  523. + added currency support based on int64
  524. + is_64bit for use in cg units instead of is_64bitint
  525. * removed cgmessage from n386add, replace with internalerrors
  526. Revision 1.44 2002/12/06 16:56:59 peter
  527. * only compile cs_fp_emulation support when cpufpuemu is defined
  528. * define cpufpuemu for m68k only
  529. Revision 1.43 2002/11/30 21:32:26 carl
  530. + Add loading of softfpu in emulation mode
  531. + Correct routine call for softfpu
  532. * Extended type must also be defined even with softfpu
  533. Revision 1.42 2002/10/05 12:43:27 carl
  534. * fixes for Delphi 6 compilation
  535. (warning : Some features do not work under Delphi)
  536. Revision 1.41 2002/10/02 18:20:53 peter
  537. * Copy() is now internal syssym that calls compilerprocs
  538. Revision 1.40 2002/09/27 21:13:29 carl
  539. * low-highval always checked if limit ober 2GB is reached (to avoid overflow)
  540. Revision 1.39 2002/09/07 20:46:10 carl
  541. * cardinal -> longword
  542. Revision 1.38 2002/08/23 13:11:11 mazen
  543. fixed compilation problem related to tai_labeled_instruction
  544. Revision 1.37 2002/08/18 20:06:25 peter
  545. * inlining is now also allowed in interface
  546. * renamed write/load to ppuwrite/ppuload
  547. * tnode storing in ppu
  548. * nld,ncon,nbas are already updated for storing in ppu
  549. Revision 1.36 2002/08/15 19:10:35 peter
  550. * first things tai,tnode storing in ppu
  551. Revision 1.35 2002/08/14 19:14:39 carl
  552. + fpu emulation support (generic and untested)
  553. Revision 1.34 2002/08/13 18:01:52 carl
  554. * rename swatoperands to swapoperands
  555. + m68k first compilable version (still needs a lot of testing):
  556. assembler generator, system information , inline
  557. assembler reader.
  558. Revision 1.33 2002/08/11 15:28:00 florian
  559. + support of explicit type case <any ordinal type>->pointer
  560. (delphi mode only)
  561. Revision 1.32 2002/07/25 17:54:24 carl
  562. + Extended is now CPU dependant (equal to bestrealtype)
  563. Revision 1.30 2002/07/07 09:52:32 florian
  564. * powerpc target fixed, very simple units can be compiled
  565. * some basic stuff for better callparanode handling, far from being finished
  566. Revision 1.29 2002/07/06 20:18:47 carl
  567. + more SPARC patches from Mazen
  568. Revision 1.28 2002/07/04 20:43:02 florian
  569. * first x86-64 patches
  570. Revision 1.27 2002/07/01 16:23:54 peter
  571. * cg64 patch
  572. * basics for currency
  573. * asnode updates for class and interface (not finished)
  574. Revision 1.26 2002/05/18 13:34:16 peter
  575. * readded missing revisions
  576. Revision 1.25 2002/05/16 19:46:44 carl
  577. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  578. + try to fix temp allocation (still in ifdef)
  579. + generic constructor calls
  580. + start of tassembler / tmodulebase class cleanup
  581. Revision 1.23 2002/05/12 16:53:09 peter
  582. * moved entry and exitcode to ncgutil and cgobj
  583. * foreach gets extra argument for passing local data to the
  584. iterator function
  585. * -CR checks also class typecasts at runtime by changing them
  586. into as
  587. * fixed compiler to cycle with the -CR option
  588. * fixed stabs with elf writer, finally the global variables can
  589. be watched
  590. * removed a lot of routines from cga unit and replaced them by
  591. calls to cgobj
  592. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  593. u32bit then the other is typecasted also to u32bit without giving
  594. a rangecheck warning/error.
  595. * fixed pascal calling method with reversing also the high tree in
  596. the parast, detected by tcalcst3 test
  597. Revision 1.22 2002/01/24 12:33:53 jonas
  598. * adapted ranges of native types to int64 (e.g. high cardinal is no
  599. longer longint($ffffffff), but just $fffffff in psystem)
  600. * small additional fix in 64bit rangecheck code generation for 32 bit
  601. processors
  602. * adaption of ranges required the matching talgorithm used for selecting
  603. which overloaded procedure to call to be adapted. It should now always
  604. select the closest match for ordinal parameters.
  605. + inttostr(qword) in sysstr.inc/sysstrh.inc
  606. + abs(int64), sqr(int64), sqr(qword) in systemh.inc/generic.inc (previous
  607. fixes were required to be able to add them)
  608. * is_in_limit() moved from ncal to types unit, should always be used
  609. instead of direct comparisons of low/high values of orddefs because
  610. qword is a special case
  611. }