psystem.pas 23 KB

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