ncgbas.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Florian Klaempfl
  4. This unit implements some basic nodes
  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 ncgbas;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. cpubase,
  23. node,nbas;
  24. type
  25. tcgnothingnode = class(tnothingnode)
  26. procedure pass_2;override;
  27. end;
  28. tcgasmnode = class(tasmnode)
  29. procedure pass_2;override;
  30. end;
  31. tcgstatementnode = class(tstatementnode)
  32. procedure pass_2;override;
  33. end;
  34. tcgblocknode = class(tblocknode)
  35. procedure pass_2;override;
  36. end;
  37. tcgtempcreatenode = class(ttempcreatenode)
  38. procedure pass_2;override;
  39. end;
  40. tcgtemprefnode = class(ttemprefnode)
  41. procedure pass_2;override;
  42. { Changes the location of this temp to ref. Useful when assigning }
  43. { another temp to this one. The current location will be freed. }
  44. { Can only be called in pass 2 (since earlier, the temp location }
  45. { isn't known yet) }
  46. procedure changelocation(const ref: treference);
  47. end;
  48. tcgtempdeletenode = class(ttempdeletenode)
  49. procedure pass_2;override;
  50. end;
  51. implementation
  52. uses
  53. globtype,systems,
  54. cutils,verbose,cpuinfo,
  55. aasmbase,aasmtai,aasmcpu,symsym,
  56. defutil,
  57. nflw,pass_2,
  58. cgbase,
  59. cgutils,cgobj,
  60. procinfo,
  61. tgobj
  62. ;
  63. {*****************************************************************************
  64. TNOTHING
  65. *****************************************************************************}
  66. procedure tcgnothingnode.pass_2;
  67. begin
  68. location_reset(location,LOC_VOID,OS_NO);
  69. { avoid an abstract rte }
  70. end;
  71. {*****************************************************************************
  72. TSTATEMENTNODE
  73. *****************************************************************************}
  74. procedure tcgstatementnode.pass_2;
  75. var
  76. hp : tstatementnode;
  77. begin
  78. location_reset(location,LOC_VOID,OS_NO);
  79. hp:=self;
  80. while assigned(hp) do
  81. begin
  82. if assigned(hp.left) then
  83. begin
  84. secondpass(hp.left);
  85. { Compiler inserted blocks can return values }
  86. location_copy(hp.location,hp.left.location);
  87. end;
  88. hp:=tstatementnode(hp.right);
  89. end;
  90. end;
  91. {*****************************************************************************
  92. TASMNODE
  93. *****************************************************************************}
  94. procedure tcgasmnode.pass_2;
  95. procedure ReLabel(var p:tasmsymbol);
  96. begin
  97. { Only relabel local tasmlabels }
  98. if (p.defbind = AB_LOCAL) and
  99. (p is tasmlabel) then
  100. begin
  101. if not assigned(p.altsymbol) then
  102. objectlibrary.GenerateAltSymbol(p);
  103. p:=p.altsymbol;
  104. p.increfs;
  105. end;
  106. end;
  107. procedure ResolveRef(var op:toper);
  108. var
  109. sym : tvarsym;
  110. {$ifdef x86}
  111. scale : byte;
  112. {$endif x86}
  113. getoffset : boolean;
  114. indexreg : tregister;
  115. sofs : longint;
  116. begin
  117. if (op.typ=top_local) then
  118. begin
  119. sofs:=op.localoper^.localsymofs;
  120. indexreg:=op.localoper^.localindexreg;
  121. {$ifdef x86}
  122. scale:=op.localoper^.localscale;
  123. {$endif x86}
  124. getoffset:=op.localoper^.localgetoffset;
  125. sym:=tvarsym(pointer(op.localoper^.localsym));
  126. dispose(op.localoper);
  127. case sym.localloc.loc of
  128. LOC_REFERENCE :
  129. begin
  130. if getoffset then
  131. begin
  132. if indexreg=NR_NO then
  133. begin
  134. op.typ:=top_const;
  135. op.val:=sym.localloc.reference.offset+sofs;
  136. end
  137. else
  138. begin
  139. op.typ:=top_ref;
  140. new(op.ref);
  141. reference_reset_base(op.ref^,indexreg,sym.localloc.reference.offset+sofs);
  142. end;
  143. end
  144. else
  145. begin
  146. op.typ:=top_ref;
  147. new(op.ref);
  148. reference_reset_base(op.ref^,sym.localloc.reference.index,sym.localloc.reference.offset+sofs);
  149. op.ref^.index:=indexreg;
  150. {$ifdef x86}
  151. op.ref^.scalefactor:=scale;
  152. {$endif x86}
  153. end;
  154. end;
  155. LOC_REGISTER :
  156. begin
  157. if getoffset then
  158. Message(asmr_e_invalid_reference_syntax);
  159. { Subscribed access }
  160. if sofs<>0 then
  161. begin
  162. op.typ:=top_ref;
  163. new(op.ref);
  164. reference_reset_base(op.ref^,sym.localloc.register,sofs);
  165. end
  166. else
  167. begin
  168. op.typ:=top_reg;
  169. op.reg:=sym.localloc.register;
  170. end;
  171. end;
  172. end;
  173. end;
  174. end;
  175. var
  176. hp,hp2 : tai;
  177. i : longint;
  178. skipnode : boolean;
  179. begin
  180. location_reset(location,LOC_VOID,OS_NO);
  181. if (nf_get_asm_position in flags) then
  182. begin
  183. { Add a marker, to be sure the list is not empty }
  184. exprasmlist.concat(tai_marker.create(marker_position));
  185. currenttai:=tai(exprasmlist.last);
  186. exit;
  187. end;
  188. { Allocate registers used in the assembler block }
  189. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,used_regs_int);
  190. if (current_procinfo.procdef.proccalloption=pocall_inline) then
  191. begin
  192. objectlibrary.CreateUsedAsmSymbolList;
  193. hp:=tai(p_asm.first);
  194. while assigned(hp) do
  195. begin
  196. hp2:=tai(hp.getcopy);
  197. skipnode:=false;
  198. case hp2.typ of
  199. ait_label :
  200. ReLabel(tasmsymbol(tai_label(hp2).l));
  201. ait_const_64bit,
  202. ait_const_32bit,
  203. ait_const_16bit,
  204. ait_const_8bit,
  205. ait_const_rva_symbol,
  206. ait_const_indirect_symbol :
  207. begin
  208. if assigned(tai_const(hp2).sym) then
  209. ReLabel(tai_const(hp2).sym);
  210. if assigned(tai_const(hp2).endsym) then
  211. ReLabel(tai_const(hp2).endsym);
  212. end;
  213. ait_instruction :
  214. begin
  215. { remove cached insentry, because the new code can
  216. require an other less optimized instruction }
  217. {$ifdef i386}
  218. {$ifndef NOAG386BIN}
  219. taicpu(hp2).ResetPass1;
  220. {$endif}
  221. {$endif}
  222. { fixup the references }
  223. for i:=1 to taicpu(hp2).ops do
  224. begin
  225. ResolveRef(taicpu(hp2).oper[i-1]^);
  226. with taicpu(hp2).oper[i-1]^ do
  227. begin
  228. case typ of
  229. top_ref :
  230. begin
  231. if assigned(ref^.symbol) then
  232. ReLabel(ref^.symbol);
  233. if assigned(ref^.relsymbol) then
  234. ReLabel(ref^.relsymbol);
  235. end;
  236. end;
  237. end;
  238. end;
  239. end;
  240. ait_marker :
  241. begin
  242. { it's not an assembler block anymore }
  243. if (tai_marker(hp2).kind in [AsmBlockStart, AsmBlockEnd]) then
  244. skipnode:=true;
  245. end;
  246. end;
  247. if not skipnode then
  248. exprasmList.concat(hp2)
  249. else
  250. hp2.free;
  251. hp:=tai(hp.next);
  252. end;
  253. { restore used symbols }
  254. objectlibrary.UsedAsmSymbolListResetAltSym;
  255. objectlibrary.DestroyUsedAsmSymbolList;
  256. end
  257. else
  258. begin
  259. hp:=tai(p_asm.first);
  260. while assigned(hp) do
  261. begin
  262. case hp.typ of
  263. ait_instruction :
  264. begin
  265. { remove cached insentry, because the new code can
  266. require an other less optimized instruction }
  267. {$ifdef i386}
  268. {$ifndef NOAG386BIN}
  269. taicpu(hp).ResetPass1;
  270. {$endif}
  271. {$endif}
  272. { fixup the references }
  273. for i:=1 to taicpu(hp).ops do
  274. ResolveRef(taicpu(hp).oper[i-1]^);
  275. end;
  276. end;
  277. hp:=tai(hp.next);
  278. end;
  279. { insert the list }
  280. exprasmList.concatlist(p_asm);
  281. end;
  282. { Release register used in the assembler block }
  283. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,used_regs_int);
  284. end;
  285. {*****************************************************************************
  286. TBLOCKNODE
  287. *****************************************************************************}
  288. procedure tcgblocknode.pass_2;
  289. var
  290. hp : tstatementnode;
  291. begin
  292. location_reset(location,LOC_VOID,OS_NO);
  293. { do second pass on left node }
  294. if assigned(left) then
  295. begin
  296. hp:=tstatementnode(left);
  297. while assigned(hp) do
  298. begin
  299. if assigned(hp.left) then
  300. begin
  301. secondpass(hp.left);
  302. location_copy(hp.location,hp.left.location);
  303. end;
  304. location_copy(location,hp.location);
  305. hp:=tstatementnode(hp.right);
  306. end;
  307. end;
  308. end;
  309. {*****************************************************************************
  310. TTEMPCREATENODE
  311. *****************************************************************************}
  312. procedure tcgtempcreatenode.pass_2;
  313. var
  314. cgsize: tcgsize;
  315. begin
  316. location_reset(location,LOC_VOID,OS_NO);
  317. { if we're secondpassing the same tcgtempcreatenode twice, we have a bug }
  318. if tempinfo^.valid then
  319. internalerror(200108222);
  320. { get a (persistent) temp }
  321. if tempinfo^.restype.def.needs_inittable then
  322. begin
  323. tg.GetTempTyped(exprasmlist,tempinfo^.restype.def,tempinfo^.temptype,tempinfo^.loc.ref);
  324. tempinfo^.loc.loc := LOC_REFERENCE;
  325. end
  326. else if tempinfo^.may_be_in_reg then
  327. begin
  328. cgsize := def_cgsize(tempinfo^.restype.def);
  329. if (TCGSize2Size[cgsize]>TCGSize2Size[OS_INT]) then
  330. internalerror(2004020202);
  331. tempinfo^.loc.reg := cg.getintregister(exprasmlist,cgsize);
  332. if (tempinfo^.temptype = tt_persistent) then
  333. begin
  334. { !!tell rgobj this register is now a regvar, so it can't be freed!! }
  335. tempinfo^.loc.loc := LOC_CREGISTER
  336. end
  337. else
  338. tempinfo^.loc.loc := LOC_REGISTER;
  339. end
  340. else
  341. begin
  342. tg.GetTemp(exprasmlist,size,tempinfo^.temptype,tempinfo^.loc.ref);
  343. tempinfo^.loc.loc := LOC_REFERENCE;
  344. end;
  345. tempinfo^.valid := true;
  346. end;
  347. {*****************************************************************************
  348. TTEMPREFNODE
  349. *****************************************************************************}
  350. procedure tcgtemprefnode.pass_2;
  351. begin
  352. { check if the temp is valid }
  353. if not tempinfo^.valid then
  354. internalerror(200108231);
  355. case tempinfo^.loc.loc of
  356. LOC_REFERENCE:
  357. begin
  358. { set the temp's location }
  359. location_reset(location,LOC_REFERENCE,def_cgsize(tempinfo^.restype.def));
  360. location.reference := tempinfo^.loc.ref;
  361. inc(location.reference.offset,offset);
  362. end;
  363. LOC_REGISTER,
  364. LOC_CREGISTER:
  365. begin
  366. if offset <> 0 then
  367. internalerror(2004020205);
  368. { LOC_CREGISTER, not LOC_REGISTER, otherwise we can't assign anything to it }
  369. location_reset(location,tempinfo^.loc.loc,def_cgsize(tempinfo^.restype.def));
  370. location.register := tempinfo^.loc.reg;
  371. end;
  372. else
  373. internalerror(2004020204);
  374. end;
  375. end;
  376. procedure tcgtemprefnode.changelocation(const ref: treference);
  377. begin
  378. { check if the temp is valid }
  379. if not tempinfo^.valid then
  380. internalerror(200306081);
  381. if (tempinfo^.loc.loc = LOC_REGISTER) then
  382. internalerror(2004020203);
  383. if (tempinfo^.temptype = tt_persistent) then
  384. tg.ChangeTempType(exprasmlist,tempinfo^.loc.ref,tt_normal);
  385. tg.ungettemp(exprasmlist,tempinfo^.loc.ref);
  386. tempinfo^.loc.ref := ref;
  387. tg.ChangeTempType(exprasmlist,tempinfo^.loc.ref,tempinfo^.temptype);
  388. { adapt location }
  389. location.reference := ref;
  390. inc(location.reference.offset,offset);
  391. end;
  392. {*****************************************************************************
  393. TTEMPDELETENODE
  394. *****************************************************************************}
  395. procedure tcgtempdeletenode.pass_2;
  396. begin
  397. location_reset(location,LOC_VOID,OS_NO);
  398. case tempinfo^.loc.loc of
  399. LOC_REFERENCE:
  400. begin
  401. if release_to_normal then
  402. tg.ChangeTempType(exprasmlist,tempinfo^.loc.ref,tt_normal)
  403. else
  404. tg.UnGetTemp(exprasmlist,tempinfo^.loc.ref);
  405. end;
  406. LOC_CREGISTER,
  407. LOC_REGISTER:
  408. begin
  409. { make sure the register allocator doesn't reuse the }
  410. { register e.g. in the middle of a loop }
  411. cg.a_load_reg_reg(exprasmlist,OS_INT,OS_INT,tempinfo^.loc.reg,
  412. tempinfo^.loc.reg);
  413. if release_to_normal then
  414. tempinfo^.loc.loc := LOC_REGISTER
  415. else
  416. { !!tell rgobj this register is no longer a regvar!! }
  417. cg.ungetregister(exprasmlist,tempinfo^.loc.reg);
  418. end;
  419. end;
  420. end;
  421. begin
  422. cnothingnode:=tcgnothingnode;
  423. casmnode:=tcgasmnode;
  424. cstatementnode:=tcgstatementnode;
  425. cblocknode:=tcgblocknode;
  426. ctempcreatenode:=tcgtempcreatenode;
  427. ctemprefnode:=tcgtemprefnode;
  428. ctempdeletenode:=tcgtempdeletenode;
  429. end.
  430. {
  431. $Log$
  432. Revision 1.63 2004-06-16 20:07:08 florian
  433. * dwarf branch merged
  434. Revision 1.62 2004/05/23 18:28:41 peter
  435. * methodpointer is loaded into a temp when it was a calln
  436. Revision 1.61 2004/05/23 15:06:20 peter
  437. * implicit_finally flag must be set in pass1
  438. * add check whether the implicit frame is generated when expected
  439. Revision 1.60.2.3 2004/04/27 18:18:25 peter
  440. * aword -> aint
  441. Revision 1.60.2.2 2004/04/12 19:34:45 peter
  442. * basic framework for dwarf CFI
  443. Revision 1.60.2.1 2004/04/12 14:45:11 peter
  444. * tai_const_symbol and tai_const merged
  445. Revision 1.60 2004/03/15 08:44:51 michael
  446. + Fix from peter: fixes crash when inlining assembler code referencing local vars
  447. Revision 1.59 2004/03/10 20:41:17 peter
  448. * maybe_in_reg moved to tempinfo
  449. * fixed expectloc for maybe_in_reg
  450. Revision 1.58 2004/03/02 17:32:12 florian
  451. * make cycle fixed
  452. + pic support for darwin
  453. + support of importing vars from shared libs on darwin implemented
  454. Revision 1.57 2004/02/27 19:30:23 jonas
  455. * fixed relsymbol copy/paste bug
  456. Revision 1.56 2004/02/27 10:21:05 florian
  457. * top_symbol killed
  458. + refaddr to treference added
  459. + refsymbol to treference added
  460. * top_local stuff moved to an extra record to save memory
  461. + aint introduced
  462. * tppufile.get/putint64/aint implemented
  463. Revision 1.55 2004/02/04 18:45:29 jonas
  464. + some more usage of register temps
  465. Revision 1.54 2004/02/03 19:48:06 jonas
  466. * fixed and re-enabled temps in registers
  467. Revision 1.53 2004/02/03 17:55:50 jonas
  468. * cleanup
  469. Revision 1.52 2004/02/03 16:46:51 jonas
  470. + support to store ttempcreate/ref/deletenodes in registers
  471. * put temps for withnodes and some newnodes in registers
  472. Note: this currently only works because calling ungetregister()
  473. multiple times for the same register doesn't matter. We need again
  474. a way to specify that a register is currently a regvar and as such
  475. should not be freed when you call ungetregister() on it.
  476. Revision 1.51 2003/11/07 15:58:32 florian
  477. * Florian's culmutative nr. 1; contains:
  478. - invalid calling conventions for a certain cpu are rejected
  479. - arm softfloat calling conventions
  480. - -Sp for cpu dependend code generation
  481. - several arm fixes
  482. - remaining code for value open array paras on heap
  483. Revision 1.50 2003/11/04 15:35:13 peter
  484. * fix for referencecounted temps
  485. Revision 1.49 2003/11/02 13:30:05 jonas
  486. * fixed ppc compilation
  487. Revision 1.48 2003/10/30 19:59:00 peter
  488. * support scalefactor for opr_local
  489. * support reference with opr_local set, fixes tw2631
  490. Revision 1.47 2003/10/29 15:40:20 peter
  491. * support indexing and offset retrieval for locals
  492. Revision 1.46 2003/10/24 17:39:41 peter
  493. * asmnode.get_position now inserts a marker
  494. Revision 1.45 2003/10/21 15:15:36 peter
  495. * taicpu_abstract.oper[] changed to pointers
  496. Revision 1.44 2003/10/10 17:48:13 peter
  497. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  498. * tregisteralloctor renamed to trgobj
  499. * removed rgobj from a lot of units
  500. * moved location_* and reference_* to cgobj
  501. * first things for mmx register allocation
  502. Revision 1.43 2003/10/09 21:31:37 daniel
  503. * Register allocator splitted, ans abstract now
  504. Revision 1.42 2003/10/07 18:18:16 peter
  505. * fix register calling for assembler procedures
  506. * fix result loading for assembler procedures
  507. Revision 1.41 2003/10/01 20:34:48 peter
  508. * procinfo unit contains tprocinfo
  509. * cginfo renamed to cgbase
  510. * moved cgmessage to verbose
  511. * fixed ppc and sparc compiles
  512. Revision 1.40 2003/09/23 17:56:05 peter
  513. * locals and paras are allocated in the code generation
  514. * tvarsym.localloc contains the location of para/local when
  515. generating code for the current procedure
  516. Revision 1.39 2003/09/07 22:09:35 peter
  517. * preparations for different default calling conventions
  518. * various RA fixes
  519. Revision 1.38 2003/09/03 15:55:00 peter
  520. * NEWRA branch merged
  521. Revision 1.37.2.1 2003/08/27 20:23:55 peter
  522. * remove old ra code
  523. Revision 1.37 2003/06/13 21:19:30 peter
  524. * current_procdef removed, use current_procinfo.procdef instead
  525. Revision 1.36 2003/06/09 18:26:46 peter
  526. * remove temptype, use tempinfo.temptype instead
  527. Revision 1.35 2003/06/09 12:20:47 peter
  528. * getposition added to retrieve the the current tai item
  529. Revision 1.34 2003/05/17 13:30:08 jonas
  530. * changed tt_persistant to tt_persistent :)
  531. * tempcreatenode now doesn't accept a boolean anymore for persistent
  532. temps, but a ttemptype, so you can also create ansistring temps etc
  533. Revision 1.33 2003/04/27 11:21:33 peter
  534. * aktprocdef renamed to current_procinfo.procdef
  535. * procinfo renamed to current_procinfo
  536. * procinfo will now be stored in current_module so it can be
  537. cleaned up properly
  538. * gen_main_procsym changed to create_main_proc and release_main_proc
  539. to also generate a tprocinfo structure
  540. * fixed unit implicit initfinal
  541. Revision 1.32 2002/04/25 20:15:39 florian
  542. * block nodes within expressions shouldn't release the used registers,
  543. fixed using a flag till the new rg is ready
  544. Revision 1.31 2003/04/22 23:50:22 peter
  545. * firstpass uses expectloc
  546. * checks if there are differences between the expectloc and
  547. location.loc from secondpass in EXTDEBUG
  548. Revision 1.30 2003/04/17 07:50:24 daniel
  549. * Some work on interference graph construction
  550. Revision 1.29 2003/03/28 19:16:56 peter
  551. * generic constructor working for i386
  552. * remove fixed self register
  553. * esi added as address register for i386
  554. Revision 1.28 2002/11/27 15:33:19 peter
  555. * fixed relabeling to relabel only tasmlabel (formerly proclocal)
  556. Revision 1.27 2002/11/27 02:37:13 peter
  557. * case statement inlining added
  558. * fixed inlining of write()
  559. * switched statementnode left and right parts so the statements are
  560. processed in the correct order when getcopy is used. This is
  561. required for tempnodes
  562. Revision 1.26 2002/11/17 16:31:56 carl
  563. * memory optimization (3-4%) : cleanup of tai fields,
  564. cleanup of tdef and tsym fields.
  565. * make it work for m68k
  566. Revision 1.25 2002/11/15 16:29:30 peter
  567. * made tasmsymbol.refs private (merged)
  568. Revision 1.24 2002/11/15 01:58:51 peter
  569. * merged changes from 1.0.7 up to 04-11
  570. - -V option for generating bug report tracing
  571. - more tracing for option parsing
  572. - errors for cdecl and high()
  573. - win32 import stabs
  574. - win32 records<=8 are returned in eax:edx (turned off by default)
  575. - heaptrc update
  576. - more info for temp management in .s file with EXTDEBUG
  577. Revision 1.23 2002/08/23 16:14:48 peter
  578. * tempgen cleanup
  579. * tt_noreuse temp type added that will be used in genentrycode
  580. Revision 1.22 2002/08/11 14:32:26 peter
  581. * renamed current_library to objectlibrary
  582. Revision 1.21 2002/08/11 13:24:11 peter
  583. * saving of asmsymbols in ppu supported
  584. * asmsymbollist global is removed and moved into a new class
  585. tasmlibrarydata that will hold the info of a .a file which
  586. corresponds with a single module. Added librarydata to tmodule
  587. to keep the library info stored for the module. In the future the
  588. objectfiles will also be stored to the tasmlibrarydata class
  589. * all getlabel/newasmsymbol and friends are moved to the new class
  590. Revision 1.20 2002/07/01 18:46:22 peter
  591. * internal linker
  592. * reorganized aasm layer
  593. Revision 1.19 2002/05/18 13:34:09 peter
  594. * readded missing revisions
  595. Revision 1.18 2002/05/16 19:46:37 carl
  596. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  597. + try to fix temp allocation (still in ifdef)
  598. + generic constructor calls
  599. + start of tassembler / tmodulebase class cleanup
  600. Revision 1.16 2002/05/13 19:54:37 peter
  601. * removed n386ld and n386util units
  602. * maybe_save/maybe_restore added instead of the old maybe_push
  603. Revision 1.15 2002/05/12 16:53:07 peter
  604. * moved entry and exitcode to ncgutil and cgobj
  605. * foreach gets extra argument for passing local data to the
  606. iterator function
  607. * -CR checks also class typecasts at runtime by changing them
  608. into as
  609. * fixed compiler to cycle with the -CR option
  610. * fixed stabs with elf writer, finally the global variables can
  611. be watched
  612. * removed a lot of routines from cga unit and replaced them by
  613. calls to cgobj
  614. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  615. u32bit then the other is typecasted also to u32bit without giving
  616. a rangecheck warning/error.
  617. * fixed pascal calling method with reversing also the high tree in
  618. the parast, detected by tcalcst3 test
  619. Revision 1.14 2002/04/23 19:16:34 peter
  620. * add pinline unit that inserts compiler supported functions using
  621. one or more statements
  622. * moved finalize and setlength from ninl to pinline
  623. Revision 1.13 2002/04/21 19:02:03 peter
  624. * removed newn and disposen nodes, the code is now directly
  625. inlined from pexpr
  626. * -an option that will write the secondpass nodes to the .s file, this
  627. requires EXTDEBUG define to actually write the info
  628. * fixed various internal errors and crashes due recent code changes
  629. Revision 1.12 2002/04/04 19:05:57 peter
  630. * removed unused units
  631. * use tlocation.size in cg.a_*loc*() routines
  632. Revision 1.11 2002/03/31 20:26:34 jonas
  633. + a_loadfpu_* and a_loadmm_* methods in tcg
  634. * register allocation is now handled by a class and is mostly processor
  635. independent (+rgobj.pas and i386/rgcpu.pas)
  636. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  637. * some small improvements and fixes to the optimizer
  638. * some register allocation fixes
  639. * some fpuvaroffset fixes in the unary minus node
  640. * push/popusedregisters is now called rg.save/restoreusedregisters and
  641. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  642. also better optimizable)
  643. * fixed and optimized register saving/restoring for new/dispose nodes
  644. * LOC_FPU locations now also require their "register" field to be set to
  645. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  646. - list field removed of the tnode class because it's not used currently
  647. and can cause hard-to-find bugs
  648. }