ncgcnv.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. {
  2. Copyright (c) 2000-2002 by Florian Klaempfl
  3. Generate assembler for nodes that handle type conversions which are
  4. the same for all (most) processors
  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 ncgcnv;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. node,ncnv,defutil,defcmp;
  23. type
  24. tcgtypeconvnode = class(ttypeconvnode)
  25. procedure second_int_to_int;override;
  26. procedure second_cstring_to_pchar;override;
  27. procedure second_cstring_to_int;override;
  28. procedure second_string_to_chararray;override;
  29. procedure second_array_to_pointer;override;
  30. procedure second_pointer_to_array;override;
  31. procedure second_char_to_string;override;
  32. procedure second_real_to_real;override;
  33. procedure second_cord_to_pointer;override;
  34. procedure second_proc_to_procvar;override;
  35. procedure second_nil_to_methodprocvar;override;
  36. procedure second_bool_to_int;override;
  37. procedure second_bool_to_bool;override;
  38. procedure second_ansistring_to_pchar;override;
  39. procedure second_class_to_intf;override;
  40. procedure second_char_to_char;override;
  41. procedure second_nothing;override;
  42. procedure pass_generate_code;override;
  43. end;
  44. tcgasnode = class(tasnode)
  45. procedure pass_generate_code;override;
  46. end;
  47. implementation
  48. uses
  49. cutils,verbose,globtype,globals,
  50. aasmbase,aasmtai,aasmdata,aasmcpu,symconst,symdef,paramgr,
  51. ncon,ncal,
  52. cpubase,systems,
  53. procinfo,pass_2,
  54. cgbase,
  55. cgutils,cgobj,
  56. ncgutil,
  57. tgobj
  58. ;
  59. procedure tcgtypeconvnode.second_int_to_int;
  60. var
  61. orgsize,
  62. newsize : tcgsize;
  63. ressize,
  64. leftsize : longint;
  65. begin
  66. newsize:=def_cgsize(resultdef);
  67. { insert range check if not explicit conversion }
  68. if not(nf_explicit in flags) then
  69. cg.g_rangecheck(current_asmdata.CurrAsmList,left.location,left.resultdef,resultdef);
  70. { is the result size smaller? when typecasting from void
  71. we always reuse the current location, because there is
  72. nothing that we can load in a register }
  73. ressize := resultdef.size;
  74. leftsize := left.resultdef.size;
  75. if (ressize<>leftsize) and
  76. not is_void(left.resultdef) then
  77. begin
  78. location_copy(location,left.location);
  79. { reuse a loc_reference when the newsize is smaller than
  80. than the original, else load it to a register }
  81. if (location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) and
  82. (ressize<leftsize) then
  83. begin
  84. location.size:=newsize;
  85. if (target_info.endian = ENDIAN_BIG) then
  86. inc(location.reference.offset,leftsize-ressize);
  87. end
  88. else
  89. location_force_reg(current_asmdata.CurrAsmList,location,newsize,false);
  90. end
  91. else
  92. begin
  93. { no special loading is required, reuse current location }
  94. { that's not true, if you go from signed to unsiged or }
  95. { vice versa, you need sign extension/removal if the }
  96. { value is already in a register (at least for archs }
  97. { which don't have 8bit register components etc) (JM) }
  98. location_copy(location,left.location);
  99. location.size:=newsize;
  100. orgsize := def_cgsize(left.resultdef);
  101. if (ressize < sizeof(aint)) and
  102. (location.loc in [LOC_REGISTER,LOC_CREGISTER]) and
  103. (orgsize <> newsize) then
  104. begin
  105. location.register := cg.getintregister(current_asmdata.CurrAsmList,newsize);
  106. location.loc := LOC_REGISTER;
  107. cg.a_load_reg_reg(current_asmdata.CurrAsmList,orgsize,newsize,left.location.register,location.register);
  108. end;
  109. end;
  110. end;
  111. procedure tcgtypeconvnode.second_cstring_to_pchar;
  112. var
  113. hr : treference;
  114. begin
  115. if left.nodetype<>stringconstn then
  116. internalerror(200601131);
  117. location_reset(location,LOC_REGISTER,OS_ADDR);
  118. case tstringconstnode(left).cst_type of
  119. cst_conststring :
  120. begin
  121. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  122. cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.location.reference,location.register);
  123. end;
  124. cst_shortstring :
  125. begin
  126. inc(left.location.reference.offset);
  127. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  128. cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.location.reference,location.register);
  129. end;
  130. cst_widestring,
  131. cst_unicodestring,
  132. cst_ansistring :
  133. begin
  134. if tstringconstnode(left).len=0 then
  135. begin
  136. reference_reset(hr);
  137. hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR');
  138. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  139. cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,hr,location.register);
  140. end
  141. else
  142. begin
  143. location_copy(location,left.location);
  144. end;
  145. end;
  146. cst_longstring:
  147. begin
  148. {!!!!!!!}
  149. internalerror(8888);
  150. end;
  151. else
  152. internalerror(200808241);
  153. end;
  154. end;
  155. procedure tcgtypeconvnode.second_cstring_to_int;
  156. begin
  157. { this can't happen because constants are already processed in
  158. pass 1 }
  159. internalerror(200510013);
  160. end;
  161. procedure tcgtypeconvnode.second_string_to_chararray;
  162. begin
  163. if is_chararray(left.resultdef) then
  164. begin
  165. location_copy(location,left.location);
  166. exit;
  167. end;
  168. { should be handled already in resultdef pass (JM) }
  169. internalerror(200108292);
  170. end;
  171. procedure tcgtypeconvnode.second_array_to_pointer;
  172. begin
  173. location_reset(location,LOC_REGISTER,OS_ADDR);
  174. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  175. cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.location.reference,location.register);
  176. end;
  177. procedure tcgtypeconvnode.second_pointer_to_array;
  178. begin
  179. location_reset(location,LOC_REFERENCE,OS_NO);
  180. case left.location.loc of
  181. LOC_CREGISTER,
  182. LOC_REGISTER :
  183. begin
  184. {$ifdef cpu_uses_separate_address_registers}
  185. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  186. begin
  187. location.reference.base:=rg.getaddressregister(current_asmdata.CurrAsmList);
  188. cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,
  189. left.location.register,location.reference.base);
  190. end
  191. else
  192. {$endif}
  193. location.reference.base := left.location.register;
  194. end;
  195. LOC_REFERENCE,
  196. LOC_CREFERENCE :
  197. begin
  198. location.reference.base:=cg.getaddressregister(current_asmdata.CurrAsmList);
  199. cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.reference,
  200. location.reference.base);
  201. location_freetemp(current_asmdata.CurrAsmList,left.location);
  202. end;
  203. else
  204. internalerror(2002032216);
  205. end;
  206. end;
  207. procedure tcgtypeconvnode.second_char_to_string;
  208. begin
  209. location_reset(location,LOC_REFERENCE,OS_NO);
  210. case tstringdef(resultdef).stringtype of
  211. st_shortstring :
  212. begin
  213. tg.GetTemp(current_asmdata.CurrAsmList,256,tt_normal,location.reference);
  214. cg.a_load_loc_ref(current_asmdata.CurrAsmList,left.location.size,left.location,
  215. location.reference);
  216. location_freetemp(current_asmdata.CurrAsmList,left.location);
  217. end;
  218. { the rest is removed in the resultdef pass and converted to compilerprocs }
  219. else
  220. internalerror(4179);
  221. end;
  222. end;
  223. procedure tcgtypeconvnode.second_real_to_real;
  224. {$ifdef x86}
  225. var
  226. tr: treference;
  227. {$endif x86}
  228. begin
  229. location_reset(location,expectloc,def_cgsize(resultdef));
  230. {$ifdef x86}
  231. { extended types in memory which should be loaded into the sse unit
  232. must be converted by the fpu first, so force them to be loaded into
  233. the fpu }
  234. if (expectloc=LOC_MMREGISTER) and
  235. (left.location.size in [OS_F80,OS_C64]) then
  236. begin
  237. if (left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
  238. location_force_fpureg(current_asmdata.CurrAsmList,left.location,false);
  239. { round them down to the proper precision }
  240. tg.gettemp(current_asmdata.currasmlist,resultdef.size,tt_normal,tr);
  241. cg.a_loadfpu_reg_ref(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,tr);
  242. location_reset(left.location,LOC_REFERENCE,location.size);
  243. left.location.reference:=tr;
  244. end;
  245. {$endif x86}
  246. case left.location.loc of
  247. LOC_FPUREGISTER,
  248. LOC_CFPUREGISTER:
  249. begin
  250. case expectloc of
  251. LOC_FPUREGISTER:
  252. begin
  253. { on sparc a move from double -> single means from two to one register. }
  254. { On all other platforms it also needs rounding to avoid that }
  255. { single(double_regvar) = double_regvar is true in all cases }
  256. location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
  257. cg.a_loadfpu_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register);
  258. end;
  259. LOC_MMREGISTER:
  260. begin
  261. location_force_mmregscalar(current_asmdata.CurrAsmList,left.location,false);
  262. location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
  263. cg.a_loadmm_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register,mms_movescalar);
  264. end
  265. else
  266. internalerror(2003012262);
  267. end;
  268. exit
  269. end;
  270. LOC_CREFERENCE,
  271. LOC_REFERENCE:
  272. begin
  273. if expectloc=LOC_MMREGISTER then
  274. begin
  275. location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
  276. cg.a_loadmm_loc_reg(current_asmdata.CurrAsmList,location.size,left.location,location.register,mms_movescalar)
  277. end
  278. else
  279. begin
  280. location_force_fpureg(current_asmdata.CurrAsmList,left.location,false);
  281. location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
  282. cg.a_loadfpu_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register);
  283. end;
  284. location_freetemp(current_asmdata.CurrAsmList,left.location);
  285. end;
  286. LOC_MMREGISTER,
  287. LOC_CMMREGISTER:
  288. begin
  289. case expectloc of
  290. LOC_FPUREGISTER:
  291. begin
  292. location_force_fpureg(current_asmdata.CurrAsmList,left.location,false);
  293. location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,location.size);
  294. cg.a_loadfpu_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register);
  295. end;
  296. LOC_MMREGISTER:
  297. begin
  298. location.register:=cg.getmmregister(current_asmdata.CurrAsmList,location.size);
  299. cg.a_loadmm_reg_reg(current_asmdata.CurrAsmList,left.location.size,location.size,left.location.register,location.register,mms_movescalar);
  300. end;
  301. else
  302. internalerror(2003012261);
  303. end;
  304. end;
  305. else
  306. internalerror(2002032215);
  307. end;
  308. end;
  309. procedure tcgtypeconvnode.second_cord_to_pointer;
  310. begin
  311. { this can't happen because constants are already processed in
  312. pass 1 }
  313. internalerror(47423985);
  314. end;
  315. procedure tcgtypeconvnode.second_proc_to_procvar;
  316. begin
  317. if tabstractprocdef(resultdef).is_addressonly then
  318. begin
  319. location_reset(location,LOC_REGISTER,OS_ADDR);
  320. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  321. cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.location.reference,location.register);
  322. end
  323. else
  324. location_copy(location,left.location);
  325. end;
  326. procedure Tcgtypeconvnode.second_nil_to_methodprocvar;
  327. var r:Treference;
  328. begin
  329. tg.gettemp(current_asmdata.currasmlist,2*sizeof(puint),tt_normal,r);
  330. location_reset(location,LOC_REFERENCE,OS_NO);
  331. location.reference:=r;
  332. cg.a_load_const_ref(current_asmdata.currasmlist,OS_ADDR,0,r);
  333. inc(r.offset,sizeof(puint));
  334. cg.a_load_const_ref(current_asmdata.currasmlist,OS_ADDR,0,r);
  335. end;
  336. procedure tcgtypeconvnode.second_bool_to_int;
  337. var
  338. newsize: tcgsize;
  339. oldTrueLabel,oldFalseLabel : tasmlabel;
  340. begin
  341. oldTrueLabel:=current_procinfo.CurrTrueLabel;
  342. oldFalseLabel:=current_procinfo.CurrFalseLabel;
  343. current_asmdata.getjumplabel(current_procinfo.CurrTrueLabel);
  344. current_asmdata.getjumplabel(current_procinfo.CurrFalseLabel);
  345. secondpass(left);
  346. location_copy(location,left.location);
  347. newsize:=def_cgsize(resultdef);
  348. { byte(bytebool) or word(wordbool) or longint(longbool) must be }
  349. { accepted for var parameters and assignments, and must not }
  350. { change the ordinal value or value location. }
  351. { htypechk.valid_for_assign ensures that such locations with a }
  352. { size<sizeof(register) cannot be LOC_CREGISTER (they otherwise }
  353. { could be in case of a plain assignment), and LOC_REGISTER can }
  354. { never be an assignment target. The remaining LOC_REGISTER/ }
  355. { LOC_CREGISTER locations do have to be sign/zero-extended. }
  356. if not(nf_explicit in flags) or
  357. (location.loc in [LOC_FLAGS,LOC_JUMP]) or
  358. { change of size/signedness? Then we have to sign/ }
  359. { zero-extend in case of a loc_(c)register }
  360. ((newsize<>left.location.size) and
  361. ((left.resultdef.size<>resultdef.size) or
  362. not(location.loc in [LOC_REFERENCE,LOC_CREFERENCE]))) then
  363. location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
  364. else
  365. { may differ in sign, e.g. bytebool -> byte }
  366. location.size:=newsize;
  367. current_procinfo.CurrTrueLabel:=oldTrueLabel;
  368. current_procinfo.CurrFalseLabel:=oldFalseLabel;
  369. end;
  370. procedure tcgtypeconvnode.second_bool_to_bool;
  371. begin
  372. { we can reuse the conversion already available
  373. in bool_to_int to resize the value. But when the
  374. size of the new boolean is smaller we need to calculate
  375. the value as is done in int_to_bool. This is needed because
  376. the bits that define the true status can be outside the limits
  377. of the new size and truncating the register can result in a 0
  378. value }
  379. if (left.expectloc in [LOC_FLAGS,LOC_JUMP]) then
  380. begin
  381. secondpass(left);
  382. if (left.location.loc <> left.expectloc) then
  383. internalerror(20060409);
  384. location_copy(location,left.location);
  385. end
  386. else if (resultdef.size=left.resultdef.size) and
  387. not(is_cbool(resultdef) xor
  388. is_cbool(left.resultdef)) then
  389. second_bool_to_int
  390. else
  391. begin
  392. if (resultdef.size<>left.resultdef.size) then
  393. { remove nf_explicit to perform full conversion if boolean sizes are different }
  394. exclude(flags, nf_explicit);
  395. second_int_to_bool;
  396. end;
  397. end;
  398. procedure tcgtypeconvnode.second_ansistring_to_pchar;
  399. var
  400. l1 : tasmlabel;
  401. hr : treference;
  402. begin
  403. location_reset(location,LOC_REGISTER,OS_ADDR);
  404. current_asmdata.getjumplabel(l1);
  405. case left.location.loc of
  406. LOC_CREGISTER,LOC_REGISTER:
  407. begin
  408. {$ifdef cpu_uses_separate_address_registers}
  409. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  410. begin
  411. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  412. cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,
  413. left.location.register,location.register);
  414. end
  415. else
  416. {$endif}
  417. location.register := left.location.register;
  418. end;
  419. LOC_CREFERENCE,LOC_REFERENCE:
  420. begin
  421. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  422. cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.reference,location.register);
  423. end;
  424. else
  425. internalerror(2002032214);
  426. end;
  427. cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_ADDR,OC_NE,0,location.register,l1);
  428. reference_reset(hr);
  429. hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR');
  430. cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,hr,location.register);
  431. cg.a_label(current_asmdata.CurrAsmList,l1);
  432. end;
  433. procedure tcgtypeconvnode.second_class_to_intf;
  434. var
  435. l1 : tasmlabel;
  436. hd : tobjectdef;
  437. ImplIntf : TImplementedInterface;
  438. begin
  439. location_reset(location,LOC_REGISTER,OS_ADDR);
  440. case left.location.loc of
  441. LOC_CREFERENCE,
  442. LOC_REFERENCE:
  443. begin
  444. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  445. cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.reference,location.register);
  446. location_freetemp(current_asmdata.CurrAsmList,left.location);
  447. end;
  448. LOC_CREGISTER:
  449. begin
  450. location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
  451. cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.register,location.register);
  452. end;
  453. LOC_REGISTER:
  454. location.register:=left.location.register;
  455. else
  456. internalerror(121120001);
  457. end;
  458. hd:=tobjectdef(left.resultdef);
  459. while assigned(hd) do
  460. begin
  461. ImplIntf:=hd.find_implemented_interface(tobjectdef(resultdef));
  462. if assigned(ImplIntf) then
  463. begin
  464. case ImplIntf.IType of
  465. etStandard:
  466. begin
  467. current_asmdata.getjumplabel(l1);
  468. cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_ADDR,OC_EQ,0,location.register,l1);
  469. cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_ADD,OS_ADDR,ImplIntf.ioffset,location.register);
  470. break;
  471. end;
  472. else
  473. internalerror(200802163);
  474. end;
  475. end;
  476. hd:=hd.childof;
  477. end;
  478. if hd=nil then
  479. internalerror(2002081301);
  480. cg.a_label(current_asmdata.CurrAsmList,l1);
  481. end;
  482. procedure tcgtypeconvnode.second_char_to_char;
  483. begin
  484. internalerror(2007081202);
  485. end;
  486. procedure tcgtypeconvnode.second_nothing;
  487. var
  488. newsize : tcgsize;
  489. begin
  490. { we reuse the old value }
  491. location_copy(location,left.location);
  492. { Floats should never be returned as LOC_CONSTANT, do the
  493. moving to memory before the new size is set.
  494. Also when converting from a float to a non-float
  495. or the other way round, move to memory first to prevent
  496. invalid LOC_FPUREGISTER locations }
  497. if (
  498. (resultdef.typ=floatdef) and
  499. (location.loc=LOC_CONSTANT)
  500. ) or
  501. (
  502. (left.resultdef.typ=floatdef) xor
  503. (resultdef.typ=floatdef)
  504. ) then
  505. location_force_mem(current_asmdata.CurrAsmList,location);
  506. { but use the new size, but we don't know the size of all arrays }
  507. newsize:=def_cgsize(resultdef);
  508. location.size:=newsize;
  509. end;
  510. {$ifdef TESTOBJEXT2}
  511. procedure tcgtypeconvnode.checkobject;
  512. begin
  513. { no checking by default }
  514. end;
  515. {$endif TESTOBJEXT2}
  516. procedure tcgtypeconvnode.pass_generate_code;
  517. begin
  518. { the boolean routines can be called with LOC_JUMP and
  519. call secondpass themselves in the helper }
  520. if not(convtype in [tc_bool_2_int,tc_bool_2_bool,tc_int_2_bool]) then
  521. begin
  522. secondpass(left);
  523. if codegenerror then
  524. exit;
  525. end;
  526. second_call_helper(convtype);
  527. {$ifdef TESTOBJEXT2}
  528. { Check explicit conversions to objects pointers !! }
  529. if p^.explizit and
  530. (p^.resultdef.typ=pointerdef) and
  531. (tpointerdef(p^.resultdef).definition.typ=objectdef) and not
  532. (tobjectdef(tpointerdef(p^.resultdef).definition).isclass) and
  533. ((tobjectdef(tpointerdef(p^.resultdef).definition).options and oo_hasvmt)<>0) and
  534. (cs_check_range in current_settings.localswitches) then
  535. checkobject;
  536. {$endif TESTOBJEXT2}
  537. end;
  538. procedure tcgasnode.pass_generate_code;
  539. begin
  540. secondpass(call);
  541. location_copy(location,call.location);
  542. end;
  543. begin
  544. ctypeconvnode := tcgtypeconvnode;
  545. casnode := tcgasnode;
  546. end.