tgobj.pas 24 KB

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