nllvmtcon.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. {
  2. Copyright (c) 2014 by Jonas Maebe
  3. Generates code for typed constant declarations for the LLVM target
  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 nllvmtcon;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. cclasses,constexp,globtype,
  22. aasmbase,aasmtai,aasmcnst,aasmllvm,
  23. symconst,symtype,symdef,symsym,
  24. ngtcon;
  25. type
  26. tllvmaggregateinformation = class(taggregateinformation)
  27. private
  28. faggai: tai_aggregatetypedconst;
  29. fanonrecalignpos: longint;
  30. public
  31. constructor create(_def: tdef; _typ: ttypedconstkind); override;
  32. function prepare_next_field(nextfielddef: tdef): asizeint; override;
  33. property aggai: tai_aggregatetypedconst read faggai write faggai;
  34. property anonrecalignpos: longint read fanonrecalignpos write fanonrecalignpos;
  35. end;
  36. tllvmtai_typedconstbuilder = class(ttai_typedconstbuilder)
  37. protected type
  38. public
  39. { set the default value for caggregateinformation (= tllvmaggregateinformation) }
  40. class constructor classcreate;
  41. protected
  42. fqueued_def: tdef;
  43. fqueued_tai,
  44. flast_added_tai: tai;
  45. fqueued_tai_opidx: longint;
  46. procedure finalize_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: shortint; const options: ttcasmlistoptions); override;
  47. { outerai: the ai that should become fqueued_tai in case it's still nil,
  48. or that should be filled in the fqueued_tai_opidx of the current
  49. fqueued_tai if it's not nil
  50. innerai: the innermost ai (possibly an operand of outerai) in which
  51. newindex indicates which operand is empty and can be filled with the
  52. next queued tai }
  53. procedure update_queued_tai(resdef: tdef; outerai, innerai: tai; newindex: longint);
  54. function wrap_with_type(p: tai; def: tdef): tai;
  55. procedure do_emit_tai(p: tai; def: tdef); override;
  56. procedure mark_anon_aggregate_alignment; override;
  57. procedure insert_marked_aggregate_alignment(def: tdef); override;
  58. procedure maybe_emit_tail_padding(def: tdef); override;
  59. procedure begin_aggregate_internal(def: tdef; anonymous: boolean); override;
  60. procedure end_aggregate_internal(def: tdef; anonymous: boolean); override;
  61. function get_internal_data_section_start_label: tasmlabel; override;
  62. function get_internal_data_section_internal_label: tasmlabel; override;
  63. procedure do_emit_extended_in_aggregate(p: tai);
  64. public
  65. destructor destroy; override;
  66. procedure emit_tai(p: tai; def: tdef); override;
  67. procedure emit_tai_procvar2procdef(p: tai; pvdef: tprocvardef); override;
  68. procedure emit_string_offset(const ll: tasmlabofs; const strlength: longint; const st: tstringtype; const winlikewidestring: boolean; const charptrdef: tdef); override;
  69. procedure queue_init(todef: tdef); override;
  70. procedure queue_vecn(def: tdef; const index: tconstexprint); override;
  71. procedure queue_subscriptn(def: tabstractrecorddef; vs: tfieldvarsym); override;
  72. procedure queue_typeconvn(fromdef, todef: tdef); override;
  73. procedure queue_emit_staticvar(vs: tstaticvarsym); override;
  74. procedure queue_emit_asmsym(sym: tasmsymbol; def: tdef); override;
  75. procedure queue_emit_ordconst(value: int64; def: tdef); override;
  76. class function get_string_symofs(typ: tstringtype; winlikewidestring: boolean): pint; override;
  77. end;
  78. implementation
  79. uses
  80. verbose,systems,
  81. aasmdata,
  82. cpubase,cpuinfo,llvmbase,
  83. symbase,symtable,llvmdef,defutil;
  84. { tllvmaggregateinformation }
  85. constructor tllvmaggregateinformation.create(_def: tdef; _typ: ttypedconstkind);
  86. begin
  87. inherited;
  88. fanonrecalignpos:=-1;
  89. end;
  90. function tllvmaggregateinformation.prepare_next_field(nextfielddef: tdef): asizeint;
  91. begin
  92. result:=inherited;
  93. { in case of C/ABI alignment, the padding gets added by LLVM }
  94. if tabstractrecordsymtable(tabstractrecorddef(def).symtable).usefieldalignment=C_alignment then
  95. result:=0;
  96. end;
  97. class constructor tllvmtai_typedconstbuilder.classcreate;
  98. begin
  99. caggregateinformation:=tllvmaggregateinformation;
  100. end;
  101. procedure tllvmtai_typedconstbuilder.finalize_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: shortint; const options: ttcasmlistoptions);
  102. var
  103. newasmlist: tasmlist;
  104. begin
  105. { todo }
  106. if section = sec_user then
  107. internalerror(2014052904);
  108. newasmlist:=tasmlist.create;
  109. { llvm declaration with as initialisation data all the elements from the
  110. original asmlist }
  111. newasmlist.concat(taillvmdecl.create(sym,def,fasmlist,section,alignment));
  112. fasmlist:=newasmlist;
  113. end;
  114. procedure tllvmtai_typedconstbuilder.update_queued_tai(resdef: tdef; outerai, innerai: tai; newindex: longint);
  115. begin
  116. { the outer tai must always be a typed constant (possibly a wrapper
  117. around a taillvm or so), in order for result type information to be
  118. available }
  119. if outerai.typ<>ait_typedconst then
  120. internalerror(2014060401);
  121. { is the result of the outermost expression different from the type of
  122. this typed const? -> insert type conversion }
  123. if not assigned(fqueued_tai) and
  124. (resdef<>fqueued_def) and
  125. (llvmencodetypename(resdef)<>llvmencodetypename(fqueued_def)) then
  126. queue_typeconvn(resdef,fqueued_def);
  127. if assigned(fqueued_tai) then
  128. begin
  129. taillvm(flast_added_tai).loadtai(fqueued_tai_opidx,outerai);
  130. { already flushed? }
  131. if fqueued_tai_opidx=-1 then
  132. internalerror(2014062201);
  133. end
  134. else
  135. begin
  136. fqueued_tai:=outerai;
  137. fqueued_def:=resdef;
  138. end;
  139. fqueued_tai_opidx:=newindex;
  140. flast_added_tai:=innerai;
  141. end;
  142. function tllvmtai_typedconstbuilder.wrap_with_type(p: tai; def: tdef): tai;
  143. begin
  144. result:=tai_simpletypedconst.create(tck_simple,def,p);
  145. end;
  146. destructor tllvmtai_typedconstbuilder.destroy;
  147. begin
  148. inherited destroy;
  149. end;
  150. procedure tllvmtai_typedconstbuilder.emit_tai(p: tai; def: tdef);
  151. var
  152. arrdef: tdef;
  153. begin
  154. { inside an aggregate, an 80 bit floating point number must be
  155. emitted as an array of 10 bytes to prevent ABI alignment and
  156. padding to 16 bytes }
  157. if (def.typ=floatdef) and
  158. (tfloatdef(def).floattype=s80real) and
  159. assigned(curagginfo) then
  160. do_emit_extended_in_aggregate(p)
  161. else
  162. inherited;
  163. end;
  164. procedure tllvmtai_typedconstbuilder.do_emit_tai(p: tai; def: tdef);
  165. var
  166. ai: tai;
  167. stc: tai_abstracttypedconst;
  168. kind: ttypedconstkind;
  169. info: tllvmaggregateinformation;
  170. begin
  171. if queue_is_active then
  172. begin
  173. kind:=tck_simple;
  174. { finalise the queued expression }
  175. ai:=tai_simpletypedconst.create(kind,def,p);
  176. { set the new index to -1, so we internalerror should we try to
  177. add anything further }
  178. update_queued_tai(def,ai,ai,-1);
  179. { and emit it }
  180. stc:=tai_abstracttypedconst(fqueued_tai);
  181. def:=fqueued_def;
  182. { ensure we don't try to emit this one again }
  183. fqueued_tai:=nil;
  184. end
  185. else
  186. stc:=tai_simpletypedconst.create(tck_simple,def,p);
  187. info:=tllvmaggregateinformation(curagginfo);
  188. { these elements can be aggregates themselves, e.g. a shortstring can
  189. be emitted as a series of bytes and string data arrays }
  190. kind:=aggregate_kind(def);
  191. if (kind<>tck_simple) then
  192. begin
  193. if not assigned(info) or
  194. (info.aggai.adetyp<>kind) then
  195. internalerror(2014052906);
  196. end;
  197. if assigned(info) then
  198. info.aggai.addvalue(stc)
  199. else
  200. inherited do_emit_tai(stc,def);
  201. end;
  202. procedure tllvmtai_typedconstbuilder.mark_anon_aggregate_alignment;
  203. var
  204. info: tllvmaggregateinformation;
  205. begin
  206. info:=tllvmaggregateinformation(curagginfo);
  207. info.anonrecalignpos:=info.aggai.valuecount;
  208. end;
  209. procedure tllvmtai_typedconstbuilder.insert_marked_aggregate_alignment(def: tdef);
  210. var
  211. info: tllvmaggregateinformation;
  212. fillbytes: asizeint;
  213. begin
  214. info:=tllvmaggregateinformation(curagginfo);
  215. if info.anonrecalignpos=-1 then
  216. internalerror(2014091501);
  217. fillbytes:=info.prepare_next_field(def);
  218. while fillbytes>0 do
  219. begin
  220. info.aggai.insertvaluebeforepos(tai_simpletypedconst.create(tck_simple,u8inttype,tai_const.create_8bit(0)),info.anonrecalignpos);
  221. dec(fillbytes);
  222. end;
  223. end;
  224. procedure tllvmtai_typedconstbuilder.maybe_emit_tail_padding(def: tdef);
  225. begin
  226. { in case of C/ABI alignment, the padding gets added by LLVM }
  227. if (is_record(def) or
  228. is_object(def)) and
  229. (tabstractrecordsymtable(tabstractrecorddef(def).symtable).usefieldalignment=C_alignment) then
  230. exit;
  231. inherited;
  232. end;
  233. procedure tllvmtai_typedconstbuilder.emit_tai_procvar2procdef(p: tai; pvdef: tprocvardef);
  234. begin
  235. if not pvdef.is_addressonly then
  236. pvdef:=cprocvardef.getreusableprocaddr(pvdef);
  237. emit_tai(p,pvdef);
  238. end;
  239. procedure tllvmtai_typedconstbuilder.emit_string_offset(const ll: tasmlabofs; const strlength: longint; const st: tstringtype; const winlikewidestring: boolean; const charptrdef: tdef);
  240. var
  241. srsym : tsym;
  242. srsymtable: tsymtable;
  243. strrecdef : trecorddef;
  244. offset: pint;
  245. field: tfieldvarsym;
  246. dataptrdef: tdef;
  247. begin
  248. { nil pointer? }
  249. if not assigned(ll.lab) then
  250. begin
  251. if ll.ofs<>0 then
  252. internalerror(2015030701);
  253. inherited;
  254. exit;
  255. end;
  256. { if the returned offset is <> 0, then the string data
  257. starts at that offset -> translate to a field for the
  258. high level code generator }
  259. if ll.ofs<>0 then
  260. begin
  261. { get the recorddef for this string constant }
  262. if not searchsym_type(ctai_typedconstbuilder.get_dynstring_rec_name(st,winlikewidestring,strlength),srsym,srsymtable) then
  263. internalerror(2014080406);
  264. strrecdef:=trecorddef(ttypesym(srsym).typedef);
  265. { offset in the record of the the string data }
  266. offset:=ctai_typedconstbuilder.get_string_symofs(st,winlikewidestring);
  267. { field corresponding to this offset }
  268. field:=trecordsymtable(strrecdef.symtable).findfieldbyoffset(offset);
  269. { pointerdef to the string data array }
  270. dataptrdef:=cpointerdef.getreusable(field.vardef);
  271. queue_init(charptrdef);
  272. queue_addrn(dataptrdef,charptrdef);
  273. queue_subscriptn(strrecdef,field);
  274. queue_emit_asmsym(ll.lab,strrecdef);
  275. end
  276. else
  277. { since llvm doesn't support labels in the middle of structs, this
  278. offset should never be 0 }
  279. internalerror(2014080506);
  280. end;
  281. procedure tllvmtai_typedconstbuilder.begin_aggregate_internal(def: tdef; anonymous: boolean);
  282. var
  283. agg: tai_aggregatetypedconst;
  284. tck: ttypedconstkind;
  285. curagg: tllvmaggregateinformation;
  286. begin
  287. tck:=aggregate_kind(def);
  288. if tck<>tck_simple then
  289. begin
  290. { create new typed const aggregate }
  291. agg:=tai_aggregatetypedconst.create(tck,def);
  292. { either add to the current typed const aggregate (if nested), or
  293. emit to the asmlist (if top level) }
  294. curagg:=tllvmaggregateinformation(curagginfo);
  295. if assigned(curagg) then
  296. curagg.aggai.addvalue(agg)
  297. else
  298. fasmlist.concat(agg);
  299. { create aggregate information for this new aggregate }
  300. inherited;
  301. { set new current typed const aggregate }
  302. tllvmaggregateinformation(curagginfo).aggai:=agg
  303. end
  304. else
  305. inherited;
  306. end;
  307. procedure tllvmtai_typedconstbuilder.end_aggregate_internal(def: tdef; anonymous: boolean);
  308. var
  309. info: tllvmaggregateinformation;
  310. begin
  311. if aggregate_kind(def)<>tck_simple then
  312. begin
  313. info:=tllvmaggregateinformation(curagginfo);
  314. if not assigned(info) then
  315. internalerror(2014060101);
  316. info.aggai.finish;
  317. end;
  318. inherited;
  319. end;
  320. function tllvmtai_typedconstbuilder.get_internal_data_section_start_label: tasmlabel;
  321. begin
  322. { let llvm take care of everything by creating internal nameless
  323. constants }
  324. current_asmdata.getlocaldatalabel(result);
  325. end;
  326. function tllvmtai_typedconstbuilder.get_internal_data_section_internal_label: tasmlabel;
  327. begin
  328. current_asmdata.getlocaldatalabel(result);
  329. end;
  330. procedure tllvmtai_typedconstbuilder.do_emit_extended_in_aggregate(p: tai);
  331. type
  332. p80realval =^t80realval;
  333. t80realval = packed record
  334. case byte of
  335. 0: (v: ts80real);
  336. 1: (a: array[0..9] of byte);
  337. end;
  338. var
  339. arrdef: tdef;
  340. i: longint;
  341. realval: p80realval;
  342. begin
  343. { emit as an array of 10 bytes }
  344. arrdef:=carraydef.getreusable(u8inttype,10);
  345. maybe_begin_aggregate(arrdef);
  346. if (p.typ<>ait_realconst) then
  347. internalerror(2015062401);
  348. realval:=p80realval(@tai_realconst(p).value.s80val);
  349. if target_info.endian=source_info.endian then
  350. for i:=0 to 9 do
  351. emit_tai(tai_const.Create_8bit(realval^.a[i]),u8inttype)
  352. else
  353. for i:=9 downto 0 do
  354. emit_tai(tai_const.Create_8bit(realval^.a[i]),u8inttype);
  355. maybe_end_aggregate(arrdef);
  356. { free the original constant, since we didn't emit it }
  357. p.free;
  358. end;
  359. procedure tllvmtai_typedconstbuilder.queue_init(todef: tdef);
  360. begin
  361. inherited;
  362. fqueued_tai:=nil;
  363. flast_added_tai:=nil;
  364. fqueued_tai_opidx:=-1;
  365. fqueued_def:=todef;
  366. end;
  367. procedure tllvmtai_typedconstbuilder.queue_vecn(def: tdef; const index: tconstexprint);
  368. var
  369. ai: taillvm;
  370. aityped: tai;
  371. eledef: tdef;
  372. begin
  373. { update range checking info }
  374. inherited;
  375. ai:=taillvm.getelementptr_reg_tai_size_const(NR_NO,nil,ptrsinttype,index.svalue,true);
  376. case def.typ of
  377. arraydef:
  378. eledef:=tarraydef(def).elementdef;
  379. stringdef:
  380. case tstringdef(def).stringtype of
  381. st_shortstring,
  382. st_longstring,
  383. st_ansistring:
  384. eledef:=cansichartype;
  385. st_widestring,
  386. st_unicodestring:
  387. eledef:=cwidechartype;
  388. else
  389. internalerror(2014062202);
  390. end;
  391. else
  392. internalerror(2014062203);
  393. end;
  394. aityped:=wrap_with_type(ai,cpointerdef.getreusable(eledef));
  395. update_queued_tai(cpointerdef.getreusable(eledef),aityped,ai,1);
  396. end;
  397. procedure tllvmtai_typedconstbuilder.queue_subscriptn(def: tabstractrecorddef; vs: tfieldvarsym);
  398. var
  399. getllvmfieldaddr,
  400. getpascalfieldaddr,
  401. getllvmfieldaddrtyped: tai;
  402. llvmfielddef: tdef;
  403. begin
  404. { update range checking info }
  405. inherited;
  406. llvmfielddef:=tabstractrecordsymtable(def.symtable).llvmst[vs].def;
  407. { get the address of the llvm-struct field that corresponds to this
  408. Pascal field }
  409. getllvmfieldaddr:=taillvm.getelementptr_reg_tai_size_const(NR_NO,nil,s32inttype,vs.llvmfieldnr,true);
  410. { getelementptr doesn't contain its own resultdef, so encode it via a
  411. tai_simpletypedconst tai }
  412. getllvmfieldaddrtyped:=wrap_with_type(getllvmfieldaddr,cpointerdef.getreusable(llvmfielddef));
  413. { if it doesn't match the requested field exactly (variant record),
  414. fixup the result }
  415. getpascalfieldaddr:=getllvmfieldaddrtyped;
  416. if (vs.offsetfromllvmfield<>0) or
  417. (llvmfielddef<>vs.vardef) then
  418. begin
  419. { offset of real field relative to llvm-struct field <> 0? }
  420. if vs.offsetfromllvmfield<>0 then
  421. begin
  422. { convert to a pointer to a 1-sized element }
  423. if llvmfielddef.size<>1 then
  424. begin
  425. getpascalfieldaddr:=taillvm.op_reg_tai_size(la_bitcast,NR_NO,getpascalfieldaddr,u8inttype);
  426. { update the current fielddef of the expression }
  427. llvmfielddef:=u8inttype;
  428. end;
  429. { add the offset }
  430. getpascalfieldaddr:=taillvm.getelementptr_reg_tai_size_const(NR_NO,getpascalfieldaddr,ptrsinttype,vs.offsetfromllvmfield,true);
  431. { ... and set the result type of the getelementptr }
  432. getpascalfieldaddr:=wrap_with_type(getpascalfieldaddr,cpointerdef.getreusable(u8inttype));
  433. llvmfielddef:=u8inttype;
  434. end;
  435. { bitcast the data at the final offset to the right type }
  436. if llvmfielddef<>vs.vardef then
  437. getpascalfieldaddr:=wrap_with_type(taillvm.op_reg_tai_size(la_bitcast,NR_NO,getpascalfieldaddr,cpointerdef.getreusable(vs.vardef)),cpointerdef.getreusable(vs.vardef));
  438. end;
  439. update_queued_tai(cpointerdef.getreusable(vs.vardef),getpascalfieldaddr,getllvmfieldaddr,1);
  440. end;
  441. procedure tllvmtai_typedconstbuilder.queue_typeconvn(fromdef, todef: tdef);
  442. var
  443. ai: taillvm;
  444. typedai: tai;
  445. tmpintdef: tdef;
  446. op,
  447. firstop,
  448. secondop: tllvmop;
  449. begin
  450. inherited;
  451. { special case: procdef -> procvardef/pointerdef: must take address of
  452. the procdef }
  453. if (fromdef.typ=procdef) and
  454. (todef.typ<>procdef) then
  455. fromdef:=cprocvardef.getreusableprocaddr(tprocdef(fromdef));
  456. op:=llvmconvop(fromdef,todef);
  457. case op of
  458. la_ptrtoint_to_x,
  459. la_x_to_inttoptr:
  460. begin
  461. { convert via an integer with the same size as "x" }
  462. if op=la_ptrtoint_to_x then
  463. begin
  464. tmpintdef:=cgsize_orddef(def_cgsize(todef));
  465. firstop:=la_ptrtoint;
  466. secondop:=la_bitcast
  467. end
  468. else
  469. begin
  470. tmpintdef:=cgsize_orddef(def_cgsize(fromdef));
  471. firstop:=la_bitcast;
  472. secondop:=la_inttoptr;
  473. end;
  474. { since we have to queue operations from outer to inner, first queue
  475. the conversion from the tempintdef to the todef }
  476. ai:=taillvm.op_reg_tai_size(secondop,NR_NO,nil,todef);
  477. typedai:=wrap_with_type(ai,todef);
  478. update_queued_tai(todef,typedai,ai,1);
  479. todef:=tmpintdef;
  480. op:=firstop
  481. end;
  482. end;
  483. ai:=taillvm.op_reg_tai_size(op,NR_NO,nil,todef);
  484. typedai:=wrap_with_type(ai,todef);
  485. update_queued_tai(todef,typedai,ai,1);
  486. end;
  487. procedure tllvmtai_typedconstbuilder.queue_emit_staticvar(vs: tstaticvarsym);
  488. begin
  489. { we've already incorporated the offset via the inserted operations above,
  490. make sure it doesn't get emitted again as part of the tai_const for
  491. the tasmsymbol }
  492. fqueue_offset:=0;
  493. inherited;
  494. end;
  495. procedure tllvmtai_typedconstbuilder.queue_emit_asmsym(sym: tasmsymbol; def: tdef);
  496. begin
  497. { we've already incorporated the offset via the inserted operations above,
  498. make sure it doesn't get emitted again as part of the tai_const for
  499. the tasmsymbol }
  500. fqueue_offset:=0;
  501. inherited;
  502. end;
  503. procedure tllvmtai_typedconstbuilder.queue_emit_ordconst(value: int64; def: tdef);
  504. begin
  505. { no offset into an ordinal constant }
  506. if fqueue_offset<>0 then
  507. internalerror(2015030702);
  508. inherited;
  509. end;
  510. class function tllvmtai_typedconstbuilder.get_string_symofs(typ: tstringtype; winlikewidestring: boolean): pint;
  511. begin
  512. { LLVM does not support labels in the middle of a declaration }
  513. result:=get_string_header_size(typ,winlikewidestring);
  514. end;
  515. begin
  516. ctai_typedconstbuilder:=tllvmtai_typedconstbuilder;
  517. end.