tgobj.pas 24 KB

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