tgobj.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit implements the base object for temp. generator
  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. {#@abstract(Temporary reference allocator unit)
  19. Temporary reference allocator unit. This unit contains
  20. all which is related to allocating temporary memory
  21. space on the stack, as required, by the code generator.
  22. }
  23. unit tgobj;
  24. {$i fpcdefs.inc}
  25. interface
  26. uses
  27. globals,
  28. cpubase,
  29. cpuinfo,cginfo,
  30. cclasses,globtype,cgbase,aasmbase,aasmtai,aasmcpu;
  31. type
  32. ptemprecord = ^ttemprecord;
  33. ttemprecord = record
  34. temptype : ttemptype;
  35. pos : longint;
  36. size : longint;
  37. next : ptemprecord;
  38. nextfree : ptemprecord; { for faster freeblock checking }
  39. {$ifdef EXTDEBUG}
  40. posinfo,
  41. releaseposinfo : tfileposinfo;
  42. {$endif}
  43. end;
  44. {# Generates temporary variables }
  45. ttgobj = class
  46. private
  47. { contains all free temps using nextfree links }
  48. tempfreelist : ptemprecord;
  49. function alloctemp(list: taasmoutput; size : longint; temptype : ttemptype) : longint;
  50. procedure freetemp(list: taasmoutput; pos:longint;temptypes:ttemptypeset);
  51. public
  52. { contains all temps }
  53. templist : ptemprecord;
  54. { Offsets of the first/last temp }
  55. firsttemp,
  56. lasttemp : longint;
  57. direction : shortint;
  58. constructor create;
  59. {# Clear and free the complete linked list of temporary memory
  60. locations. The list is set to nil.}
  61. procedure resettempgen;
  62. {# Sets the first offset from the frame pointer or stack pointer where
  63. the temporary references will be allocated. It is to note that this
  64. value should always be negative.
  65. @param(l start offset where temps will start in stack)
  66. }
  67. procedure setfirsttemp(l : longint);
  68. procedure gettemp(list: taasmoutput; size : longint;temptype:ttemptype;var ref : treference);
  69. procedure ungettemp(list: taasmoutput; const ref : treference);
  70. function sizeoftemp(list: taasmoutput; const ref: treference): longint;
  71. function changetemptype(list: taasmoutput; const ref:treference;temptype:ttemptype):boolean;
  72. {# Returns TRUE if the reference ref is allocated in temporary volatile memory space,
  73. otherwise returns FALSE.
  74. @param(ref reference to verify)
  75. }
  76. function istemp(const ref : treference) : boolean;
  77. {# Frees a reference @var(ref) which was allocated in the volatile temporary memory space.
  78. The freed space can later be reallocated and reused. If this reference
  79. is not in the temporary memory, it is simply not freed.
  80. }
  81. procedure ungetiftemp(list: taasmoutput; const ref : treference);
  82. { Allocate space for a local }
  83. procedure getlocal(list: taasmoutput; size : longint;var ref : tparareference);
  84. procedure UnGetLocal(list: taasmoutput; const ref : tparareference);
  85. end;
  86. var
  87. tg: ttgobj;
  88. implementation
  89. uses
  90. systems,
  91. verbose,cutils
  92. ;
  93. const
  94. FreeTempTypes = [tt_free,tt_freenoreuse,tt_freeansistring,
  95. tt_freewidestring,tt_freeinterfacecom];
  96. {$ifdef EXTDEBUG}
  97. TempTypeStr : array[ttemptype] of string[18] = (
  98. '<none>',
  99. 'free','normal','persistant',
  100. 'noreuse','freenoreuse',
  101. 'ansistring','freeansistring',
  102. 'widestring','freewidestring',
  103. 'interfacecom','freeinterfacecom'
  104. );
  105. {$endif EXTDEBUG}
  106. Used2Free : array[ttemptype] of ttemptype = (
  107. tt_none,
  108. tt_none,tt_free,tt_free,
  109. tt_freenoreuse,tt_none,
  110. tt_freeansistring,tt_none,
  111. tt_freewidestring,tt_none,
  112. tt_freeinterfacecom,tt_none);
  113. {*****************************************************************************
  114. TTGOBJ
  115. *****************************************************************************}
  116. constructor ttgobj.create;
  117. begin
  118. tempfreelist:=nil;
  119. templist:=nil;
  120. { we could create a new child class for this but I don't if it is worth the effort (FK) }
  121. {$ifdef powerpc}
  122. direction:=1;
  123. {$else powerpc}
  124. direction:=-1;
  125. {$endif powerpc}
  126. end;
  127. procedure ttgobj.resettempgen;
  128. var
  129. hp : ptemprecord;
  130. begin
  131. { Clear the old templist }
  132. while assigned(templist) do
  133. begin
  134. {$ifdef EXTDEBUG}
  135. if not(templist^.temptype in FreeTempTypes) then
  136. begin
  137. Comment(V_Warning,'tgobj: (ResetTempgen) temp at pos '+tostr(templist^.pos)+
  138. ' with size '+tostr(templist^.size)+' and type '+TempTypeStr[templist^.temptype]+
  139. ' from pos '+tostr(templist^.posinfo.line)+':'+tostr(templist^.posinfo.column)+
  140. ' not freed at the end of the procedure');
  141. end;
  142. {$endif}
  143. hp:=templist;
  144. templist:=hp^.next;
  145. dispose(hp);
  146. end;
  147. templist:=nil;
  148. tempfreelist:=nil;
  149. firsttemp:=0;
  150. lasttemp:=0;
  151. end;
  152. procedure ttgobj.setfirsttemp(l : longint);
  153. begin
  154. { this is a negative value normally }
  155. if l*direction>=0 then
  156. begin
  157. if odd(l) then
  158. inc(l,direction);
  159. end
  160. else
  161. internalerror(200204221);
  162. firsttemp:=l;
  163. lasttemp:=l;
  164. end;
  165. function ttgobj.AllocTemp(list: taasmoutput; size : longint; temptype : ttemptype) : longint;
  166. var
  167. tl,
  168. bestslot,bestprev,
  169. hprev,hp : ptemprecord;
  170. bestsize : longint;
  171. freetype : ttemptype;
  172. begin
  173. AllocTemp:=0;
  174. bestprev:=nil;
  175. bestslot:=nil;
  176. tl:=nil;
  177. bestsize:=0;
  178. if size=0 then
  179. begin
  180. {$ifdef EXTDEBUG}
  181. Comment(V_Warning,'tgobj: (AllocTemp) temp of size 0 requested, allocating 4 bytes');
  182. {$endif}
  183. size:=4;
  184. end;
  185. freetype:=Used2Free[temptype];
  186. if freetype=tt_none then
  187. internalerror(200208201);
  188. { Align needed size on 4 bytes }
  189. size:=align(size,4);
  190. { First check the tmpfreelist, but not when
  191. we don't want to reuse an already allocated block }
  192. if assigned(tempfreelist) and
  193. (temptype<>tt_noreuse) then
  194. begin
  195. { Check for a slot with the same size first }
  196. hprev:=nil;
  197. hp:=tempfreelist;
  198. while assigned(hp) do
  199. begin
  200. {$ifdef EXTDEBUG}
  201. if not(hp^.temptype in FreeTempTypes) then
  202. Comment(V_Warning,'tgobj: (AllocTemp) temp at pos '+tostr(hp^.pos)+ ' in freelist is not set to tt_free !');
  203. {$endif}
  204. if (hp^.temptype=freetype) and
  205. (hp^.size>=size) then
  206. begin
  207. { Slot is the same size, then leave immediatly }
  208. if hp^.size=size then
  209. begin
  210. bestprev:=hprev;
  211. bestslot:=hp;
  212. bestsize:=size;
  213. break;
  214. end
  215. else
  216. begin
  217. if (bestsize=0) or (hp^.size<bestsize) then
  218. begin
  219. bestprev:=hprev;
  220. bestslot:=hp;
  221. bestsize:=hp^.size;
  222. end;
  223. end;
  224. end;
  225. hprev:=hp;
  226. hp:=hp^.nextfree;
  227. end;
  228. end;
  229. { Reuse an old temp ? }
  230. if assigned(bestslot) then
  231. begin
  232. if bestsize=size then
  233. begin
  234. tl:=bestslot;
  235. tl^.temptype:=temptype;
  236. { Remove from the tempfreelist }
  237. if assigned(bestprev) then
  238. bestprev^.nextfree:=tl^.nextfree
  239. else
  240. tempfreelist:=tl^.nextfree;
  241. tl^.nextfree:=nil;
  242. end
  243. else
  244. begin
  245. { Resize the old block }
  246. dec(bestslot^.size,size);
  247. { Create new block and link after bestslot }
  248. new(tl);
  249. tl^.temptype:=temptype;
  250. if direction=1 then
  251. begin
  252. tl^.pos:=bestslot^.pos;
  253. inc(bestslot^.pos,size);
  254. end
  255. else
  256. tl^.pos:=bestslot^.pos+bestslot^.size;
  257. tl^.size:=size;
  258. tl^.nextfree:=nil;
  259. { link the new block }
  260. tl^.next:=bestslot^.next;
  261. bestslot^.next:=tl;
  262. end;
  263. end
  264. else
  265. begin
  266. { create a new temp, we need to allocate at least a minimum of
  267. 4 bytes, else we get two temps at the same position resulting
  268. in problems when finding the corresponding temprecord }
  269. if size<4 then
  270. size:=4;
  271. { now we can create the templist entry }
  272. new(tl);
  273. tl^.temptype:=temptype;
  274. if direction=-1 then
  275. begin
  276. { Extend the temp }
  277. dec(lasttemp,size);
  278. tl^.pos:=lasttemp;
  279. end
  280. else
  281. begin
  282. tl^.pos:=lasttemp;
  283. { Extend the temp }
  284. inc(lasttemp,size);
  285. end;
  286. tl^.size:=size;
  287. tl^.next:=templist;
  288. tl^.nextfree:=nil;
  289. templist:=tl;
  290. end;
  291. {$ifdef EXTDEBUG}
  292. tl^.posinfo:=aktfilepos;
  293. list.concat(tai_tempalloc.allocinfo(tl^.pos,tl^.size,'allocated with type '+TempTypeStr[tl^.temptype]));
  294. {$else}
  295. list.concat(tai_tempalloc.alloc(tl^.pos,tl^.size));
  296. {$endif}
  297. AllocTemp:=tl^.pos;
  298. end;
  299. procedure ttgobj.FreeTemp(list: taasmoutput; pos:longint;temptypes:ttemptypeset);
  300. var
  301. hp,hnext,hprev,hprevfree : ptemprecord;
  302. begin
  303. hp:=templist;
  304. hprev:=nil;
  305. hprevfree:=nil;
  306. while assigned(hp) do
  307. begin
  308. if (hp^.pos=pos) then
  309. begin
  310. { check if already freed }
  311. if hp^.temptype in FreeTempTypes then
  312. begin
  313. {$ifdef EXTDEBUG}
  314. Comment(V_Warning,'tgobj: (FreeTemp) temp at pos '+tostr(pos)+ ' is already free !');
  315. list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp is already freed'));
  316. {$endif}
  317. exit;
  318. end;
  319. { check type that are allowed to be released }
  320. if not(hp^.temptype in temptypes) then
  321. begin
  322. {$ifdef EXTDEBUG}
  323. Comment(V_Debug,'tgobj: (Freetemp) temp at pos '+tostr(pos)+ ' has different type ('+TempTypeStr[hp^.temptype]+'), not releasing');
  324. list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp has wrong type ('+TempTypeStr[hp^.temptype]+') not releasing'));
  325. {$endif}
  326. exit;
  327. end;
  328. list.concat(tai_tempalloc.dealloc(hp^.pos,hp^.size));
  329. { set this block to free }
  330. hp^.temptype:=Used2Free[hp^.temptype];
  331. { Update tempfreelist }
  332. if assigned(hprevfree) then
  333. begin
  334. { Connect With previous tt_free block? }
  335. if assigned(hprev) and
  336. (hp^.temptype=tt_free) and
  337. (hprev^.temptype=tt_free) then
  338. begin
  339. inc(hprev^.size,hp^.size);
  340. if direction=1 then
  341. hprev^.pos:=hp^.pos;
  342. hprev^.next:=hp^.next;
  343. dispose(hp);
  344. hp:=hprev;
  345. end
  346. else
  347. hprevfree^.nextfree:=hp;
  348. end
  349. else
  350. begin
  351. hp^.nextfree:=tempfreelist;
  352. tempfreelist:=hp;
  353. end;
  354. { Next block tt_free ? Yes, then concat }
  355. hnext:=hp^.next;
  356. if assigned(hnext) and
  357. (hp^.temptype=tt_free) and
  358. (hnext^.temptype=tt_free) then
  359. begin
  360. inc(hp^.size,hnext^.size);
  361. if direction=1 then
  362. hp^.pos:=hnext^.pos;
  363. hp^.nextfree:=hnext^.nextfree;
  364. hp^.next:=hnext^.next;
  365. dispose(hnext);
  366. end;
  367. { Stop }
  368. exit;
  369. end;
  370. if (hp^.temptype=tt_free) then
  371. hprevfree:=hp;
  372. hprev:=hp;
  373. hp:=hp^.next;
  374. end;
  375. end;
  376. procedure ttgobj.gettemp(list: taasmoutput; size : longint;temptype:ttemptype;var ref : treference);
  377. begin
  378. { can't use reference_reset_base, because that will let tgobj depend
  379. on rgobj (PFV) }
  380. fillchar(ref,sizeof(ref),0);
  381. ref.base:=current_procinfo.framepointer;
  382. ref.offset:=alloctemp(list,size,temptype);
  383. end;
  384. function ttgobj.istemp(const ref : treference) : boolean;
  385. begin
  386. { ref.index = R_NO was missing
  387. led to problems with local arrays
  388. with lower bound > 0 (PM) }
  389. if direction = 1 then
  390. begin
  391. istemp:=(ref.base=current_procinfo.framepointer) and
  392. (ref.index=NR_NO) and
  393. (ref.offset>=firsttemp);
  394. end
  395. else
  396. begin
  397. istemp:=(ref.base=current_procinfo.framepointer) and
  398. (ref.index=NR_NO) and
  399. (ref.offset<firsttemp);
  400. end;
  401. end;
  402. function ttgobj.sizeoftemp(list: taasmoutput; const ref: treference): longint;
  403. var
  404. hp : ptemprecord;
  405. begin
  406. SizeOfTemp := -1;
  407. hp:=templist;
  408. while assigned(hp) do
  409. begin
  410. if (hp^.pos=ref.offset) then
  411. begin
  412. sizeoftemp := hp^.size;
  413. exit;
  414. end;
  415. hp := hp^.next;
  416. end;
  417. {$ifdef EXTDEBUG}
  418. comment(v_debug,'tgobj: (SizeOfTemp) temp at pos '+tostr(ref.offset)+' not found !');
  419. list.concat(tai_tempalloc.allocinfo(ref.offset,0,'temp not found'));
  420. {$endif}
  421. end;
  422. function ttgobj.ChangeTempType(list: taasmoutput; const ref:treference;temptype:ttemptype):boolean;
  423. var
  424. hp : ptemprecord;
  425. begin
  426. ChangeTempType:=false;
  427. hp:=templist;
  428. while assigned(hp) do
  429. begin
  430. if (hp^.pos=ref.offset) then
  431. begin
  432. if not(hp^.temptype in [tt_free,tt_freeansistring,tt_freewidestring,tt_freeinterfacecom]) then
  433. begin
  434. {$ifdef EXTDEBUG}
  435. if hp^.temptype=temptype then
  436. Comment(V_Warning,'tgobj: (ChangeTempType) temp'+
  437. ' at pos '+tostr(ref.offset)+ ' is already of the correct type !');
  438. list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'type changed to '+TempTypeStr[temptype]));
  439. {$endif}
  440. ChangeTempType:=true;
  441. hp^.temptype:=temptype;
  442. end
  443. else
  444. begin
  445. {$ifdef EXTDEBUG}
  446. Comment(V_Warning,'tgobj: (ChangeTempType) temp'+
  447. ' at pos '+tostr(ref.offset)+ ' is already freed !');
  448. list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp is already freed'));
  449. {$endif}
  450. end;
  451. exit;
  452. end;
  453. hp:=hp^.next;
  454. end;
  455. {$ifdef EXTDEBUG}
  456. Comment(V_Warning,'tgobj: (ChangeTempType) temp'+
  457. ' at pos '+tostr(ref.offset)+ ' not found !');
  458. list.concat(tai_tempalloc.allocinfo(ref.offset,0,'temp not found'));
  459. {$endif}
  460. end;
  461. procedure ttgobj.UnGetTemp(list: taasmoutput; const ref : treference);
  462. begin
  463. FreeTemp(list,ref.offset,[tt_normal,tt_noreuse,tt_persistent,tt_ansistring,tt_widestring,tt_interfacecom]);
  464. end;
  465. procedure ttgobj.UnGetIfTemp(list: taasmoutput; const ref : treference);
  466. begin
  467. if istemp(ref) then
  468. FreeTemp(list,ref.offset,[tt_normal,tt_ansistring,tt_widestring,tt_interfacecom]);
  469. end;
  470. procedure ttgobj.getlocal(list: taasmoutput; size : longint;var ref : tparareference);
  471. begin
  472. ref.index:=current_procinfo.framepointer;
  473. ref.offset:=alloctemp(list,size,tt_persistent);
  474. end;
  475. procedure ttgobj.UnGetLocal(list: taasmoutput; const ref : tparareference);
  476. begin
  477. FreeTemp(list,ref.offset,[tt_persistent]);
  478. end;
  479. end.
  480. {
  481. $Log$
  482. Revision 1.39 2003-09-23 17:56:06 peter
  483. * locals and paras are allocated in the code generation
  484. * tvarsym.localloc contains the location of para/local when
  485. generating code for the current procedure
  486. Revision 1.38 2003/09/03 15:55:01 peter
  487. * NEWRA branch merged
  488. Revision 1.37.2.2 2003/08/31 15:46:26 peter
  489. * more updates for tregister
  490. Revision 1.37.2.1 2003/08/29 17:28:59 peter
  491. * next batch of updates
  492. Revision 1.37 2003/08/20 17:48:49 peter
  493. * fixed stackalloc to not allocate localst.datasize twice
  494. * order of stackalloc code fixed for implicit init/final
  495. Revision 1.36 2003/07/06 17:58:22 peter
  496. * framepointer fixes for sparc
  497. * parent framepointer code more generic
  498. Revision 1.35 2003/06/03 13:01:59 daniel
  499. * Register allocator finished
  500. Revision 1.34 2003/05/17 13:30:08 jonas
  501. * changed tt_persistant to tt_persistent :)
  502. * tempcreatenode now doesn't accept a boolean anymore for persistent
  503. temps, but a ttemptype, so you can also create ansistring temps etc
  504. Revision 1.33 2003/05/13 20:13:41 florian
  505. * fixed temp. management for CPUs were the temp. space grows upwards
  506. Revision 1.32 2003/05/12 21:29:59 peter
  507. * extdebug info temp alloc type was wrong
  508. Revision 1.31 2003/04/27 11:21:35 peter
  509. * aktprocdef renamed to current_procdef
  510. * procinfo renamed to current_procinfo
  511. * procinfo will now be stored in current_module so it can be
  512. cleaned up properly
  513. * gen_main_procsym changed to create_main_proc and release_main_proc
  514. to also generate a tprocinfo structure
  515. * fixed unit implicit initfinal
  516. Revision 1.30 2003/04/25 20:59:35 peter
  517. * removed funcretn,funcretsym, function result is now in varsym
  518. and aliases for result and function name are added using absolutesym
  519. * vs_hidden parameter for funcret passed in parameter
  520. * vs_hidden fixes
  521. * writenode changed to printnode and released from extdebug
  522. * -vp option added to generate a tree.log with the nodetree
  523. * nicer printnode for statements, callnode
  524. Revision 1.29 2003/04/23 08:40:39 jonas
  525. * fixed istemp() when tg.direction = 1
  526. Revision 1.28 2003/04/22 09:46:17 peter
  527. * always allocate 4 bytes when 0 bytes are asked
  528. Revision 1.27 2003/03/11 21:46:24 jonas
  529. * lots of new regallocator fixes, both in generic and ppc-specific code
  530. (ppc compiler still can't compile the linux system unit though)
  531. Revision 1.26 2003/02/19 22:00:15 daniel
  532. * Code generator converted to new register notation
  533. - Horribily outdated todo.txt removed
  534. Revision 1.25 2003/02/03 23:10:39 daniel
  535. * Fixed last commit
  536. Revision 1.24 2003/02/03 23:07:39 daniel
  537. * Made gettemp use intended procedure for setting reference
  538. Revision 1.23 2003/01/08 18:43:57 daniel
  539. * Tregister changed into a record
  540. Revision 1.22 2002/12/01 18:58:26 carl
  541. * fix bugs with istemp() was wrong, and every reference was a temp
  542. Revision 1.21 2002/11/24 18:18:04 carl
  543. - remove some unused defines
  544. Revision 1.20 2002/11/17 17:49:08 mazen
  545. + return_result_reg and function_result_reg are now used, in all plateforms, to pass functions result between called function and its caller. See the explanation of each one
  546. Revision 1.19 2002/11/15 01:58:54 peter
  547. * merged changes from 1.0.7 up to 04-11
  548. - -V option for generating bug report tracing
  549. - more tracing for option parsing
  550. - errors for cdecl and high()
  551. - win32 import stabs
  552. - win32 records<=8 are returned in eax:edx (turned off by default)
  553. - heaptrc update
  554. - more info for temp management in .s file with EXTDEBUG
  555. Revision 1.18 2002/10/11 11:57:43 florian
  556. *** empty log message ***
  557. Revision 1.16 2002/09/07 18:25:00 florian
  558. + added tcg.direction to allow upwards growing temp areas
  559. i.e. temps with positive index
  560. Revision 1.15 2002/09/01 18:42:50 peter
  561. * reduced level of comment that type is wrong for release
  562. Revision 1.14 2002/09/01 12:14:53 peter
  563. * fixed some wrong levels in extdebug comments
  564. Revision 1.13 2002/08/24 18:35:04 peter
  565. * when reusing a block also update the temptype instead of forcing it
  566. to tt_normal
  567. Revision 1.12 2002/08/23 16:14:49 peter
  568. * tempgen cleanup
  569. * tt_noreuse temp type added that will be used in genentrycode
  570. Revision 1.11 2002/08/17 09:23:44 florian
  571. * first part of procinfo rewrite
  572. Revision 1.10 2002/07/01 18:46:29 peter
  573. * internal linker
  574. * reorganized aasm layer
  575. Revision 1.9 2002/05/18 13:34:21 peter
  576. * readded missing revisions
  577. Revision 1.8 2002/05/16 19:46:45 carl
  578. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  579. + try to fix temp allocation (still in ifdef)
  580. + generic constructor calls
  581. + start of tassembler / tmodulebase class cleanup
  582. Revision 1.7 2002/05/14 19:34:52 peter
  583. * removed old logs and updated copyright year
  584. Revision 1.6 2002/04/15 19:08:22 carl
  585. + target_info.size_of_pointer -> pointer_size
  586. + some cleanup of unused types/variables
  587. Revision 1.5 2002/04/07 13:38:48 carl
  588. + update documentation
  589. Revision 1.4 2002/04/07 09:17:17 carl
  590. + documentation
  591. - clean-up
  592. Revision 1.3 2002/04/04 19:06:06 peter
  593. * removed unused units
  594. * use tlocation.size in cg.a_*loc*() routines
  595. Revision 1.2 2002/04/02 17:11:32 peter
  596. * tlocation,treference update
  597. * LOC_CONSTANT added for better constant handling
  598. * secondadd splitted in multiple routines
  599. * location_force_reg added for loading a location to a register
  600. of a specified size
  601. * secondassignment parses now first the right and then the left node
  602. (this is compatible with Kylix). This saves a lot of push/pop especially
  603. with string operations
  604. * adapted some routines to use the new cg methods
  605. Revision 1.1 2002/03/31 20:26:37 jonas
  606. + a_loadfpu_* and a_loadmm_* methods in tcg
  607. * register allocation is now handled by a class and is mostly processor
  608. independent (+rgobj.pas and i386/rgcpu.pas)
  609. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  610. * some small improvements and fixes to the optimizer
  611. * some register allocation fixes
  612. * some fpuvaroffset fixes in the unary minus node
  613. * push/popusedregisters is now called rg.save/restoreusedregisters and
  614. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  615. also better optimizable)
  616. * fixed and optimized register saving/restoring for new/dispose nodes
  617. * LOC_FPU locations now also require their "register" field to be set to
  618. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  619. - list field removed of the tnode class because it's not used currently
  620. and can cause hard-to-find bugs
  621. }