ncon.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. {
  2. $Id$
  3. Copyright (c) 2000 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 defines.inc}
  20. interface
  21. uses
  22. globtype,widestr,
  23. node,
  24. aasm,cpuinfo,
  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. end;
  47. tordconstnodeclass = class of tordconstnode;
  48. tpointerconstnode = class(tnode)
  49. restype : ttype;
  50. value : TConstPtrUInt;
  51. constructor create(v : TConstPtrUInt;const t:ttype);virtual;
  52. function getcopy : tnode;override;
  53. function pass_1 : tnode;override;
  54. function det_resulttype:tnode;override;
  55. function docompare(p: tnode) : boolean; override;
  56. end;
  57. tpointerconstnodeclass = class of tpointerconstnode;
  58. tstringconstnode = class(tnode)
  59. value_str : pchar;
  60. len : longint;
  61. lab_str : tasmlabel;
  62. st_type : tstringtype;
  63. constructor createstr(const s : string;st:tstringtype);virtual;
  64. constructor createpchar(s : pchar;l : longint);virtual;
  65. constructor createwstr(w : pcompilerwidestring);virtual;
  66. destructor destroy;override;
  67. function getcopy : tnode;override;
  68. function pass_1 : tnode;override;
  69. function det_resulttype:tnode;override;
  70. function getpcharcopy : pchar;
  71. function docompare(p: tnode) : boolean; override;
  72. end;
  73. tstringconstnodeclass = class of tstringconstnode;
  74. tsetconstnode = class(tunarynode)
  75. restype : ttype;
  76. value_set : pconstset;
  77. lab_set : tasmlabel;
  78. constructor create(s : pconstset;const t:ttype);virtual;
  79. destructor destroy;override;
  80. function getcopy : tnode;override;
  81. function pass_1 : tnode;override;
  82. function det_resulttype:tnode;override;
  83. function docompare(p: tnode) : boolean; override;
  84. end;
  85. tsetconstnodeclass = class of tsetconstnode;
  86. tnilnode = class(tnode)
  87. constructor create;virtual;
  88. function pass_1 : tnode;override;
  89. function det_resulttype:tnode;override;
  90. end;
  91. tnilnodeclass = class of tnilnode;
  92. tguidconstnode = class(tnode)
  93. value : tguid;
  94. constructor create(const g:tguid);virtual;
  95. function getcopy : tnode;override;
  96. function pass_1 : tnode;override;
  97. function det_resulttype:tnode;override;
  98. function docompare(p: tnode) : boolean; override;
  99. end;
  100. tguidconstnodeclass = class of tguidconstnode;
  101. var
  102. crealconstnode : trealconstnodeclass;
  103. cordconstnode : tordconstnodeclass;
  104. cpointerconstnode : tpointerconstnodeclass;
  105. cstringconstnode : tstringconstnodeclass;
  106. csetconstnode : tsetconstnodeclass;
  107. cguidconstnode : tguidconstnodeclass;
  108. cnilnode : tnilnodeclass;
  109. function genintconstnode(v : TConstExprInt) : tordconstnode;
  110. function genenumnode(v : tenumsym) : tordconstnode;
  111. { some helper routines }
  112. {$ifdef INT64FUNCRESOK}
  113. function get_ordinal_value(p : tnode) : TConstExprInt;
  114. {$else INT64FUNCRESOK}
  115. function get_ordinal_value(p : tnode) : longint;
  116. {$endif INT64FUNCRESOK}
  117. function is_constnode(p : tnode) : boolean;
  118. function is_constintnode(p : tnode) : boolean;
  119. function is_constcharnode(p : tnode) : boolean;
  120. function is_constrealnode(p : tnode) : boolean;
  121. function is_constboolnode(p : tnode) : boolean;
  122. function is_constresourcestringnode(p : tnode) : boolean;
  123. function is_constwidecharnode(p : tnode) : boolean;
  124. function str_length(p : tnode) : longint;
  125. function is_emptyset(p : tnode):boolean;
  126. function genconstsymtree(p : tconstsym) : tnode;
  127. implementation
  128. uses
  129. cutils,verbose,globals,systems,
  130. types,cpubase,nld;
  131. function genintconstnode(v : TConstExprInt) : tordconstnode;
  132. var
  133. i,i2 : TConstExprInt;
  134. begin
  135. { we need to bootstrap this code, so it's a little bit messy }
  136. i:=2147483647;
  137. { maxcardinal }
  138. i2 := i+i+1;
  139. if (v<=i) and (v>=-i-1) then
  140. genintconstnode:=cordconstnode.create(v,s32bittype)
  141. else if (v > i) and (v <= i2) then
  142. genintconstnode:=cordconstnode.create(v,u32bittype)
  143. else
  144. genintconstnode:=cordconstnode.create(v,cs64bittype);
  145. end;
  146. function genenumnode(v : tenumsym) : tordconstnode;
  147. var
  148. htype : ttype;
  149. begin
  150. htype.setdef(v.definition);
  151. genenumnode:=cordconstnode.create(v.value,htype);
  152. end;
  153. {$ifdef INT64FUNCRESOK}
  154. function get_ordinal_value(p : tnode) : TConstExprInt;
  155. {$else INT64FUNCRESOK}
  156. function get_ordinal_value(p : tnode) : longint;
  157. {$endif INT64FUNCRESOK}
  158. begin
  159. if p.nodetype=ordconstn then
  160. get_ordinal_value:=tordconstnode(p).value
  161. else
  162. begin
  163. Message(type_e_ordinal_expr_expected);
  164. get_ordinal_value:=0;
  165. end;
  166. end;
  167. function is_constnode(p : tnode) : boolean;
  168. begin
  169. is_constnode:=(p.nodetype in [ordconstn,realconstn,stringconstn,setconstn,guidconstn]);
  170. end;
  171. function is_constintnode(p : tnode) : boolean;
  172. begin
  173. is_constintnode:=(p.nodetype=ordconstn) and is_integer(p.resulttype.def);
  174. end;
  175. function is_constcharnode(p : tnode) : boolean;
  176. begin
  177. is_constcharnode:=(p.nodetype=ordconstn) and is_char(p.resulttype.def);
  178. end;
  179. function is_constwidecharnode(p : tnode) : boolean;
  180. begin
  181. is_constwidecharnode:=(p.nodetype=ordconstn) and is_widechar(p.resulttype.def);
  182. end;
  183. function is_constrealnode(p : tnode) : boolean;
  184. begin
  185. is_constrealnode:=(p.nodetype=realconstn);
  186. end;
  187. function is_constboolnode(p : tnode) : boolean;
  188. begin
  189. is_constboolnode:=(p.nodetype=ordconstn) and is_boolean(p.resulttype.def);
  190. end;
  191. function is_constresourcestringnode(p : tnode) : boolean;
  192. begin
  193. is_constresourcestringnode:=(p.nodetype=loadn) and
  194. (tloadnode(p).symtableentry.typ=constsym) and
  195. (tconstsym(tloadnode(p).symtableentry).consttyp=constresourcestring);
  196. end;
  197. function str_length(p : tnode) : longint;
  198. begin
  199. str_length:=tstringconstnode(p).len;
  200. end;
  201. function is_emptyset(p : tnode):boolean;
  202. var
  203. i : longint;
  204. begin
  205. i:=0;
  206. if p.nodetype=setconstn then
  207. begin
  208. while (i<32) and (tsetconstnode(p).value_set^[i]=0) do
  209. inc(i);
  210. end;
  211. is_emptyset:=(i=32);
  212. end;
  213. function genconstsymtree(p : tconstsym) : tnode;
  214. var
  215. p1 : tnode;
  216. len : longint;
  217. pc : pchar;
  218. begin
  219. p1:=nil;
  220. case p.consttyp of
  221. constint :
  222. p1:=genintconstnode(p.valueord);
  223. conststring :
  224. begin
  225. len:=p.len;
  226. if not(cs_ansistrings in aktlocalswitches) and (len>255) then
  227. len:=255;
  228. getmem(pc,len+1);
  229. move(pchar(p.valueptr)^,pc^,len);
  230. pc[len]:=#0;
  231. p1:=cstringconstnode.createpchar(pc,len);
  232. end;
  233. constchar :
  234. p1:=cordconstnode.create(p.valueord,cchartype);
  235. constreal :
  236. p1:=crealconstnode.create(pbestreal(p.valueptr)^,pbestrealtype^);
  237. constbool :
  238. p1:=cordconstnode.create(p.valueord,booltype);
  239. constset :
  240. p1:=csetconstnode.create(pconstset(p.valueptr),p.consttype);
  241. constord :
  242. p1:=cordconstnode.create(p.valueord,p.consttype);
  243. constpointer :
  244. p1:=cpointerconstnode.create(p.valueordptr,p.consttype);
  245. constnil :
  246. p1:=cnilnode.create;
  247. constresourcestring:
  248. begin
  249. p1:=cloadnode.create(tvarsym(p),tvarsym(p).owner);
  250. p1.resulttype:=cansistringtype;
  251. end;
  252. end;
  253. genconstsymtree:=p1;
  254. end;
  255. {*****************************************************************************
  256. TREALCONSTNODE
  257. *****************************************************************************}
  258. { generic code }
  259. { overridden by: }
  260. { i386 }
  261. constructor trealconstnode.create(v : bestreal;const t:ttype);
  262. begin
  263. inherited create(realconstn);
  264. restype:=t;
  265. value_real:=v;
  266. lab_real:=nil;
  267. end;
  268. function trealconstnode.getcopy : tnode;
  269. var
  270. n : trealconstnode;
  271. begin
  272. n:=trealconstnode(inherited getcopy);
  273. n.value_real:=value_real;
  274. n.lab_real:=lab_real;
  275. getcopy:=n;
  276. end;
  277. function trealconstnode.det_resulttype:tnode;
  278. begin
  279. result:=nil;
  280. resulttype:=restype;
  281. end;
  282. function trealconstnode.pass_1 : tnode;
  283. begin
  284. result:=nil;
  285. location.loc:=LOC_CREFERENCE;
  286. { needs to be loaded into an FPU register }
  287. registersfpu:=1;
  288. end;
  289. function trealconstnode.docompare(p: tnode): boolean;
  290. begin
  291. docompare :=
  292. inherited docompare(p) and
  293. (value_real = trealconstnode(p).value_real);
  294. end;
  295. {*****************************************************************************
  296. TORDCONSTNODE
  297. *****************************************************************************}
  298. constructor tordconstnode.create(v : tconstexprint;const t:ttype);
  299. begin
  300. inherited create(ordconstn);
  301. value:=v;
  302. restype:=t;
  303. end;
  304. function tordconstnode.getcopy : tnode;
  305. var
  306. n : tordconstnode;
  307. begin
  308. n:=tordconstnode(inherited getcopy);
  309. n.value:=value;
  310. n.restype := restype;
  311. getcopy:=n;
  312. end;
  313. function tordconstnode.det_resulttype:tnode;
  314. begin
  315. result:=nil;
  316. resulttype:=restype;
  317. testrange(resulttype.def,value,false);
  318. end;
  319. function tordconstnode.pass_1 : tnode;
  320. begin
  321. result:=nil;
  322. if is_64bitint(resulttype.def) then
  323. location.loc:=LOC_CREFERENCE
  324. else
  325. location.loc:=LOC_CONSTANT;
  326. end;
  327. function tordconstnode.docompare(p: tnode): boolean;
  328. begin
  329. docompare :=
  330. inherited docompare(p) and
  331. (value = tordconstnode(p).value);
  332. end;
  333. {*****************************************************************************
  334. TPOINTERCONSTNODE
  335. *****************************************************************************}
  336. constructor tpointerconstnode.create(v : TConstPtrUInt;const t:ttype);
  337. begin
  338. inherited create(pointerconstn);
  339. value:=v;
  340. restype:=t;
  341. end;
  342. function tpointerconstnode.getcopy : tnode;
  343. var
  344. n : tpointerconstnode;
  345. begin
  346. n:=tpointerconstnode(inherited getcopy);
  347. n.value:=value;
  348. n.restype := restype;
  349. getcopy:=n;
  350. end;
  351. function tpointerconstnode.det_resulttype:tnode;
  352. begin
  353. result:=nil;
  354. resulttype:=restype;
  355. end;
  356. function tpointerconstnode.pass_1 : tnode;
  357. begin
  358. result:=nil;
  359. location.loc:=LOC_CONSTANT;
  360. end;
  361. function tpointerconstnode.docompare(p: tnode): boolean;
  362. begin
  363. docompare :=
  364. inherited docompare(p) and
  365. (value = tpointerconstnode(p).value);
  366. end;
  367. {*****************************************************************************
  368. TSTRINGCONSTNODE
  369. *****************************************************************************}
  370. constructor tstringconstnode.createstr(const s : string;st:tstringtype);
  371. var
  372. l : longint;
  373. begin
  374. inherited create(stringconstn);
  375. l:=length(s);
  376. len:=l;
  377. { stringdup write even past a #0 }
  378. getmem(value_str,l+1);
  379. move(s[1],value_str^,l);
  380. value_str[l]:=#0;
  381. lab_str:=nil;
  382. if st=st_default then
  383. begin
  384. if cs_ansistrings in aktlocalswitches then
  385. st_type:=st_ansistring
  386. else
  387. st_type:=st_shortstring;
  388. end
  389. else
  390. st_type:=st;
  391. end;
  392. constructor tstringconstnode.createwstr(w : pcompilerwidestring);
  393. begin
  394. inherited create(stringconstn);
  395. len:=getlengthwidestring(w);
  396. initwidestring(pcompilerwidestring(value_str));
  397. copywidestring(w,pcompilerwidestring(value_str));
  398. lab_str:=nil;
  399. st_type:=st_widestring;
  400. end;
  401. constructor tstringconstnode.createpchar(s : pchar;l : longint);
  402. begin
  403. inherited create(stringconstn);
  404. len:=l;
  405. value_str:=s;
  406. if (cs_ansistrings in aktlocalswitches) or
  407. (len>255) then
  408. st_type:=st_ansistring
  409. else
  410. st_type:=st_shortstring;
  411. lab_str:=nil;
  412. end;
  413. destructor tstringconstnode.destroy;
  414. begin
  415. if st_type=st_widestring then
  416. donewidestring(pcompilerwidestring(value_str))
  417. else
  418. ansistringdispose(value_str,len);
  419. inherited destroy;
  420. end;
  421. function tstringconstnode.getcopy : tnode;
  422. var
  423. n : tstringconstnode;
  424. begin
  425. n:=tstringconstnode(inherited getcopy);
  426. n.st_type:=st_type;
  427. n.len:=len;
  428. n.lab_str:=lab_str;
  429. if st_type=st_widestring then
  430. begin
  431. initwidestring(pcompilerwidestring(n.value_str));
  432. copywidestring(pcompilerwidestring(value_str),pcompilerwidestring(n.value_str));
  433. end
  434. else
  435. n.value_str:=getpcharcopy;
  436. getcopy:=n;
  437. end;
  438. function tstringconstnode.det_resulttype:tnode;
  439. begin
  440. result:=nil;
  441. case st_type of
  442. st_shortstring :
  443. resulttype:=cshortstringtype;
  444. st_ansistring :
  445. resulttype:=cansistringtype;
  446. st_widestring :
  447. resulttype:=cwidestringtype;
  448. st_longstring :
  449. resulttype:=clongstringtype;
  450. end;
  451. end;
  452. function tstringconstnode.pass_1 : tnode;
  453. begin
  454. result:=nil;
  455. location.loc:=LOC_CREFERENCE;
  456. end;
  457. function tstringconstnode.getpcharcopy : pchar;
  458. var
  459. pc : pchar;
  460. begin
  461. pc:=nil;
  462. getmem(pc,len+1);
  463. if pc=nil then
  464. Message(general_f_no_memory_left);
  465. move(value_str^,pc^,len+1);
  466. getpcharcopy:=pc;
  467. end;
  468. function tstringconstnode.docompare(p: tnode): boolean;
  469. begin
  470. docompare :=
  471. inherited docompare(p) and
  472. (len = tstringconstnode(p).len) and
  473. { Don't compare the pchars, since they may contain null chars }
  474. { Since all equal constant strings are replaced by the same }
  475. { label, the following compare should be enough (JM) }
  476. (lab_str = tstringconstnode(p).lab_str);
  477. end;
  478. {*****************************************************************************
  479. TSETCONSTNODE
  480. *****************************************************************************}
  481. constructor tsetconstnode.create(s : pconstset;const t:ttype);
  482. begin
  483. inherited create(setconstn,nil);
  484. restype:=t;
  485. if assigned(s) then
  486. begin
  487. new(value_set);
  488. value_set^:=s^;
  489. end
  490. else
  491. value_set:=nil;
  492. end;
  493. destructor tsetconstnode.destroy;
  494. begin
  495. if assigned(value_set) then
  496. dispose(value_set);
  497. inherited destroy;
  498. end;
  499. function tsetconstnode.getcopy : tnode;
  500. var
  501. n : tsetconstnode;
  502. begin
  503. n:=tsetconstnode(inherited getcopy);
  504. if assigned(value_set) then
  505. begin
  506. new(n.value_set);
  507. n.value_set^:=value_set^
  508. end
  509. else
  510. n.value_set:=nil;
  511. n.restype := restype;
  512. n.lab_set:=lab_set;
  513. getcopy:=n;
  514. end;
  515. function tsetconstnode.det_resulttype:tnode;
  516. begin
  517. result:=nil;
  518. resulttype:=restype;
  519. end;
  520. function tsetconstnode.pass_1 : tnode;
  521. begin
  522. result:=nil;
  523. if tsetdef(resulttype.def).settype=smallset then
  524. location.loc:=LOC_CONSTANT
  525. else
  526. location.loc:=LOC_CREFERENCE;
  527. end;
  528. function tsetconstnode.docompare(p: tnode): boolean;
  529. var
  530. i: 0..31;
  531. begin
  532. if inherited docompare(p) then
  533. begin
  534. for i := 0 to 31 do
  535. if (value_set^[i] <> tsetconstnode(p).value_set^[i]) then
  536. begin
  537. docompare := false;
  538. exit
  539. end;
  540. docompare := true;
  541. end
  542. else
  543. docompare := false;
  544. end;
  545. {*****************************************************************************
  546. TNILNODE
  547. *****************************************************************************}
  548. constructor tnilnode.create;
  549. begin
  550. inherited create(niln);
  551. end;
  552. function tnilnode.det_resulttype:tnode;
  553. begin
  554. result:=nil;
  555. resulttype:=voidpointertype;
  556. end;
  557. function tnilnode.pass_1 : tnode;
  558. begin
  559. result:=nil;
  560. location.loc:=LOC_CONSTANT;
  561. end;
  562. {*****************************************************************************
  563. TGUIDCONSTNODE
  564. *****************************************************************************}
  565. constructor tguidconstnode.create(const g:tguid);
  566. begin
  567. inherited create(guidconstn);
  568. value:=g;
  569. end;
  570. function tguidconstnode.getcopy : tnode;
  571. var
  572. n : tguidconstnode;
  573. begin
  574. n:=tguidconstnode(inherited getcopy);
  575. n.value:=value;
  576. getcopy:=n;
  577. end;
  578. function tguidconstnode.det_resulttype:tnode;
  579. begin
  580. result:=nil;
  581. resulttype.setdef(rec_tguid);
  582. end;
  583. function tguidconstnode.pass_1 : tnode;
  584. begin
  585. result:=nil;
  586. location.loc:=LOC_CREFERENCE;
  587. end;
  588. function tguidconstnode.docompare(p: tnode): boolean;
  589. begin
  590. docompare :=
  591. inherited docompare(p) and
  592. (guid2string(value) = guid2string(tguidconstnode(p).value));
  593. end;
  594. begin
  595. crealconstnode:=trealconstnode;
  596. cordconstnode:=tordconstnode;
  597. cpointerconstnode:=tpointerconstnode;
  598. cstringconstnode:=tstringconstnode;
  599. csetconstnode:=tsetconstnode;
  600. cnilnode:=tnilnode;
  601. cguidconstnode:=tguidconstnode;
  602. end.
  603. {
  604. $Log$
  605. Revision 1.27 2002-04-04 19:05:58 peter
  606. * removed unused units
  607. * use tlocation.size in cg.a_*loc*() routines
  608. Revision 1.26 2002/04/02 17:11:29 peter
  609. * tlocation,treference update
  610. * LOC_CONSTANT added for better constant handling
  611. * secondadd splitted in multiple routines
  612. * location_force_reg added for loading a location to a register
  613. of a specified size
  614. * secondassignment parses now first the right and then the left node
  615. (this is compatible with Kylix). This saves a lot of push/pop especially
  616. with string operations
  617. * adapted some routines to use the new cg methods
  618. Revision 1.25 2002/03/04 19:10:11 peter
  619. * removed compiler warnings
  620. Revision 1.24 2001/10/20 19:28:38 peter
  621. * interface 2 guid support
  622. * guid constants support
  623. Revision 1.23 2001/09/17 21:29:12 peter
  624. * merged netbsd, fpu-overflow from fixes branch
  625. Revision 1.22 2001/09/02 21:12:06 peter
  626. * move class of definitions into type section for delphi
  627. Revision 1.21 2001/08/26 13:36:40 florian
  628. * some cg reorganisation
  629. * some PPC updates
  630. Revision 1.20 2001/08/06 10:18:39 jonas
  631. * restype wasn't copied for some constant nodetypes in getcopy
  632. Revision 1.19 2001/07/08 21:00:15 peter
  633. * various widestring updates, it works now mostly without charset
  634. mapping supported
  635. Revision 1.18 2001/05/08 21:06:30 florian
  636. * some more support for widechars commited especially
  637. regarding type casting and constants
  638. Revision 1.17 2001/04/13 01:22:09 peter
  639. * symtable change to classes
  640. * range check generation and errors fixed, make cycle DEBUG=1 works
  641. * memory leaks fixed
  642. Revision 1.16 2001/04/02 21:20:30 peter
  643. * resulttype rewrite
  644. Revision 1.15 2000/12/31 11:14:10 jonas
  645. + implemented/fixed docompare() mathods for all nodes (not tested)
  646. + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
  647. and constant strings/chars together
  648. * n386add.pas: don't copy temp strings (of size 256) to another temp string
  649. when adding
  650. Revision 1.14 2000/12/16 15:58:48 jonas
  651. * genintconstnode now returns cardinals instead of int64 constants if possible
  652. Revision 1.13 2000/12/15 13:26:01 jonas
  653. * only return int64's from functions if it int64funcresok is defined
  654. + added int64funcresok define to options.pas
  655. Revision 1.12 2000/12/07 17:19:42 jonas
  656. * new constant handling: from now on, hex constants >$7fffffff are
  657. parsed as unsigned constants (otherwise, $80000000 got sign extended
  658. and became $ffffffff80000000), all constants in the longint range
  659. become longints, all constants >$7fffffff and <=cardinal($ffffffff)
  660. are cardinals and the rest are int64's.
  661. * added lots of longint typecast to prevent range check errors in the
  662. compiler and rtl
  663. * type casts of symbolic ordinal constants are now preserved
  664. * fixed bug where the original resulttype.def wasn't restored correctly
  665. after doing a 64bit rangecheck
  666. Revision 1.11 2000/11/29 00:30:32 florian
  667. * unused units removed from uses clause
  668. * some changes for widestrings
  669. Revision 1.10 2000/10/31 22:02:48 peter
  670. * symtable splitted, no real code changes
  671. Revision 1.9 2000/10/14 21:52:55 peter
  672. * fixed memory leaks
  673. Revision 1.8 2000/10/14 10:14:50 peter
  674. * moehrendorf oct 2000 rewrite
  675. Revision 1.7 2000/09/28 19:49:52 florian
  676. *** empty log message ***
  677. Revision 1.6 2000/09/27 20:25:44 florian
  678. * more stuff fixed
  679. Revision 1.5 2000/09/27 18:14:31 florian
  680. * fixed a lot of syntax errors in the n*.pas stuff
  681. Revision 1.4 2000/09/26 14:59:34 florian
  682. * more conversion work done
  683. Revision 1.3 2000/09/24 21:15:34 florian
  684. * some errors fix to get more stuff compilable
  685. Revision 1.2 2000/09/24 15:06:19 peter
  686. * use defines.inc
  687. Revision 1.1 2000/09/22 21:44:48 florian
  688. + initial revision
  689. }