psystem.pas 26 KB

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