aasmcnst.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. {
  2. Copyright (c) 2014 by Jonas Maebe, member of the Free Pascal development
  3. team
  4. This unit implements typed constant data elements at the assembler level
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit aasmcnst;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. cclasses,globtype,constexp,
  23. aasmbase,aasmdata,aasmtai,
  24. symconst,symtype,symdef,symsym;
  25. type
  26. { typed const: integer/floating point/string/pointer/... const along with
  27. tdef info; tck_simple_procvar2proc is to indicate that we mean the
  28. procdef corresponding to the procvar rather than the tmethod-like
  29. struct in case of a complex procvar }
  30. ttypedconstkind = (tck_simple, tck_simple_procvar2proc, tck_array, tck_record);
  31. { the type of the element and its def }
  32. tai_abstracttypedconst = class abstract (tai)
  33. private
  34. procedure setdef(def: tdef);
  35. protected
  36. fadetyp: ttypedconstkind;
  37. { the def of this element }
  38. fdef: tdef;
  39. public
  40. constructor create(_adetyp: ttypedconstkind; _def: tdef);
  41. property adetyp: ttypedconstkind read fadetyp;
  42. property def: tdef read fdef write setdef;
  43. end;
  44. { a simple data element; the value is stored as a tai }
  45. tai_simpletypedconst = class(tai_abstracttypedconst)
  46. protected
  47. fval: tai;
  48. public
  49. constructor create(_adetyp: ttypedconstkind; _def: tdef; _val: tai);
  50. property val: tai read fval;
  51. end;
  52. { an aggregate data element (record or array). Values are stored as an
  53. array of tsimpledataelement. }
  54. tai_aggregatetypedconst = class(tai_abstracttypedconst)
  55. public type
  56. { iterator to walk over all individual items in the aggregate }
  57. tadeenumerator = class(tobject)
  58. private
  59. fvalues: tfplist;
  60. fvaluespos: longint;
  61. function getcurrent: tai_abstracttypedconst;
  62. public
  63. constructor create(data: tai_aggregatetypedconst);
  64. function movenext: boolean;
  65. procedure reset;
  66. property current: tai_abstracttypedconst read getcurrent;
  67. end;
  68. protected
  69. fvalues: tfplist;
  70. fisstring: boolean;
  71. { converts the existing data to a single tai_string }
  72. procedure convert_to_string;
  73. procedure add_to_string(strtai: tai_string; othertai: tai);
  74. public
  75. constructor create(_adetyp: ttypedconstkind; _fdef: tdef);
  76. function getenumerator: tadeenumerator;
  77. procedure addvalue(val: tai_abstracttypedconst);
  78. procedure finish;
  79. destructor destroy; override;
  80. end;
  81. { Warning: never directly create a ttai_typedconstbuilder instance,
  82. instead create a cai_typedconstbuilder (this class can be overridden) }
  83. ttai_lowleveltypedconstbuilder = class abstract
  84. protected
  85. { temporary list in which all data is collected }
  86. fasmlist: tasmlist;
  87. { while queueing elements of a compound expression, this is the current
  88. offset in the top-level array/record }
  89. fqueue_offset: asizeint;
  90. { ensure that finalize_asmlist is called only once }
  91. fasmlist_finalized: boolean;
  92. { returns whether def must be handled as an aggregate on the current
  93. platform }
  94. function aggregate_kind(def: tdef): ttypedconstkind; virtual;
  95. { finalize the asmlist: add the necessary symbols etc }
  96. procedure finalize_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: shortint; lab: boolean); virtual;
  97. public
  98. constructor create; virtual;
  99. destructor destroy; override;
  100. { add a simple constant data element (p) to the typed constant.
  101. def is the type of the added value }
  102. procedure emit_tai(p: tai; def: tdef); virtual;
  103. { same as above, for a special case: when the def is a procvardef and we
  104. want to use it explicitly as a procdef (i.e., not as a record with a
  105. code and data pointer in case of a complex procvardef) }
  106. procedure emit_tai_procvar2procdef(p: tai; pvdef: tprocvardef); virtual;
  107. { begin a potential aggregate type. Must be called for any type
  108. that consists of multiple tai constant data entries, or that
  109. represents an aggregate at the Pascal level (a record, a non-dynamic
  110. array, ... }
  111. procedure maybe_begin_aggregate(def: tdef); virtual;
  112. { end a potential aggregate type. Must be paired with every
  113. maybe_begin_aggregate }
  114. procedure maybe_end_aggregate(def: tdef); virtual;
  115. { similar as above, but in case
  116. a) it's definitely a record
  117. b) the def of the record should be automatically constructed based on
  118. the types of the emitted fields
  119. }
  120. procedure begin_anonymous_record; virtual;
  121. function end_anonymous_record(const optionalname: string; packrecords: shortint): trecorddef; virtual;
  122. { The next group of routines are for constructing complex expressions.
  123. While parsing a typed constant these operators are encountered from
  124. outer to inner, so that is also the order in which they should be
  125. added to the queue. Only one queue can be active at a time. }
  126. { Init the queue. Gives an internalerror if a queue was already active }
  127. procedure queue_init(todef: tdef); virtual;
  128. { queue an array/string indexing operation (performs all range checking,
  129. so it doesn't have to be duplicated in all descendents). }
  130. procedure queue_vecn(def: tdef; const index: tconstexprint); virtual;
  131. { queue a subscripting operation }
  132. procedure queue_subscriptn(def: tabstractrecorddef; vs: tfieldvarsym); virtual;
  133. { queue a type conversion operation }
  134. procedure queue_typeconvn(fromdef, todef: tdef); virtual;
  135. { queue an address taking operation }
  136. procedure queue_addrn(fromdef, todef: tdef); virtual;
  137. { finalise the queue (so a new one can be created) and flush the
  138. previously queued operations, applying them in reverse order on a...}
  139. { ... procdef }
  140. procedure queue_emit_proc(pd: tprocdef); virtual;
  141. { ... staticvarsym }
  142. procedure queue_emit_staticvar(vs: tstaticvarsym); virtual;
  143. { ... labelsym }
  144. procedure queue_emit_label(l: tlabelsym); virtual;
  145. { ... constsym }
  146. procedure queue_emit_const(cs: tconstsym); virtual;
  147. { ... asmsym/asmlabel }
  148. procedure queue_emit_asmsym(sym: tasmsymbol; def: tdef); virtual;
  149. { finalize the internal asmlist (if necessary) and return it.
  150. This asmlist will be freed when the builder is destroyed, so add its
  151. contents to another list first. This property should only be accessed
  152. once all data has been added. }
  153. function get_final_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: longint; lab: boolean): tasmlist;
  154. { returns the offset of the string data relative to ansi/unicode/widestring
  155. constant labels. On most platforms, this is 0 (with the header at a
  156. negative offset), but on some platforms such negative offsets are not
  157. supported this is equal to the header size }
  158. class function get_string_symofs(typ: tstringtype; winlikewidestring: boolean): pint; virtual;
  159. protected
  160. { this one always return the actual offset, called by the above (and
  161. overridden versions) }
  162. class function get_string_header_size(typ: tstringtype; winlikewidestring: boolean): pint;
  163. end;
  164. ttai_lowleveltypedconstbuilderclass = class of ttai_lowleveltypedconstbuilder;
  165. var
  166. ctai_typedconstbuilder: ttai_lowleveltypedconstbuilderclass;
  167. implementation
  168. uses
  169. verbose,globals,systems,widestr,
  170. symtable,defutil;
  171. {****************************************************************************
  172. tai_abstracttypedconst
  173. ****************************************************************************}
  174. procedure tai_abstracttypedconst.setdef(def: tdef);
  175. begin
  176. { should not be changed, rewrite the calling code if this happens }
  177. if assigned(fdef) then
  178. Internalerror(2014080203);
  179. fdef:=def;
  180. end;
  181. constructor tai_abstracttypedconst.create(_adetyp: ttypedconstkind; _def: tdef);
  182. begin
  183. inherited create;
  184. typ:=ait_typedconst;
  185. fadetyp:=_adetyp;
  186. fdef:=_def;
  187. end;
  188. {****************************************************************************
  189. tai_simpletypedconst
  190. ****************************************************************************}
  191. constructor tai_simpletypedconst.create(_adetyp: ttypedconstkind; _def: tdef; _val: tai);
  192. begin
  193. inherited create(_adetyp,_def);
  194. fval:=_val;
  195. end;
  196. {****************************************************************************
  197. tai_aggregatetypedconst.tadeenumerator
  198. ****************************************************************************}
  199. constructor tai_aggregatetypedconst.tadeenumerator.create(data: tai_aggregatetypedconst);
  200. begin
  201. fvalues:=data.fvalues;
  202. fvaluespos:=-1;
  203. end;
  204. function tai_aggregatetypedconst.tadeenumerator.getcurrent: tai_abstracttypedconst;
  205. begin
  206. result:=tai_abstracttypedconst(fvalues[fvaluespos]);
  207. end;
  208. function tai_aggregatetypedconst.tadeenumerator.movenext: boolean;
  209. begin
  210. if fvaluespos<pred(fvalues.count) then
  211. begin
  212. inc(fvaluespos);
  213. result:=true
  214. end
  215. else
  216. result:=false;
  217. end;
  218. procedure tai_aggregatetypedconst.tadeenumerator.reset;
  219. begin
  220. fvaluespos:=0
  221. end;
  222. {****************************************************************************
  223. tai_aggregatetypedconst
  224. ****************************************************************************}
  225. procedure tai_aggregatetypedconst.convert_to_string;
  226. var
  227. ai: tai_abstracttypedconst;
  228. newstr: tai_string;
  229. begin
  230. newstr:=tai_string.Create('');
  231. for ai in self do
  232. begin
  233. if ai.adetyp<>tck_simple then
  234. internalerror(2014070103);
  235. add_to_string(newstr,tai_simpletypedconst(ai).val);
  236. ai.free;
  237. end;
  238. fvalues.count:=0;
  239. { the "nil" def will be replaced with an array def of the appropriate
  240. size once we're finished adding data, so we don't create intermediate
  241. arraydefs all the time }
  242. fvalues.add(tai_simpletypedconst.create(tck_simple,nil,newstr));
  243. end;
  244. procedure tai_aggregatetypedconst.add_to_string(strtai: tai_string; othertai: tai);
  245. begin
  246. case othertai.typ of
  247. ait_string:
  248. begin
  249. strtai.str:=reallocmem(strtai.str,strtai.len+tai_string(othertai).len+1);
  250. { also copy null terminator }
  251. move(tai_string(othertai).str[0],strtai.str[strtai.len],tai_string(othertai).len+1);
  252. { the null terminator is not part of the string data }
  253. strtai.len:=strtai.len+tai_string(othertai).len;
  254. end;
  255. ait_const:
  256. begin
  257. if tai_const(othertai).size<>1 then
  258. internalerror(2014070101);
  259. strtai.str:=reallocmem(strtai.str,strtai.len+1);
  260. strtai.str[strtai.len]:=ansichar(tai_const(othertai).value);
  261. strtai.str[strtai.len+1]:=#0;
  262. inc(strtai.len);
  263. end;
  264. else
  265. internalerror(2014070102);
  266. end;
  267. end;
  268. constructor tai_aggregatetypedconst.create(_adetyp: ttypedconstkind; _fdef: tdef);
  269. begin
  270. inherited;
  271. fisstring:=false;
  272. fvalues:=tfplist.create;
  273. end;
  274. function tai_aggregatetypedconst.getenumerator: tadeenumerator;
  275. begin
  276. result:=tadeenumerator.create(self);
  277. end;
  278. procedure tai_aggregatetypedconst.addvalue(val: tai_abstracttypedconst);
  279. begin
  280. { merge string constants and ordinal constants added in an array of
  281. char, to unify the length and the string data }
  282. if fisstring or
  283. ((val.adetyp=tck_simple) and
  284. (tai_simpletypedconst(val).val.typ=ait_string)) then
  285. begin
  286. if not fisstring and
  287. (fvalues.count>0) then
  288. convert_to_string;
  289. fisstring:=true;
  290. case fvalues.count of
  291. 0: fvalues.add(val);
  292. 1:
  293. begin
  294. add_to_string(tai_string(tai_simpletypedconst(fvalues[0]).val),tai_simpletypedconst(val).val);
  295. val.free
  296. end
  297. else
  298. internalerror(2014070104);
  299. end;
  300. end
  301. else
  302. fvalues.add(val);
  303. end;
  304. procedure tai_aggregatetypedconst.finish;
  305. begin
  306. if fisstring then
  307. begin
  308. { set the def: an array of char with the same length as the string
  309. data }
  310. if fvalues.count<>1 then
  311. internalerror(2014070105);
  312. tai_simpletypedconst(fvalues[0]).fdef:=
  313. getarraydef(cansichartype,
  314. tai_string(tai_simpletypedconst(fvalues[0]).val).len);
  315. end;
  316. end;
  317. destructor tai_aggregatetypedconst.destroy;
  318. begin
  319. fvalues.free;
  320. inherited destroy;
  321. end;
  322. {*****************************************************************************
  323. ttai_lowleveltypedconstbuilder
  324. *****************************************************************************}
  325. function ttai_lowleveltypedconstbuilder.aggregate_kind(def: tdef): ttypedconstkind;
  326. begin
  327. if (def.typ in [recorddef,filedef,variantdef]) or
  328. is_object(def) or
  329. ((def.typ=procvardef) and
  330. not tprocvardef(def).is_addressonly) then
  331. result:=tck_record
  332. else if ((def.typ=arraydef) and
  333. not is_dynamic_array(def)) or
  334. ((def.typ=setdef) and
  335. not is_smallset(def)) or
  336. is_shortstring(def) then
  337. result:=tck_array
  338. else
  339. result:=tck_simple;
  340. end;
  341. procedure ttai_lowleveltypedconstbuilder.finalize_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: shortint; lab: boolean);
  342. var
  343. prelist: tasmlist;
  344. begin
  345. prelist:=tasmlist.create_without_marker;
  346. maybe_new_object_file(prelist);
  347. { only now add items based on the symbolname, because it may be
  348. modified by the "section" specifier in case of a typed constant }
  349. if section<>sec_none then
  350. new_section(prelist,section,secname,const_align(alignment));
  351. if not lab then
  352. if sym.bind=AB_GLOBAL then
  353. prelist.concat(tai_symbol.Create_Global(sym,0))
  354. else
  355. prelist.concat(tai_symbol.Create(sym,0))
  356. else
  357. prelist.concat(tai_label.Create(tasmlabel(sym)));
  358. { insert the symbol information before the data }
  359. fasmlist.insertlist(prelist);
  360. { end of the symbol }
  361. fasmlist.concat(tai_symbol_end.Createname(sym.name));
  362. { free the temporary list }
  363. prelist.free;
  364. end;
  365. function ttai_lowleveltypedconstbuilder.get_final_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: longint; lab: boolean): tasmlist;
  366. begin
  367. if not fasmlist_finalized then
  368. begin
  369. finalize_asmlist(sym,def,section,secname,alignment,lab);
  370. fasmlist_finalized:=true;
  371. end;
  372. result:=fasmlist;
  373. end;
  374. class function ttai_lowleveltypedconstbuilder.get_string_symofs(typ: tstringtype; winlikewidestring: boolean): pint;
  375. begin
  376. { darwin's linker does not support negative offsets }
  377. if not(target_info.system in systems_darwin) then
  378. result:=0
  379. else
  380. result:=get_string_header_size(typ,winlikewidestring);
  381. end;
  382. class function ttai_lowleveltypedconstbuilder.get_string_header_size(typ: tstringtype; winlikewidestring: boolean): pint;
  383. const
  384. ansistring_header_size =
  385. { encoding }
  386. 2 +
  387. { elesize }
  388. 2 +
  389. {$ifdef cpu64bitaddr}
  390. { alignment }
  391. 4 +
  392. {$endif cpu64bitaddr}
  393. { reference count }
  394. sizeof(pint) +
  395. { length }
  396. sizeof(pint);
  397. unicodestring_header_size = ansistring_header_size;
  398. begin
  399. case typ of
  400. st_ansistring:
  401. result:=ansistring_header_size;
  402. st_unicodestring:
  403. result:=unicodestring_header_size;
  404. st_widestring:
  405. if winlikewidestring then
  406. result:=0
  407. else
  408. result:=unicodestring_header_size;
  409. else
  410. result:=0;
  411. end;
  412. end;
  413. constructor ttai_lowleveltypedconstbuilder.create;
  414. begin
  415. inherited create;
  416. fasmlist:=tasmlist.create_without_marker;
  417. { queue is empty }
  418. fqueue_offset:=low(fqueue_offset);
  419. end;
  420. destructor ttai_lowleveltypedconstbuilder.destroy;
  421. begin
  422. { the queue should have been flushed if it was used }
  423. if fqueue_offset<>low(fqueue_offset) then
  424. internalerror(2014062901);
  425. fasmlist.free;
  426. inherited destroy;
  427. end;
  428. procedure ttai_lowleveltypedconstbuilder.emit_tai(p: tai; def: tdef);
  429. begin
  430. { by default, we ignore the def info since we don't care about it at the
  431. the assembler level }
  432. fasmlist.concat(p);
  433. end;
  434. procedure ttai_lowleveltypedconstbuilder.emit_tai_procvar2procdef(p: tai; pvdef: tprocvardef);
  435. begin
  436. { nothing special by default, since we don't care about the type }
  437. emit_tai(p,pvdef);
  438. end;
  439. procedure ttai_lowleveltypedconstbuilder.maybe_begin_aggregate(def: tdef);
  440. begin
  441. { do nothing }
  442. end;
  443. procedure ttai_lowleveltypedconstbuilder.maybe_end_aggregate(def: tdef);
  444. begin
  445. { do nothing }
  446. end;
  447. procedure ttai_lowleveltypedconstbuilder.begin_anonymous_record;
  448. begin
  449. { do nothing }
  450. end;
  451. function ttai_lowleveltypedconstbuilder.end_anonymous_record(const optionalname: string; packrecords: shortint): trecorddef;
  452. begin
  453. { do nothing }
  454. result:=nil;
  455. end;
  456. procedure ttai_lowleveltypedconstbuilder.queue_init(todef: tdef);
  457. begin
  458. { nested call to init? }
  459. if fqueue_offset<>low(fqueue_offset) then
  460. internalerror(2014062101);
  461. fqueue_offset:=0;
  462. end;
  463. procedure ttai_lowleveltypedconstbuilder.queue_vecn(def: tdef; const index: tconstexprint);
  464. var
  465. elelen,
  466. vecbase: asizeint;
  467. v: tconstexprint;
  468. begin
  469. elelen:=1;
  470. vecbase:=0;
  471. case def.typ of
  472. stringdef :
  473. ;
  474. arraydef :
  475. begin
  476. if not is_packed_array(def) then
  477. begin
  478. elelen:=tarraydef(def).elesize;
  479. vecbase:=tarraydef(def).lowrange;
  480. end
  481. else
  482. Message(parser_e_packed_dynamic_open_array);
  483. end;
  484. else
  485. Message(parser_e_illegal_expression);
  486. end;
  487. { Prevent overflow }
  488. v:=index-vecbase;
  489. if (v<int64(low(fqueue_offset))) or (v>int64(high(fqueue_offset))) then
  490. message3(type_e_range_check_error_bounds,tostr(v),tostr(low(fqueue_offset)),tostr(high(fqueue_offset)));
  491. if high(fqueue_offset)-fqueue_offset div elelen>v then
  492. inc(fqueue_offset,elelen*v.svalue)
  493. else
  494. message3(type_e_range_check_error_bounds,tostr(index),tostr(vecbase),tostr(high(fqueue_offset)-fqueue_offset div elelen+vecbase))
  495. end;
  496. procedure ttai_lowleveltypedconstbuilder.queue_subscriptn(def: tabstractrecorddef; vs: tfieldvarsym);
  497. begin
  498. inc(fqueue_offset,vs.fieldoffset);
  499. end;
  500. procedure ttai_lowleveltypedconstbuilder.queue_typeconvn(fromdef, todef: tdef);
  501. begin
  502. { do nothing }
  503. end;
  504. procedure ttai_lowleveltypedconstbuilder.queue_addrn(fromdef, todef: tdef);
  505. begin
  506. { do nothing }
  507. end;
  508. procedure ttai_lowleveltypedconstbuilder.queue_emit_proc(pd: tprocdef);
  509. begin
  510. emit_tai(Tai_const.Createname(pd.mangledname,fqueue_offset),pd);
  511. fqueue_offset:=low(fqueue_offset);
  512. end;
  513. procedure ttai_lowleveltypedconstbuilder.queue_emit_staticvar(vs: tstaticvarsym);
  514. begin
  515. { getpointerdef because we are emitting a pointer to the staticvarsym
  516. data, not the data itself }
  517. emit_tai(Tai_const.Createname(vs.mangledname,fqueue_offset),getpointerdef(vs.vardef));
  518. fqueue_offset:=low(fqueue_offset);
  519. end;
  520. procedure ttai_lowleveltypedconstbuilder.queue_emit_label(l: tlabelsym);
  521. begin
  522. emit_tai(Tai_const.Createname(l.mangledname,fqueue_offset),voidcodepointertype);
  523. fqueue_offset:=low(fqueue_offset);
  524. end;
  525. procedure ttai_lowleveltypedconstbuilder.queue_emit_const(cs: tconstsym);
  526. begin
  527. if cs.consttyp<>constresourcestring then
  528. internalerror(2014062102);
  529. if fqueue_offset<>0 then
  530. internalerror(2014062103);
  531. { warning: update if/when the type of resource strings changes }
  532. emit_tai(Tai_const.Createname(make_mangledname('RESSTR',cs.owner,cs.name),AT_DATA,sizeof(pint)),cansistringtype);
  533. fqueue_offset:=low(fqueue_offset);
  534. end;
  535. procedure ttai_lowleveltypedconstbuilder.queue_emit_asmsym(sym: tasmsymbol; def: tdef);
  536. begin
  537. { getpointerdef, because "sym" represents the address of whatever the
  538. data is }
  539. def:=getpointerdef(def);
  540. emit_tai(Tai_const.Create_sym_offset(sym,fqueue_offset),def);
  541. fqueue_offset:=low(fqueue_offset);
  542. end;
  543. begin
  544. ctai_typedconstbuilder:=ttai_lowleveltypedconstbuilder;
  545. end.