ncon.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Florian Klaempfl
  4. Type checking and register allocation for constants
  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. unit ncon;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. globtype,widestr,
  23. node,
  24. aasmbase,aasmtai,cpuinfo,globals,
  25. symconst,symtype,symdef,symsym;
  26. type
  27. trealconstnode = class(tnode)
  28. restype : ttype;
  29. value_real : bestreal;
  30. lab_real : tasmlabel;
  31. constructor create(v : bestreal;const t:ttype);virtual;
  32. function getcopy : tnode;override;
  33. function pass_1 : tnode;override;
  34. function det_resulttype:tnode;override;
  35. function docompare(p: tnode) : boolean; override;
  36. end;
  37. trealconstnodeclass = class of trealconstnode;
  38. tordconstnode = class(tnode)
  39. restype : ttype;
  40. value : TConstExprInt;
  41. constructor create(v : tconstexprint;const t:ttype);virtual;
  42. function getcopy : tnode;override;
  43. function pass_1 : tnode;override;
  44. function det_resulttype:tnode;override;
  45. function docompare(p: tnode) : boolean; override;
  46. {$ifdef extdebug}
  47. procedure dowrite;override;
  48. {$endif}
  49. end;
  50. tordconstnodeclass = class of tordconstnode;
  51. tpointerconstnode = class(tnode)
  52. restype : ttype;
  53. value : TConstPtrUInt;
  54. constructor create(v : TConstPtrUInt;const t:ttype);virtual;
  55. function getcopy : tnode;override;
  56. function pass_1 : tnode;override;
  57. function det_resulttype:tnode;override;
  58. function docompare(p: tnode) : boolean; override;
  59. end;
  60. tpointerconstnodeclass = class of tpointerconstnode;
  61. tstringconstnode = class(tnode)
  62. value_str : pchar;
  63. len : longint;
  64. lab_str : tasmlabel;
  65. st_type : tstringtype;
  66. constructor createstr(const s : string;st:tstringtype);virtual;
  67. constructor createpchar(s : pchar;l : longint);virtual;
  68. constructor createwstr(w : pcompilerwidestring);virtual;
  69. destructor destroy;override;
  70. function getcopy : tnode;override;
  71. function pass_1 : tnode;override;
  72. function det_resulttype:tnode;override;
  73. function getpcharcopy : pchar;
  74. function docompare(p: tnode) : boolean; override;
  75. end;
  76. tstringconstnodeclass = class of tstringconstnode;
  77. tsetconstnode = class(tunarynode)
  78. restype : ttype;
  79. value_set : pconstset;
  80. lab_set : tasmlabel;
  81. constructor create(s : pconstset;const t:ttype);virtual;
  82. destructor destroy;override;
  83. function getcopy : tnode;override;
  84. function pass_1 : tnode;override;
  85. function det_resulttype:tnode;override;
  86. function docompare(p: tnode) : boolean; override;
  87. end;
  88. tsetconstnodeclass = class of tsetconstnode;
  89. tnilnode = class(tnode)
  90. constructor create;virtual;
  91. function pass_1 : tnode;override;
  92. function det_resulttype:tnode;override;
  93. end;
  94. tnilnodeclass = class of tnilnode;
  95. tguidconstnode = class(tnode)
  96. value : tguid;
  97. constructor create(const g:tguid);virtual;
  98. function getcopy : tnode;override;
  99. function pass_1 : tnode;override;
  100. function det_resulttype:tnode;override;
  101. function docompare(p: tnode) : boolean; override;
  102. end;
  103. tguidconstnodeclass = class of tguidconstnode;
  104. var
  105. crealconstnode : trealconstnodeclass;
  106. cordconstnode : tordconstnodeclass;
  107. cpointerconstnode : tpointerconstnodeclass;
  108. cstringconstnode : tstringconstnodeclass;
  109. csetconstnode : tsetconstnodeclass;
  110. cguidconstnode : tguidconstnodeclass;
  111. cnilnode : tnilnodeclass;
  112. function genintconstnode(v : TConstExprInt) : tordconstnode;
  113. function genenumnode(v : tenumsym) : tordconstnode;
  114. { some helper routines }
  115. {$ifdef INT64FUNCRESOK}
  116. function get_ordinal_value(p : tnode) : TConstExprInt;
  117. {$else INT64FUNCRESOK}
  118. function get_ordinal_value(p : tnode) : longint;
  119. {$endif INT64FUNCRESOK}
  120. function is_constnode(p : tnode) : boolean;
  121. function is_constintnode(p : tnode) : boolean;
  122. function is_constcharnode(p : tnode) : boolean;
  123. function is_constrealnode(p : tnode) : boolean;
  124. function is_constboolnode(p : tnode) : boolean;
  125. function is_constresourcestringnode(p : tnode) : boolean;
  126. function is_constwidecharnode(p : tnode) : boolean;
  127. function str_length(p : tnode) : longint;
  128. function is_emptyset(p : tnode):boolean;
  129. function genconstsymtree(p : tconstsym) : tnode;
  130. implementation
  131. uses
  132. cutils,verbose,systems,
  133. defbase,cpubase,nld;
  134. function genintconstnode(v : TConstExprInt) : tordconstnode;
  135. var
  136. i,i2 : TConstExprInt;
  137. begin
  138. { we need to bootstrap this code, so it's a little bit messy }
  139. i:=2147483647;
  140. { maxcardinal }
  141. i2 := i+i+1;
  142. if (v<=i) and (v>=-i-1) then
  143. genintconstnode:=cordconstnode.create(v,s32bittype)
  144. else if (v > i) and (v <= i2) then
  145. genintconstnode:=cordconstnode.create(v,u32bittype)
  146. else
  147. genintconstnode:=cordconstnode.create(v,cs64bittype);
  148. end;
  149. function genenumnode(v : tenumsym) : tordconstnode;
  150. var
  151. htype : ttype;
  152. begin
  153. htype.setdef(v.definition);
  154. genenumnode:=cordconstnode.create(v.value,htype);
  155. end;
  156. {$ifdef INT64FUNCRESOK}
  157. function get_ordinal_value(p : tnode) : TConstExprInt;
  158. {$else INT64FUNCRESOK}
  159. function get_ordinal_value(p : tnode) : longint;
  160. {$endif INT64FUNCRESOK}
  161. begin
  162. if p.nodetype=ordconstn then
  163. get_ordinal_value:=tordconstnode(p).value
  164. else
  165. begin
  166. Message(type_e_ordinal_expr_expected);
  167. get_ordinal_value:=0;
  168. end;
  169. end;
  170. function is_constnode(p : tnode) : boolean;
  171. begin
  172. is_constnode:=(p.nodetype in [ordconstn,realconstn,stringconstn,setconstn,guidconstn]);
  173. end;
  174. function is_constintnode(p : tnode) : boolean;
  175. begin
  176. is_constintnode:=(p.nodetype=ordconstn) and is_integer(p.resulttype.def);
  177. end;
  178. function is_constcharnode(p : tnode) : boolean;
  179. begin
  180. is_constcharnode:=(p.nodetype=ordconstn) and is_char(p.resulttype.def);
  181. end;
  182. function is_constwidecharnode(p : tnode) : boolean;
  183. begin
  184. is_constwidecharnode:=(p.nodetype=ordconstn) and is_widechar(p.resulttype.def);
  185. end;
  186. function is_constrealnode(p : tnode) : boolean;
  187. begin
  188. is_constrealnode:=(p.nodetype=realconstn);
  189. end;
  190. function is_constboolnode(p : tnode) : boolean;
  191. begin
  192. is_constboolnode:=(p.nodetype=ordconstn) and is_boolean(p.resulttype.def);
  193. end;
  194. function is_constresourcestringnode(p : tnode) : boolean;
  195. begin
  196. is_constresourcestringnode:=(p.nodetype=loadn) and
  197. (tloadnode(p).symtableentry.typ=constsym) and
  198. (tconstsym(tloadnode(p).symtableentry).consttyp=constresourcestring);
  199. end;
  200. function str_length(p : tnode) : longint;
  201. begin
  202. str_length:=tstringconstnode(p).len;
  203. end;
  204. {$ifdef oldset}
  205. function is_emptyset(p : tnode):boolean;
  206. var
  207. i : longint;
  208. begin
  209. i:=0;
  210. if p.nodetype=setconstn then
  211. begin
  212. while (i<32) and (tsetconstnode(p).value_set^[i]=0) do
  213. inc(i);
  214. end;
  215. is_emptyset:=(i=32);
  216. end;
  217. {$else}
  218. function is_emptyset(p : tnode):boolean;
  219. begin
  220. is_emptyset:=(p.nodetype=setconstn) and
  221. (Tsetconstnode(p).value_set^=[]);
  222. end;
  223. {$endif}
  224. function genconstsymtree(p : tconstsym) : tnode;
  225. var
  226. p1 : tnode;
  227. len : longint;
  228. pc : pchar;
  229. begin
  230. p1:=nil;
  231. case p.consttyp of
  232. constint :
  233. p1:=genintconstnode(p.valueord);
  234. conststring :
  235. begin
  236. len:=p.len;
  237. if not(cs_ansistrings in aktlocalswitches) and (len>255) then
  238. len:=255;
  239. getmem(pc,len+1);
  240. move(pchar(p.valueptr)^,pc^,len);
  241. pc[len]:=#0;
  242. p1:=cstringconstnode.createpchar(pc,len);
  243. end;
  244. constchar :
  245. p1:=cordconstnode.create(p.valueord,cchartype);
  246. constreal :
  247. p1:=crealconstnode.create(pbestreal(p.valueptr)^,pbestrealtype^);
  248. constbool :
  249. p1:=cordconstnode.create(p.valueord,booltype);
  250. constset :
  251. p1:=csetconstnode.create(pconstset(p.valueptr),p.consttype);
  252. constord :
  253. p1:=cordconstnode.create(p.valueord,p.consttype);
  254. constpointer :
  255. p1:=cpointerconstnode.create(p.valueordptr,p.consttype);
  256. constnil :
  257. p1:=cnilnode.create;
  258. else
  259. internalerror(200205103);
  260. end;
  261. genconstsymtree:=p1;
  262. end;
  263. {*****************************************************************************
  264. TREALCONSTNODE
  265. *****************************************************************************}
  266. { generic code }
  267. { overridden by: }
  268. { i386 }
  269. constructor trealconstnode.create(v : bestreal;const t:ttype);
  270. begin
  271. inherited create(realconstn);
  272. restype:=t;
  273. value_real:=v;
  274. lab_real:=nil;
  275. end;
  276. function trealconstnode.getcopy : tnode;
  277. var
  278. n : trealconstnode;
  279. begin
  280. n:=trealconstnode(inherited getcopy);
  281. n.value_real:=value_real;
  282. n.lab_real:=lab_real;
  283. getcopy:=n;
  284. end;
  285. function trealconstnode.det_resulttype:tnode;
  286. begin
  287. result:=nil;
  288. resulttype:=restype;
  289. end;
  290. function trealconstnode.pass_1 : tnode;
  291. begin
  292. result:=nil;
  293. location.loc:=LOC_CREFERENCE;
  294. { needs to be loaded into an FPU register }
  295. registersfpu:=1;
  296. end;
  297. function trealconstnode.docompare(p: tnode): boolean;
  298. begin
  299. docompare :=
  300. inherited docompare(p) and
  301. (value_real = trealconstnode(p).value_real);
  302. end;
  303. {*****************************************************************************
  304. TORDCONSTNODE
  305. *****************************************************************************}
  306. constructor tordconstnode.create(v : tconstexprint;const t:ttype);
  307. begin
  308. inherited create(ordconstn);
  309. value:=v;
  310. restype:=t;
  311. end;
  312. function tordconstnode.getcopy : tnode;
  313. var
  314. n : tordconstnode;
  315. begin
  316. n:=tordconstnode(inherited getcopy);
  317. n.value:=value;
  318. n.restype := restype;
  319. getcopy:=n;
  320. end;
  321. function tordconstnode.det_resulttype:tnode;
  322. begin
  323. result:=nil;
  324. resulttype:=restype;
  325. testrange(resulttype.def,value,false);
  326. end;
  327. function tordconstnode.pass_1 : tnode;
  328. begin
  329. result:=nil;
  330. if is_64bitint(resulttype.def) then
  331. location.loc:=LOC_CREFERENCE
  332. else
  333. location.loc:=LOC_CONSTANT;
  334. end;
  335. function tordconstnode.docompare(p: tnode): boolean;
  336. begin
  337. docompare :=
  338. inherited docompare(p) and
  339. (value = tordconstnode(p).value);
  340. end;
  341. {$ifdef extdebug}
  342. procedure Tordconstnode.dowrite;
  343. begin
  344. inherited dowrite;
  345. write('[',value,']');
  346. end;
  347. {$endif}
  348. {*****************************************************************************
  349. TPOINTERCONSTNODE
  350. *****************************************************************************}
  351. constructor tpointerconstnode.create(v : TConstPtrUInt;const t:ttype);
  352. begin
  353. inherited create(pointerconstn);
  354. value:=v;
  355. restype:=t;
  356. end;
  357. function tpointerconstnode.getcopy : tnode;
  358. var
  359. n : tpointerconstnode;
  360. begin
  361. n:=tpointerconstnode(inherited getcopy);
  362. n.value:=value;
  363. n.restype := restype;
  364. getcopy:=n;
  365. end;
  366. function tpointerconstnode.det_resulttype:tnode;
  367. begin
  368. result:=nil;
  369. resulttype:=restype;
  370. end;
  371. function tpointerconstnode.pass_1 : tnode;
  372. begin
  373. result:=nil;
  374. location.loc:=LOC_CONSTANT;
  375. end;
  376. function tpointerconstnode.docompare(p: tnode): boolean;
  377. begin
  378. docompare :=
  379. inherited docompare(p) and
  380. (value = tpointerconstnode(p).value);
  381. end;
  382. {*****************************************************************************
  383. TSTRINGCONSTNODE
  384. *****************************************************************************}
  385. constructor tstringconstnode.createstr(const s : string;st:tstringtype);
  386. var
  387. l : longint;
  388. begin
  389. inherited create(stringconstn);
  390. l:=length(s);
  391. len:=l;
  392. { stringdup write even past a #0 }
  393. getmem(value_str,l+1);
  394. move(s[1],value_str^,l);
  395. value_str[l]:=#0;
  396. lab_str:=nil;
  397. if st=st_default then
  398. begin
  399. if cs_ansistrings in aktlocalswitches then
  400. st_type:=st_ansistring
  401. else
  402. st_type:=st_shortstring;
  403. end
  404. else
  405. st_type:=st;
  406. end;
  407. constructor tstringconstnode.createwstr(w : pcompilerwidestring);
  408. begin
  409. inherited create(stringconstn);
  410. len:=getlengthwidestring(w);
  411. initwidestring(pcompilerwidestring(value_str));
  412. copywidestring(w,pcompilerwidestring(value_str));
  413. lab_str:=nil;
  414. st_type:=st_widestring;
  415. end;
  416. constructor tstringconstnode.createpchar(s : pchar;l : longint);
  417. begin
  418. inherited create(stringconstn);
  419. len:=l;
  420. value_str:=s;
  421. if (cs_ansistrings in aktlocalswitches) or
  422. (len>255) then
  423. st_type:=st_ansistring
  424. else
  425. st_type:=st_shortstring;
  426. lab_str:=nil;
  427. end;
  428. destructor tstringconstnode.destroy;
  429. begin
  430. if st_type=st_widestring then
  431. donewidestring(pcompilerwidestring(value_str))
  432. else
  433. ansistringdispose(value_str,len);
  434. inherited destroy;
  435. end;
  436. function tstringconstnode.getcopy : tnode;
  437. var
  438. n : tstringconstnode;
  439. begin
  440. n:=tstringconstnode(inherited getcopy);
  441. n.st_type:=st_type;
  442. n.len:=len;
  443. n.lab_str:=lab_str;
  444. if st_type=st_widestring then
  445. begin
  446. initwidestring(pcompilerwidestring(n.value_str));
  447. copywidestring(pcompilerwidestring(value_str),pcompilerwidestring(n.value_str));
  448. end
  449. else
  450. n.value_str:=getpcharcopy;
  451. getcopy:=n;
  452. end;
  453. function tstringconstnode.det_resulttype:tnode;
  454. begin
  455. result:=nil;
  456. case st_type of
  457. st_shortstring :
  458. resulttype:=cshortstringtype;
  459. st_ansistring :
  460. resulttype:=cansistringtype;
  461. st_widestring :
  462. resulttype:=cwidestringtype;
  463. st_longstring :
  464. resulttype:=clongstringtype;
  465. end;
  466. end;
  467. function tstringconstnode.pass_1 : tnode;
  468. begin
  469. result:=nil;
  470. location.loc:=LOC_CREFERENCE;
  471. end;
  472. function tstringconstnode.getpcharcopy : pchar;
  473. var
  474. pc : pchar;
  475. begin
  476. pc:=nil;
  477. getmem(pc,len+1);
  478. if pc=nil then
  479. Message(general_f_no_memory_left);
  480. move(value_str^,pc^,len+1);
  481. getpcharcopy:=pc;
  482. end;
  483. function tstringconstnode.docompare(p: tnode): boolean;
  484. begin
  485. docompare :=
  486. inherited docompare(p) and
  487. (len = tstringconstnode(p).len) and
  488. { Don't compare the pchars, since they may contain null chars }
  489. { Since all equal constant strings are replaced by the same }
  490. { label, the following compare should be enough (JM) }
  491. (lab_str = tstringconstnode(p).lab_str);
  492. end;
  493. {*****************************************************************************
  494. TSETCONSTNODE
  495. *****************************************************************************}
  496. constructor tsetconstnode.create(s : pconstset;const t:ttype);
  497. begin
  498. inherited create(setconstn,nil);
  499. restype:=t;
  500. if assigned(s) then
  501. begin
  502. new(value_set);
  503. value_set^:=s^;
  504. end
  505. else
  506. value_set:=nil;
  507. end;
  508. destructor tsetconstnode.destroy;
  509. begin
  510. if assigned(value_set) then
  511. dispose(value_set);
  512. inherited destroy;
  513. end;
  514. function tsetconstnode.getcopy : tnode;
  515. var
  516. n : tsetconstnode;
  517. begin
  518. n:=tsetconstnode(inherited getcopy);
  519. if assigned(value_set) then
  520. begin
  521. new(n.value_set);
  522. n.value_set^:=value_set^
  523. end
  524. else
  525. n.value_set:=nil;
  526. n.restype := restype;
  527. n.lab_set:=lab_set;
  528. getcopy:=n;
  529. end;
  530. function tsetconstnode.det_resulttype:tnode;
  531. begin
  532. result:=nil;
  533. resulttype:=restype;
  534. end;
  535. function tsetconstnode.pass_1 : tnode;
  536. begin
  537. result:=nil;
  538. if tsetdef(resulttype.def).settype=smallset then
  539. location.loc:=LOC_CONSTANT
  540. else
  541. location.loc:=LOC_CREFERENCE;
  542. end;
  543. {$ifdef oldset}
  544. function tsetconstnode.docompare(p: tnode): boolean;
  545. var
  546. i: 0..31;
  547. begin
  548. if inherited docompare(p) then
  549. begin
  550. for i := 0 to 31 do
  551. if (value_set^[i] <> tsetconstnode(p).value_set^[i]) then
  552. begin
  553. docompare := false;
  554. exit
  555. end;
  556. docompare := true;
  557. end
  558. else
  559. docompare := false;
  560. end;
  561. {$else}
  562. function tsetconstnode.docompare(p: tnode): boolean;
  563. begin
  564. docompare:=(inherited docompare(p))
  565. and (value_set^=Tsetconstnode(p).value_set^);
  566. end;
  567. {$endif}
  568. {*****************************************************************************
  569. TNILNODE
  570. *****************************************************************************}
  571. constructor tnilnode.create;
  572. begin
  573. inherited create(niln);
  574. end;
  575. function tnilnode.det_resulttype:tnode;
  576. begin
  577. result:=nil;
  578. resulttype:=voidpointertype;
  579. end;
  580. function tnilnode.pass_1 : tnode;
  581. begin
  582. result:=nil;
  583. location.loc:=LOC_CONSTANT;
  584. end;
  585. {*****************************************************************************
  586. TGUIDCONSTNODE
  587. *****************************************************************************}
  588. constructor tguidconstnode.create(const g:tguid);
  589. begin
  590. inherited create(guidconstn);
  591. value:=g;
  592. end;
  593. function tguidconstnode.getcopy : tnode;
  594. var
  595. n : tguidconstnode;
  596. begin
  597. n:=tguidconstnode(inherited getcopy);
  598. n.value:=value;
  599. getcopy:=n;
  600. end;
  601. function tguidconstnode.det_resulttype:tnode;
  602. begin
  603. result:=nil;
  604. resulttype.setdef(rec_tguid);
  605. end;
  606. function tguidconstnode.pass_1 : tnode;
  607. begin
  608. result:=nil;
  609. location.loc:=LOC_CREFERENCE;
  610. end;
  611. function tguidconstnode.docompare(p: tnode): boolean;
  612. begin
  613. docompare :=
  614. inherited docompare(p) and
  615. (guid2string(value) = guid2string(tguidconstnode(p).value));
  616. end;
  617. begin
  618. crealconstnode:=trealconstnode;
  619. cordconstnode:=tordconstnode;
  620. cpointerconstnode:=tpointerconstnode;
  621. cstringconstnode:=tstringconstnode;
  622. csetconstnode:=tsetconstnode;
  623. cnilnode:=tnilnode;
  624. cguidconstnode:=tguidconstnode;
  625. end.
  626. {
  627. $Log$
  628. Revision 1.37 2002-07-23 12:34:30 daniel
  629. * Readded old set code. To use it define 'oldset'. Activated by default
  630. for ppc.
  631. Revision 1.36 2002/07/22 11:48:04 daniel
  632. * Sets are now internally sets.
  633. Revision 1.35 2002/07/20 11:57:54 florian
  634. * types.pas renamed to defbase.pas because D6 contains a types
  635. unit so this would conflicts if D6 programms are compiled
  636. + Willamette/SSE2 instructions to assembler added
  637. Revision 1.34 2002/07/14 18:00:43 daniel
  638. + Added the beginning of a state tracker. This will track the values of
  639. variables through procedures and optimize things away.
  640. Revision 1.33 2002/07/01 18:46:23 peter
  641. * internal linker
  642. * reorganized aasm layer
  643. Revision 1.32 2002/05/18 13:34:09 peter
  644. * readded missing revisions
  645. Revision 1.31 2002/05/16 19:46:37 carl
  646. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  647. + try to fix temp allocation (still in ifdef)
  648. + generic constructor calls
  649. + start of tassembler / tmodulebase class cleanup
  650. Revision 1.29 2002/05/12 16:53:07 peter
  651. * moved entry and exitcode to ncgutil and cgobj
  652. * foreach gets extra argument for passing local data to the
  653. iterator function
  654. * -CR checks also class typecasts at runtime by changing them
  655. into as
  656. * fixed compiler to cycle with the -CR option
  657. * fixed stabs with elf writer, finally the global variables can
  658. be watched
  659. * removed a lot of routines from cga unit and replaced them by
  660. calls to cgobj
  661. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  662. u32bit then the other is typecasted also to u32bit without giving
  663. a rangecheck warning/error.
  664. * fixed pascal calling method with reversing also the high tree in
  665. the parast, detected by tcalcst3 test
  666. Revision 1.28 2002/04/07 13:25:20 carl
  667. + change unit use
  668. Revision 1.27 2002/04/04 19:05:58 peter
  669. * removed unused units
  670. * use tlocation.size in cg.a_*loc*() routines
  671. Revision 1.26 2002/04/02 17:11:29 peter
  672. * tlocation,treference update
  673. * LOC_CONSTANT added for better constant handling
  674. * secondadd splitted in multiple routines
  675. * location_force_reg added for loading a location to a register
  676. of a specified size
  677. * secondassignment parses now first the right and then the left node
  678. (this is compatible with Kylix). This saves a lot of push/pop especially
  679. with string operations
  680. * adapted some routines to use the new cg methods
  681. Revision 1.25 2002/03/04 19:10:11 peter
  682. * removed compiler warnings
  683. }