psystem.pas 27 KB

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