psystem.pas 21 KB

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