psystem.pas 22 KB

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