psystem.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. Load the system unit, create required defs for systemunit
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit psystem;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. symbase;
  22. procedure insertinternsyms(p : tsymtable);
  23. procedure insert_intern_types(p : tsymtable);
  24. procedure readconstdefs;
  25. procedure createconstdefs;
  26. procedure registernodes;
  27. procedure registertais;
  28. implementation
  29. uses
  30. globals,globtype,verbose,
  31. systems,
  32. symconst,symtype,symsym,symdef,symtable,
  33. aasmtai,aasmcpu,ncgutil,fmodule,
  34. node,nbas,nflw,nset,ncon,ncnv,nld,nmem,ncal,nmat,nadd,ninl,nopt
  35. ;
  36. procedure insertinternsyms(p : tsymtable);
  37. {
  38. all intern procedures for the system unit
  39. }
  40. begin
  41. p.insert(tsyssym.create('Concat',in_concat_x));
  42. p.insert(tsyssym.create('Write',in_write_x));
  43. p.insert(tsyssym.create('WriteLn',in_writeln_x));
  44. p.insert(tsyssym.create('Assigned',in_assigned_x));
  45. p.insert(tsyssym.create('Read',in_read_x));
  46. p.insert(tsyssym.create('ReadLn',in_readln_x));
  47. p.insert(tsyssym.create('Ofs',in_ofs_x));
  48. p.insert(tsyssym.create('SizeOf',in_sizeof_x));
  49. p.insert(tsyssym.create('TypeOf',in_typeof_x));
  50. p.insert(tsyssym.create('Low',in_low_x));
  51. p.insert(tsyssym.create('High',in_high_x));
  52. p.insert(tsyssym.create('Slice',in_slice_x));
  53. p.insert(tsyssym.create('Seg',in_seg_x));
  54. p.insert(tsyssym.create('Ord',in_ord_x));
  55. p.insert(tsyssym.create('Pred',in_pred_x));
  56. p.insert(tsyssym.create('Succ',in_succ_x));
  57. p.insert(tsyssym.create('Exclude',in_exclude_x_y));
  58. p.insert(tsyssym.create('Include',in_include_x_y));
  59. p.insert(tsyssym.create('Break',in_break));
  60. p.insert(tsyssym.create('Exit',in_exit));
  61. p.insert(tsyssym.create('Continue',in_continue));
  62. p.insert(tsyssym.create('Leave',in_leave)); {macpas only}
  63. p.insert(tsyssym.create('Cycle',in_cycle)); {macpas only}
  64. p.insert(tsyssym.create('Dec',in_dec_x));
  65. p.insert(tsyssym.create('Inc',in_inc_x));
  66. p.insert(tsyssym.create('Str',in_str_x_string));
  67. p.insert(tsyssym.create('Assert',in_assert_x_y));
  68. p.insert(tsyssym.create('Val',in_val_x));
  69. p.insert(tsyssym.create('Addr',in_addr_x));
  70. p.insert(tsyssym.create('TypeInfo',in_typeinfo_x));
  71. p.insert(tsyssym.create('SetLength',in_setlength_x));
  72. p.insert(tsyssym.create('Copy',in_copy_x));
  73. p.insert(tsyssym.create('Initialize',in_initialize_x));
  74. p.insert(tsyssym.create('Finalize',in_finalize_x));
  75. p.insert(tsyssym.create('Length',in_length_x));
  76. p.insert(tsyssym.create('New',in_new_x));
  77. p.insert(tsyssym.create('Dispose',in_dispose_x));
  78. end;
  79. procedure insert_intern_types(p : tsymtable);
  80. {
  81. all the types inserted into the system unit
  82. }
  83. function addtype(const s:string;const t:ttype):ttypesym;
  84. begin
  85. result:=ttypesym.create(s,t);
  86. p.insert(result);
  87. { add init/final table if required }
  88. if t.def.needs_inittable then
  89. generate_inittable(result);
  90. end;
  91. procedure adddef(const s:string;def:tdef);
  92. var
  93. t : ttype;
  94. begin
  95. t.setdef(def);
  96. p.insert(ttypesym.create(s,t));
  97. end;
  98. var
  99. hrecst : trecordsymtable;
  100. begin
  101. if target_info.system=system_x86_64_win64 then
  102. pbestrealtype:=@s64floattype;
  103. {$ifdef cpufpemu}
  104. { Normal types }
  105. (* we use the same types as without emulator, the only
  106. difference is that direct calls to the emulator are generated
  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. *)
  118. {$endif cpufpemu}
  119. begin
  120. addtype('Single',s32floattype);
  121. addtype('Double',s64floattype);
  122. { extended size is the best real type for the target }
  123. addtype('Extended',pbestrealtype^);
  124. addtype('Real',s64floattype);
  125. end;
  126. {$ifdef x86}
  127. if target_info.system<>system_x86_64_win64 then
  128. adddef('Comp',tfloatdef.create(s64comp));
  129. {$endif x86}
  130. addtype('Currency',s64currencytype);
  131. addtype('Pointer',voidpointertype);
  132. {$ifdef x86}
  133. addtype('FarPointer',voidfarpointertype);
  134. {$endif x86}
  135. addtype('ShortString',cshortstringtype);
  136. {$ifdef support_longstring}
  137. addtype('LongString',clongstringtype);
  138. {$endif support_longstring}
  139. {$ifdef ansistring_bits}
  140. addtype('AnsiString',cansistringtype16);
  141. addtype('AnsiString',cansistringtype32);
  142. addtype('AnsiString',cansistringtype64);
  143. {$else}
  144. addtype('AnsiString',cansistringtype);
  145. {$endif}
  146. addtype('WideString',cwidestringtype);
  147. addtype('Boolean',booltype);
  148. addtype('ByteBool',booltype);
  149. adddef('WordBool',torddef.create(bool16bit,0,1));
  150. adddef('LongBool',torddef.create(bool32bit,0,1));
  151. addtype('Byte',u8inttype);
  152. addtype('ShortInt',s8inttype);
  153. addtype('Word',u16inttype);
  154. addtype('SmallInt',s16inttype);
  155. addtype('LongWord',u32inttype);
  156. addtype('LongInt',s32inttype);
  157. addtype('QWord',u64inttype);
  158. addtype('Int64',s64inttype);
  159. addtype('Char',cchartype);
  160. addtype('WideChar',cwidechartype);
  161. adddef('Text',tfiledef.createtext);
  162. adddef('TypedFile',tfiledef.createtyped(voidtype));
  163. addtype('Variant',cvarianttype);
  164. addtype('OleVariant',colevarianttype);
  165. { Internal types }
  166. addtype('$formal',cformaltype);
  167. addtype('$void',voidtype);
  168. addtype('$byte',u8inttype);
  169. addtype('$shortint',s8inttype);
  170. addtype('$word',u16inttype);
  171. addtype('$smallint',s16inttype);
  172. addtype('$ulong',u32inttype);
  173. addtype('$longint',s32inttype);
  174. addtype('$qword',u64inttype);
  175. addtype('$int64',s64inttype);
  176. addtype('$char',cchartype);
  177. addtype('$widechar',cwidechartype);
  178. addtype('$shortstring',cshortstringtype);
  179. addtype('$longstring',clongstringtype);
  180. {$ifdef ansistring_bits}
  181. addtype('$ansistring16',cansistringtype16);
  182. addtype('$ansistring32',cansistringtype32);
  183. addtype('$ansistring64',cansistringtype64);
  184. {$else}
  185. addtype('$ansistring',cansistringtype);
  186. {$endif}
  187. addtype('$widestring',cwidestringtype);
  188. addtype('$openshortstring',openshortstringtype);
  189. addtype('$boolean',booltype);
  190. addtype('$void_pointer',voidpointertype);
  191. addtype('$char_pointer',charpointertype);
  192. addtype('$widechar_pointer',widecharpointertype);
  193. addtype('$void_farpointer',voidfarpointertype);
  194. addtype('$openchararray',openchararraytype);
  195. addtype('$file',cfiletype);
  196. addtype('$variant',cvarianttype);
  197. addtype('$olevariant',cvarianttype);
  198. addtype('$s32real',s32floattype);
  199. addtype('$s64real',s64floattype);
  200. addtype('$s80real',s80floattype);
  201. addtype('$s64currency',s64currencytype);
  202. { Add a type for virtual method tables }
  203. hrecst:=trecordsymtable.create(aktpackrecords);
  204. vmttype.setdef(trecorddef.create(hrecst));
  205. pvmttype.setdef(tpointerdef.create(vmttype));
  206. hrecst.insertfield(tfieldvarsym.create('$parent',vs_value,pvmttype,[]),true);
  207. hrecst.insertfield(tfieldvarsym.create('$length',vs_value,s32inttype,[]),true);
  208. hrecst.insertfield(tfieldvarsym.create('$mlength',vs_value,s32inttype,[]),true);
  209. vmtarraytype.setdef(tarraydef.create(0,1,s32inttype));
  210. tarraydef(vmtarraytype.def).setelementtype(voidpointertype);
  211. hrecst.insertfield(tfieldvarsym.create('$__pfn',vs_value,vmtarraytype,[]),true);
  212. addtype('$__vtbl_ptr_type',vmttype);
  213. addtype('$pvmt',pvmttype);
  214. vmtarraytype.setdef(tarraydef.create(0,1,s32inttype));
  215. tarraydef(vmtarraytype.def).setelementtype(pvmttype);
  216. addtype('$vtblarray',vmtarraytype);
  217. { Add a type for methodpointers }
  218. hrecst:=trecordsymtable.create(1);
  219. hrecst.insertfield(tfieldvarsym.create('$proc',vs_value,voidpointertype,[]),true);
  220. hrecst.insertfield(tfieldvarsym.create('$self',vs_value,voidpointertype,[]),true);
  221. methodpointertype.setdef(trecorddef.create(hrecst));
  222. addtype('$methodpointer',methodpointertype);
  223. { Add functions that require compiler magic }
  224. insertinternsyms(p);
  225. end;
  226. procedure readconstdefs;
  227. {
  228. Load all default definitions for consts from the system unit
  229. }
  230. procedure loadtype(const s:string;var t:ttype);
  231. var
  232. srsym : tsym;
  233. begin
  234. srsym:=searchsymonlyin(systemunit,s);
  235. if not(assigned(srsym) and
  236. (srsym.typ=typesym)) then
  237. internalerror(200403231);
  238. t:=ttypesym(srsym).restype;
  239. end;
  240. var
  241. oldcurrentmodule : tmodule;
  242. begin
  243. oldcurrentmodule:=current_module;
  244. current_module:=nil;
  245. loadtype('byte',u8inttype);
  246. loadtype('shortint',s8inttype);
  247. loadtype('word',u16inttype);
  248. loadtype('smallint',s16inttype);
  249. loadtype('ulong',u32inttype);
  250. loadtype('longint',s32inttype);
  251. loadtype('qword',u64inttype);
  252. loadtype('int64',s64inttype);
  253. loadtype('formal',cformaltype);
  254. loadtype('void',voidtype);
  255. loadtype('char',cchartype);
  256. loadtype('widechar',cwidechartype);
  257. loadtype('shortstring',cshortstringtype);
  258. loadtype('longstring',clongstringtype);
  259. {$ifdef ansistring_bits}
  260. loadtype('ansistring16',cansistringtype16);
  261. loadtype('ansistring32',cansistringtype32);
  262. loadtype('ansistring64',cansistringtype64);
  263. {$else}
  264. loadtype('ansistring',cansistringtype);
  265. {$endif}
  266. loadtype('widestring',cwidestringtype);
  267. loadtype('openshortstring',openshortstringtype);
  268. loadtype('openchararray',openchararraytype);
  269. loadtype('s32real',s32floattype);
  270. loadtype('s64real',s64floattype);
  271. loadtype('s80real',s80floattype);
  272. loadtype('s64currency',s64currencytype);
  273. loadtype('boolean',booltype);
  274. loadtype('void_pointer',voidpointertype);
  275. loadtype('char_pointer',charpointertype);
  276. loadtype('widechar_pointer',widecharpointertype);
  277. loadtype('void_farpointer',voidfarpointertype);
  278. loadtype('file',cfiletype);
  279. loadtype('pvmt',pvmttype);
  280. loadtype('vtblarray',vmtarraytype);
  281. loadtype('__vtbl_ptr_type',vmttype);
  282. loadtype('variant',cvarianttype);
  283. loadtype('olevariant',colevarianttype);
  284. loadtype('methodpointer',methodpointertype);
  285. {$ifdef cpu64bit}
  286. uinttype:=u64inttype;
  287. sinttype:=s64inttype;
  288. ptrinttype:=u64inttype;
  289. {$else cpu64bit}
  290. uinttype:=u32inttype;
  291. sinttype:=s32inttype;
  292. ptrinttype:=u32inttype;
  293. {$endif cpu64bit}
  294. current_module:=oldcurrentmodule;
  295. end;
  296. procedure createconstdefs;
  297. {
  298. Create all default definitions for consts for the system unit
  299. }
  300. var
  301. oldregisterdef : boolean;
  302. begin
  303. { create definitions for constants }
  304. oldregisterdef:=registerdef;
  305. registerdef:=false;
  306. cformaltype.setdef(tformaldef.create);
  307. voidtype.setdef(torddef.create(uvoid,0,0));
  308. u8inttype.setdef(torddef.create(u8bit,0,255));
  309. s8inttype.setdef(torddef.create(s8bit,-128,127));
  310. u16inttype.setdef(torddef.create(u16bit,0,65535));
  311. s16inttype.setdef(torddef.create(s16bit,-32768,32767));
  312. u32inttype.setdef(torddef.create(u32bit,0,high(longword)));
  313. s32inttype.setdef(torddef.create(s32bit,low(longint),high(longint)));
  314. u64inttype.setdef(torddef.create(u64bit,low(qword),TConstExprInt(high(qword))));
  315. s64inttype.setdef(torddef.create(s64bit,low(int64),high(int64)));
  316. booltype.setdef(torddef.create(bool8bit,0,1));
  317. cchartype.setdef(torddef.create(uchar,0,255));
  318. cwidechartype.setdef(torddef.create(uwidechar,0,65535));
  319. cshortstringtype.setdef(tstringdef.createshort(255));
  320. { should we give a length to the default long and ansi string definition ?? }
  321. clongstringtype.setdef(tstringdef.createlong(-1));
  322. {$ifdef ansistring_bits}
  323. cansistringtype16.setdef(tstringdef.createansi(-1,sb_16));
  324. cansistringtype32.setdef(tstringdef.createansi(-1,sb_32));
  325. cansistringtype64.setdef(tstringdef.createansi(-1,sb_64));
  326. {$else}
  327. cansistringtype.setdef(tstringdef.createansi(-1));
  328. {$endif}
  329. cwidestringtype.setdef(tstringdef.createwide(-1));
  330. { length=0 for shortstring is open string (needed for readln(string) }
  331. openshortstringtype.setdef(tstringdef.createshort(0));
  332. openchararraytype.setdef(tarraydef.create(0,-1,s32inttype));
  333. tarraydef(openchararraytype.def).setelementtype(cchartype);
  334. {$ifdef x86}
  335. s32floattype.setdef(tfloatdef.create(s32real));
  336. s64floattype.setdef(tfloatdef.create(s64real));
  337. s80floattype.setdef(tfloatdef.create(s80real));
  338. if target_info.system<>system_x86_64_win64 then
  339. s64currencytype.setdef(tfloatdef.create(s64currency))
  340. else
  341. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  342. {$endif x86}
  343. {$ifdef powerpc}
  344. s32floattype.setdef(tfloatdef.create(s32real));
  345. s64floattype.setdef(tfloatdef.create(s64real));
  346. s80floattype.setdef(tfloatdef.create(s80real));
  347. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  348. {$endif powerpc}
  349. {$ifdef POWERPC64}
  350. s32floattype.setdef(tfloatdef.create(s32real));
  351. s64floattype.setdef(tfloatdef.create(s64real));
  352. s80floattype.setdef(tfloatdef.create(s80real));
  353. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  354. {$endif POWERPC64}
  355. {$ifdef sparc}
  356. s32floattype.setdef(tfloatdef.create(s32real));
  357. s64floattype.setdef(tfloatdef.create(s64real));
  358. s80floattype.setdef(tfloatdef.create(s80real));
  359. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  360. {$endif sparc}
  361. {$ifdef m68k}
  362. s32floattype.setdef(tfloatdef.create(s32real));
  363. s64floattype.setdef(tfloatdef.create(s64real));
  364. s80floattype.setdef(tfloatdef.create(s80real));
  365. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  366. {$endif}
  367. {$ifdef arm}
  368. s32floattype.setdef(tfloatdef.create(s32real));
  369. s64floattype.setdef(tfloatdef.create(s64real));
  370. s80floattype.setdef(tfloatdef.create(s80real));
  371. s64currencytype.setdef(torddef.create(scurrency,low(int64),high(int64)));
  372. {$endif arm}
  373. {$ifdef cpu64bit}
  374. uinttype:=u64inttype;
  375. sinttype:=s64inttype;
  376. ptrinttype:=u64inttype;
  377. {$else cpu64bit}
  378. uinttype:=u32inttype;
  379. sinttype:=s32inttype;
  380. ptrinttype:=u32inttype;
  381. {$endif cpu64bit}
  382. { some other definitions }
  383. voidpointertype.setdef(tpointerdef.create(voidtype));
  384. charpointertype.setdef(tpointerdef.create(cchartype));
  385. widecharpointertype.setdef(tpointerdef.create(cwidechartype));
  386. voidfarpointertype.setdef(tpointerdef.createfar(voidtype));
  387. cfiletype.setdef(tfiledef.createuntyped);
  388. cvarianttype.setdef(tvariantdef.create(vt_normalvariant));
  389. colevarianttype.setdef(tvariantdef.create(vt_olevariant));
  390. registerdef:=oldregisterdef;
  391. end;
  392. procedure registernodes;
  393. {
  394. Register all possible nodes in the nodeclass array that
  395. will be used for loading the nodes from a ppu
  396. }
  397. begin
  398. nodeclass[addn]:=caddnode;
  399. nodeclass[muln]:=caddnode;
  400. nodeclass[subn]:=caddnode;
  401. nodeclass[divn]:=cmoddivnode;
  402. nodeclass[symdifn]:=caddnode;
  403. nodeclass[modn]:=cmoddivnode;
  404. nodeclass[assignn]:=cassignmentnode;
  405. nodeclass[loadn]:=cloadnode;
  406. nodeclass[rangen]:=crangenode;
  407. nodeclass[ltn]:=caddnode;
  408. nodeclass[lten]:=caddnode;
  409. nodeclass[gtn]:=caddnode;
  410. nodeclass[gten]:=caddnode;
  411. nodeclass[equaln]:=caddnode;
  412. nodeclass[unequaln]:=caddnode;
  413. nodeclass[inn]:=cinnode;
  414. nodeclass[orn]:=caddnode;
  415. nodeclass[xorn]:=caddnode;
  416. nodeclass[shrn]:=cshlshrnode;
  417. nodeclass[shln]:=cshlshrnode;
  418. nodeclass[slashn]:=caddnode;
  419. nodeclass[andn]:=caddnode;
  420. nodeclass[subscriptn]:=csubscriptnode;
  421. nodeclass[derefn]:=cderefnode;
  422. nodeclass[addrn]:=caddrnode;
  423. nodeclass[ordconstn]:=cordconstnode;
  424. nodeclass[typeconvn]:=ctypeconvnode;
  425. nodeclass[calln]:=ccallnode;
  426. nodeclass[callparan]:=ccallparanode;
  427. nodeclass[realconstn]:=crealconstnode;
  428. nodeclass[unaryminusn]:=cunaryminusnode;
  429. nodeclass[asmn]:=casmnode;
  430. nodeclass[vecn]:=cvecnode;
  431. nodeclass[pointerconstn]:=cpointerconstnode;
  432. nodeclass[stringconstn]:=cstringconstnode;
  433. nodeclass[notn]:=cnotnode;
  434. nodeclass[inlinen]:=cinlinenode;
  435. nodeclass[niln]:=cnilnode;
  436. nodeclass[errorn]:=cerrornode;
  437. nodeclass[typen]:=ctypenode;
  438. nodeclass[setelementn]:=csetelementnode;
  439. nodeclass[setconstn]:=csetconstnode;
  440. nodeclass[blockn]:=cblocknode;
  441. nodeclass[statementn]:=cstatementnode;
  442. nodeclass[ifn]:=cifnode;
  443. nodeclass[breakn]:=cbreaknode;
  444. nodeclass[continuen]:=ccontinuenode;
  445. nodeclass[whilerepeatn]:=cwhilerepeatnode;
  446. nodeclass[forn]:=cfornode;
  447. nodeclass[exitn]:=cexitnode;
  448. nodeclass[withn]:=cwithnode;
  449. nodeclass[casen]:=ccasenode;
  450. nodeclass[labeln]:=clabelnode;
  451. nodeclass[goton]:=cgotonode;
  452. nodeclass[tryexceptn]:=ctryexceptnode;
  453. nodeclass[raisen]:=craisenode;
  454. nodeclass[tryfinallyn]:=ctryfinallynode;
  455. nodeclass[onn]:=connode;
  456. nodeclass[isn]:=cisnode;
  457. nodeclass[asn]:=casnode;
  458. nodeclass[caretn]:=caddnode;
  459. nodeclass[starstarn]:=caddnode;
  460. nodeclass[arrayconstructorn]:=carrayconstructornode;
  461. nodeclass[arrayconstructorrangen]:=carrayconstructorrangenode;
  462. nodeclass[tempcreaten]:=ctempcreatenode;
  463. nodeclass[temprefn]:=ctemprefnode;
  464. nodeclass[tempdeleten]:=ctempdeletenode;
  465. nodeclass[addoptn]:=caddnode;
  466. nodeclass[nothingn]:=cnothingnode;
  467. nodeclass[loadvmtaddrn]:=cloadvmtaddrnode;
  468. nodeclass[guidconstn]:=cguidconstnode;
  469. nodeclass[rttin]:=crttinode;
  470. nodeclass[loadparentfpn]:=cloadparentfpnode;
  471. end;
  472. procedure registertais;
  473. {
  474. Register all possible tais in the taiclass array that
  475. will be used for loading the tais from a ppu
  476. }
  477. begin
  478. aiclass[ait_none]:=nil;
  479. aiclass[ait_align]:=tai_align;
  480. aiclass[ait_section]:=tai_section;
  481. aiclass[ait_comment]:=tai_comment;
  482. aiclass[ait_string]:=tai_string;
  483. aiclass[ait_instruction]:=taicpu;
  484. aiclass[ait_datablock]:=tai_datablock;
  485. aiclass[ait_symbol]:=tai_symbol;
  486. aiclass[ait_symbol_end]:=tai_symbol_end;
  487. aiclass[ait_directive]:=tai_directive;
  488. aiclass[ait_label]:=tai_label;
  489. aiclass[ait_const_64bit]:=tai_const;
  490. aiclass[ait_const_32bit]:=tai_const;
  491. aiclass[ait_const_16bit]:=tai_const;
  492. aiclass[ait_const_8bit]:=tai_const;
  493. aiclass[ait_const_indirect_symbol]:=tai_const;
  494. aiclass[ait_const_rva_symbol]:=tai_const;
  495. aiclass[ait_real_32bit]:=tai_real_32bit;
  496. aiclass[ait_real_64bit]:=tai_real_64bit;
  497. aiclass[ait_real_80bit]:=tai_real_80bit;
  498. aiclass[ait_comp_64bit]:=tai_comp_64bit;
  499. aiclass[ait_stab]:=tai_stab;
  500. aiclass[ait_force_line]:=tai_force_line;
  501. aiclass[ait_function_name]:=tai_function_name;
  502. {$ifdef alpha}
  503. { the follow is for the DEC Alpha }
  504. aiclass[ait_frame]:=tai_frame;
  505. aiclass[ait_ent]:=tai_ent;
  506. {$endif alpha}
  507. {$ifdef m68k}
  508. {$warning FIXME: tai_labeled_instruction doesn't exists}
  509. // aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
  510. {$endif m68k}
  511. {$ifdef ia64}
  512. aiclass[ait_bundle]:=tai_bundle;
  513. aiclass[ait_stop]:=tai_stop;
  514. {$endif ia64}
  515. {$ifdef SPARC}
  516. // aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
  517. {$endif SPARC}
  518. aiclass[ait_cutobject]:=tai_cutobject;
  519. aiclass[ait_regalloc]:=tai_regalloc;
  520. aiclass[ait_tempalloc]:=tai_tempalloc;
  521. aiclass[ait_marker]:=tai_marker;
  522. end;
  523. end.