psystem.pas 22 KB

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