tgobj.pas 25 KB

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