tgobj.pas 24 KB

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