tcadd.pas 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. Type checking and register allocation for add node
  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 tcadd;
  19. interface
  20. uses
  21. tree;
  22. procedure firstadd(var p : ptree);
  23. implementation
  24. uses
  25. globtype,systems,tokens,
  26. cobjects,verbose,globals,
  27. symconst,symtable,aasm,types,
  28. hcodegen,htypechk,pass_1,
  29. cpubase,tccnv
  30. ;
  31. {*****************************************************************************
  32. FirstAdd
  33. *****************************************************************************}
  34. procedure firstadd(var p : ptree);
  35. procedure make_bool_equal_size(var p:ptree);
  36. begin
  37. if porddef(p^.left^.resulttype)^.typ>porddef(p^.right^.resulttype)^.typ then
  38. begin
  39. p^.right:=gentypeconvnode(p^.right,porddef(p^.left^.resulttype));
  40. p^.right^.convtyp:=tc_bool_2_int;
  41. p^.right^.explizit:=true;
  42. firstpass(p^.right);
  43. end
  44. else
  45. if porddef(p^.left^.resulttype)^.typ<porddef(p^.right^.resulttype)^.typ then
  46. begin
  47. p^.left:=gentypeconvnode(p^.left,porddef(p^.right^.resulttype));
  48. p^.left^.convtyp:=tc_bool_2_int;
  49. p^.left^.explizit:=true;
  50. firstpass(p^.left);
  51. end;
  52. end;
  53. var
  54. t,hp : ptree;
  55. ot,
  56. lt,rt : ttreetyp;
  57. rv,lv : longint;
  58. rvd,lvd : bestreal;
  59. resdef,
  60. rd,ld : pdef;
  61. tempdef : pdef;
  62. concatstrings : boolean;
  63. { to evalute const sets }
  64. resultset : pconstset;
  65. i : longint;
  66. b : boolean;
  67. convdone : boolean;
  68. s1,s2 : pchar;
  69. l1,l2 : longint;
  70. { this totally forgets to set the pi_do_call flag !! }
  71. label
  72. no_overload;
  73. begin
  74. { first do the two subtrees }
  75. firstpass(p^.left);
  76. firstpass(p^.right);
  77. lt:=p^.left^.treetype;
  78. rt:=p^.right^.treetype;
  79. rd:=p^.right^.resulttype;
  80. ld:=p^.left^.resulttype;
  81. convdone:=false;
  82. if codegenerror then
  83. exit;
  84. { overloaded operator ? }
  85. if (p^.treetype=starstarn) or
  86. (ld^.deftype=recorddef) or
  87. ((ld^.deftype=arraydef) and
  88. (rd^.deftype<>orddef) and
  89. ((parraydef(ld)^.definition^.deftype<>orddef) or
  90. (porddef(parraydef(ld)^.definition)^.typ<>uchar))) or
  91. { <> and = are defined for classes }
  92. ((ld^.deftype=objectdef) and
  93. (not(pobjectdef(ld)^.is_class) or
  94. not(p^.treetype in [equaln,unequaln])
  95. )
  96. ) or
  97. (rd^.deftype=recorddef) or
  98. ((rd^.deftype=arraydef) and
  99. (ld^.deftype<>orddef) and
  100. ((parraydef(rd)^.definition^.deftype<>orddef) or
  101. (porddef(parraydef(rd)^.definition)^.typ<>uchar))) or
  102. { <> and = are defined for classes }
  103. ((rd^.deftype=objectdef) and
  104. (not(pobjectdef(rd)^.is_class) or
  105. not(p^.treetype in [equaln,unequaln])
  106. )
  107. ) then
  108. begin
  109. {!!!!!!!!! handle paras }
  110. case p^.treetype of
  111. { the nil as symtable signs firstcalln that this is
  112. an overloaded operator }
  113. addn:
  114. t:=gencallnode(overloaded_operators[_plus],nil);
  115. subn:
  116. t:=gencallnode(overloaded_operators[_minus],nil);
  117. muln:
  118. t:=gencallnode(overloaded_operators[_star],nil);
  119. starstarn:
  120. t:=gencallnode(overloaded_operators[_starstar],nil);
  121. slashn:
  122. t:=gencallnode(overloaded_operators[_slash],nil);
  123. ltn:
  124. t:=gencallnode(overloaded_operators[tokens._lt],nil);
  125. gtn:
  126. t:=gencallnode(overloaded_operators[_gt],nil);
  127. lten:
  128. t:=gencallnode(overloaded_operators[_lte],nil);
  129. gten:
  130. t:=gencallnode(overloaded_operators[_gte],nil);
  131. equaln,unequaln :
  132. t:=gencallnode(overloaded_operators[_equal],nil);
  133. else goto no_overload;
  134. end;
  135. { we have to convert p^.left and p^.right into
  136. callparanodes }
  137. if t^.symtableprocentry=nil then
  138. begin
  139. CGMessage(parser_e_operator_not_overloaded);
  140. putnode(t);
  141. end
  142. else
  143. begin
  144. t^.left:=gencallparanode(p^.left,nil);
  145. t^.left:=gencallparanode(p^.right,t^.left);
  146. if p^.treetype=unequaln then
  147. t:=gensinglenode(notn,t);
  148. firstpass(t);
  149. putnode(p);
  150. p:=t;
  151. exit;
  152. end;
  153. end;
  154. no_overload:
  155. { compact consts }
  156. { convert int consts to real consts, if the }
  157. { other operand is a real const }
  158. if (rt=realconstn) and is_constintnode(p^.left) then
  159. begin
  160. t:=genrealconstnode(p^.left^.value,p^.right^.resulttype);
  161. disposetree(p^.left);
  162. p^.left:=t;
  163. lt:=realconstn;
  164. end;
  165. if (lt=realconstn) and is_constintnode(p^.right) then
  166. begin
  167. t:=genrealconstnode(p^.right^.value,p^.left^.resulttype);
  168. disposetree(p^.right);
  169. p^.right:=t;
  170. rt:=realconstn;
  171. end;
  172. { both are int constants, also allow operations on two equal enums
  173. in fpc mode (Needed for conversion of C code) }
  174. if ((lt=ordconstn) and (rt=ordconstn)) and
  175. ((is_constintnode(p^.left) and is_constintnode(p^.right)) or
  176. ((ld^.deftype=enumdef) and is_equal(ld,rd) and (m_fpc in aktmodeswitches))) then
  177. begin
  178. if ld^.deftype=enumdef then
  179. resdef:=ld
  180. else
  181. resdef:=s32bitdef;
  182. lv:=p^.left^.value;
  183. rv:=p^.right^.value;
  184. case p^.treetype of
  185. addn : t:=genordinalconstnode(lv+rv,resdef);
  186. subn : t:=genordinalconstnode(lv-rv,resdef);
  187. muln : t:=genordinalconstnode(lv*rv,resdef);
  188. xorn : t:=genordinalconstnode(lv xor rv,resdef);
  189. orn : t:=genordinalconstnode(lv or rv,resdef);
  190. andn : t:=genordinalconstnode(lv and rv,resdef);
  191. ltn : t:=genordinalconstnode(ord(lv<rv),booldef);
  192. lten : t:=genordinalconstnode(ord(lv<=rv),booldef);
  193. gtn : t:=genordinalconstnode(ord(lv>rv),booldef);
  194. gten : t:=genordinalconstnode(ord(lv>=rv),booldef);
  195. equaln : t:=genordinalconstnode(ord(lv=rv),booldef);
  196. unequaln : t:=genordinalconstnode(ord(lv<>rv),booldef);
  197. slashn : begin
  198. { int/int becomes a real }
  199. if int(rv)=0 then
  200. begin
  201. Message(parser_e_invalid_float_operation);
  202. t:=genrealconstnode(0,bestrealdef^);
  203. end
  204. else
  205. t:=genrealconstnode(int(lv)/int(rv),bestrealdef^);
  206. firstpass(t);
  207. end;
  208. else
  209. CGMessage(type_e_mismatch);
  210. end;
  211. disposetree(p);
  212. firstpass(t);
  213. p:=t;
  214. exit;
  215. end;
  216. { both real constants ? }
  217. if (lt=realconstn) and (rt=realconstn) then
  218. begin
  219. lvd:=p^.left^.value_real;
  220. rvd:=p^.right^.value_real;
  221. case p^.treetype of
  222. addn : t:=genrealconstnode(lvd+rvd,bestrealdef^);
  223. subn : t:=genrealconstnode(lvd-rvd,bestrealdef^);
  224. muln : t:=genrealconstnode(lvd*rvd,bestrealdef^);
  225. caretn : t:=genrealconstnode(exp(ln(lvd)*rvd),bestrealdef^);
  226. slashn : begin
  227. if rvd=0 then
  228. begin
  229. Message(parser_e_invalid_float_operation);
  230. t:=genrealconstnode(0,bestrealdef^);
  231. end
  232. else
  233. t:=genrealconstnode(lvd/rvd,bestrealdef^);
  234. end;
  235. ltn : t:=genordinalconstnode(ord(lvd<rvd),booldef);
  236. lten : t:=genordinalconstnode(ord(lvd<=rvd),booldef);
  237. gtn : t:=genordinalconstnode(ord(lvd>rvd),booldef);
  238. gten : t:=genordinalconstnode(ord(lvd>=rvd),booldef);
  239. equaln : t:=genordinalconstnode(ord(lvd=rvd),booldef);
  240. unequaln : t:=genordinalconstnode(ord(lvd<>rvd),booldef);
  241. else
  242. CGMessage(type_e_mismatch);
  243. end;
  244. disposetree(p);
  245. p:=t;
  246. firstpass(p);
  247. exit;
  248. end;
  249. { concating strings ? }
  250. concatstrings:=false;
  251. s1:=nil;
  252. s2:=nil;
  253. if (lt=ordconstn) and (rt=ordconstn) and
  254. is_char(ld) and is_char(rd) then
  255. begin
  256. s1:=strpnew(char(byte(p^.left^.value)));
  257. s2:=strpnew(char(byte(p^.right^.value)));
  258. l1:=1;
  259. l2:=1;
  260. concatstrings:=true;
  261. end
  262. else
  263. if (lt=stringconstn) and (rt=ordconstn) and is_char(rd) then
  264. begin
  265. s1:=getpcharcopy(p^.left);
  266. l1:=p^.left^.length;
  267. s2:=strpnew(char(byte(p^.right^.value)));
  268. l2:=1;
  269. concatstrings:=true;
  270. end
  271. else
  272. if (lt=ordconstn) and (rt=stringconstn) and is_char(ld) then
  273. begin
  274. s1:=strpnew(char(byte(p^.left^.value)));
  275. l1:=1;
  276. s2:=getpcharcopy(p^.right);
  277. l2:=p^.right^.length;
  278. concatstrings:=true;
  279. end
  280. else if (lt=stringconstn) and (rt=stringconstn) then
  281. begin
  282. s1:=getpcharcopy(p^.left);
  283. l1:=p^.left^.length;
  284. s2:=getpcharcopy(p^.right);
  285. l2:=p^.right^.length;
  286. concatstrings:=true;
  287. end;
  288. { I will need to translate all this to ansistrings !!! }
  289. if concatstrings then
  290. begin
  291. case p^.treetype of
  292. addn :
  293. t:=genpcharconstnode(concatansistrings(s1,s2,l1,l2),l1+l2);
  294. ltn :
  295. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<0),booldef);
  296. lten :
  297. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<=0),booldef);
  298. gtn :
  299. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)>0),booldef);
  300. gten :
  301. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)>=0),booldef);
  302. equaln :
  303. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)=0),booldef);
  304. unequaln :
  305. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<>0),booldef);
  306. end;
  307. ansistringdispose(s1,l1);
  308. ansistringdispose(s2,l2);
  309. disposetree(p);
  310. firstpass(t);
  311. p:=t;
  312. exit;
  313. end;
  314. { if both are orddefs then check sub types }
  315. if (ld^.deftype=orddef) and (rd^.deftype=orddef) then
  316. begin
  317. { 2 booleans ? }
  318. if is_boolean(ld) and is_boolean(rd) then
  319. begin
  320. case p^.treetype of
  321. andn,
  322. orn:
  323. begin
  324. calcregisters(p,0,0,0);
  325. make_bool_equal_size(p);
  326. p^.location.loc:=LOC_JUMP;
  327. end;
  328. xorn:
  329. begin
  330. make_bool_equal_size(p);
  331. if (p^.left^.location.loc in [LOC_JUMP,LOC_FLAGS]) and
  332. (p^.left^.location.loc in [LOC_JUMP,LOC_FLAGS]) then
  333. calcregisters(p,2,0,0)
  334. else
  335. calcregisters(p,1,0,0);
  336. end;
  337. unequaln,
  338. equaln:
  339. begin
  340. make_bool_equal_size(p);
  341. { Remove any compares with constants, becuase then
  342. we get a compare with Flags in the codegen which
  343. is not supported (PFV) }
  344. if (p^.left^.treetype=ordconstn) then
  345. begin
  346. hp:=p^.right;
  347. b:=(p^.left^.value<>0);
  348. ot:=p^.treetype;
  349. disposetree(p^.left);
  350. putnode(p);
  351. p:=hp;
  352. if (not(b) and (ot=equaln)) or
  353. (b and (ot=unequaln)) then
  354. begin
  355. p:=gensinglenode(notn,p);
  356. firstpass(p);
  357. end;
  358. exit;
  359. end;
  360. if (p^.right^.treetype=ordconstn) then
  361. begin
  362. hp:=p^.left;
  363. b:=(p^.right^.value<>0);
  364. ot:=p^.treetype;
  365. disposetree(p^.right);
  366. putnode(p);
  367. p:=hp;
  368. if (not(b) and (ot=equaln)) or
  369. (b and (ot=unequaln)) then
  370. begin
  371. p:=gensinglenode(notn,p);
  372. firstpass(p);
  373. end;
  374. exit;
  375. end;
  376. if (p^.left^.location.loc in [LOC_JUMP,LOC_FLAGS]) and
  377. (p^.left^.location.loc in [LOC_JUMP,LOC_FLAGS]) then
  378. calcregisters(p,2,0,0)
  379. else
  380. calcregisters(p,1,0,0);
  381. end;
  382. else
  383. CGMessage(type_e_mismatch);
  384. end;
  385. { these one can't be in flags! }
  386. if p^.treetype in [xorn,unequaln,equaln] then
  387. begin
  388. if p^.left^.location.loc=LOC_FLAGS then
  389. begin
  390. p^.left:=gentypeconvnode(p^.left,porddef(p^.left^.resulttype));
  391. p^.left^.convtyp:=tc_bool_2_int;
  392. p^.left^.explizit:=true;
  393. firstpass(p^.left);
  394. end;
  395. if p^.right^.location.loc=LOC_FLAGS then
  396. begin
  397. p^.right:=gentypeconvnode(p^.right,porddef(p^.right^.resulttype));
  398. p^.right^.convtyp:=tc_bool_2_int;
  399. p^.right^.explizit:=true;
  400. firstpass(p^.right);
  401. end;
  402. { readjust registers }
  403. calcregisters(p,1,0,0);
  404. end;
  405. convdone:=true;
  406. end
  407. else
  408. { Both are chars? only convert to shortstrings for addn }
  409. if is_char(rd) and is_char(ld) then
  410. begin
  411. if p^.treetype=addn then
  412. begin
  413. p^.left:=gentypeconvnode(p^.left,cshortstringdef);
  414. p^.right:=gentypeconvnode(p^.right,cshortstringdef);
  415. firstpass(p^.left);
  416. firstpass(p^.right);
  417. { here we call STRCOPY }
  418. procinfo.flags:=procinfo.flags or pi_do_call;
  419. calcregisters(p,0,0,0);
  420. p^.location.loc:=LOC_MEM;
  421. end
  422. else
  423. calcregisters(p,1,0,0);
  424. convdone:=true;
  425. end
  426. { is there a 64 bit type ? }
  427. else if (porddef(rd)^.typ=s64bit) or (porddef(ld)^.typ=s64bit) then
  428. begin
  429. if (porddef(ld)^.typ<>s64bit) then
  430. begin
  431. p^.left:=gentypeconvnode(p^.left,cs64bitdef);
  432. firstpass(p^.left);
  433. end;
  434. if (porddef(rd)^.typ<>s64bit) then
  435. begin
  436. p^.right:=gentypeconvnode(p^.right,cs64bitdef);
  437. firstpass(p^.right);
  438. end;
  439. calcregisters(p,2,0,0);
  440. convdone:=true;
  441. end
  442. else if (porddef(rd)^.typ=u64bit) or (porddef(ld)^.typ=u64bit) then
  443. begin
  444. if (porddef(ld)^.typ<>u64bit) then
  445. begin
  446. p^.left:=gentypeconvnode(p^.left,cu64bitdef);
  447. firstpass(p^.left);
  448. end;
  449. if (porddef(rd)^.typ<>u64bit) then
  450. begin
  451. p^.right:=gentypeconvnode(p^.right,cu64bitdef);
  452. firstpass(p^.right);
  453. end;
  454. calcregisters(p,2,0,0);
  455. convdone:=true;
  456. end
  457. else
  458. { is there a cardinal? }
  459. if (porddef(rd)^.typ=u32bit) or (porddef(ld)^.typ=u32bit) then
  460. begin
  461. { convert constants to u32bit }
  462. if (porddef(ld)^.typ<>u32bit) then
  463. begin
  464. { s32bit will be used for when the other is also s32bit }
  465. if (porddef(rd)^.typ=s32bit) and (lt<>ordconstn) then
  466. p^.left:=gentypeconvnode(p^.left,s32bitdef)
  467. else
  468. p^.left:=gentypeconvnode(p^.left,u32bitdef);
  469. firstpass(p^.left);
  470. end;
  471. if (porddef(rd)^.typ<>u32bit) then
  472. begin
  473. { s32bit will be used for when the other is also s32bit }
  474. if (porddef(ld)^.typ=s32bit) and (rt<>ordconstn) then
  475. p^.right:=gentypeconvnode(p^.right,s32bitdef)
  476. else
  477. p^.right:=gentypeconvnode(p^.right,u32bitdef);
  478. firstpass(p^.right);
  479. end;
  480. calcregisters(p,1,0,0);
  481. convdone:=true;
  482. end;
  483. end
  484. else
  485. { left side a setdef, must be before string processing,
  486. else array constructor can be seen as array of char (PFV) }
  487. if (ld^.deftype=setdef) or is_array_constructor(ld) then
  488. begin
  489. { convert array constructors to sets }
  490. if is_array_constructor(ld) then
  491. begin
  492. arrayconstructor_to_set(p^.left);
  493. ld:=p^.left^.resulttype;
  494. end;
  495. if is_array_constructor(rd) then
  496. begin
  497. arrayconstructor_to_set(p^.right);
  498. rd:=p^.right^.resulttype;
  499. end;
  500. { trying to add a set element? }
  501. if (p^.treetype=addn) and (rd^.deftype<>setdef) then
  502. begin
  503. if (rt=setelementn) then
  504. begin
  505. if not(is_equal(psetdef(ld)^.setof,rd)) then
  506. CGMessage(type_e_set_element_are_not_comp);
  507. end
  508. else
  509. CGMessage(type_e_mismatch)
  510. end
  511. else
  512. begin
  513. if not(p^.treetype in [addn,subn,symdifn,muln,equaln,unequaln
  514. {$IfNDef NoSetInclusion}
  515. ,lten,gten
  516. {$EndIf NoSetInclusion}
  517. ]) then
  518. CGMessage(type_e_set_operation_unknown);
  519. { right def must be a also be set }
  520. if (rd^.deftype<>setdef) or not(is_equal(rd,ld)) then
  521. CGMessage(type_e_set_element_are_not_comp);
  522. end;
  523. { ranges require normsets }
  524. if (psetdef(ld)^.settype=smallset) and
  525. (rt=setelementn) and
  526. assigned(p^.right^.right) then
  527. begin
  528. { generate a temporary normset def }
  529. tempdef:=new(psetdef,init(psetdef(ld)^.setof,255));
  530. p^.left:=gentypeconvnode(p^.left,tempdef);
  531. firstpass(p^.left);
  532. dispose(tempdef,done);
  533. ld:=p^.left^.resulttype;
  534. end;
  535. { if the destination is not a smallset then insert a typeconv
  536. which loads a smallset into a normal set }
  537. if (psetdef(ld)^.settype<>smallset) and
  538. (psetdef(rd)^.settype=smallset) then
  539. begin
  540. if (p^.right^.treetype=setconstn) then
  541. begin
  542. t:=gensetconstnode(p^.right^.value_set,psetdef(p^.left^.resulttype));
  543. t^.left:=p^.right^.left;
  544. putnode(p^.right);
  545. p^.right:=t;
  546. end
  547. else
  548. p^.right:=gentypeconvnode(p^.right,psetdef(p^.left^.resulttype));
  549. firstpass(p^.right);
  550. end;
  551. { do constant evaluation }
  552. if (p^.right^.treetype=setconstn) and
  553. not assigned(p^.right^.left) and
  554. (p^.left^.treetype=setconstn) and
  555. not assigned(p^.left^.left) then
  556. begin
  557. new(resultset);
  558. case p^.treetype of
  559. addn : begin
  560. for i:=0 to 31 do
  561. resultset^[i]:=
  562. p^.right^.value_set^[i] or p^.left^.value_set^[i];
  563. t:=gensetconstnode(resultset,psetdef(ld));
  564. end;
  565. muln : begin
  566. for i:=0 to 31 do
  567. resultset^[i]:=
  568. p^.right^.value_set^[i] and p^.left^.value_set^[i];
  569. t:=gensetconstnode(resultset,psetdef(ld));
  570. end;
  571. subn : begin
  572. for i:=0 to 31 do
  573. resultset^[i]:=
  574. p^.left^.value_set^[i] and not(p^.right^.value_set^[i]);
  575. t:=gensetconstnode(resultset,psetdef(ld));
  576. end;
  577. symdifn : begin
  578. for i:=0 to 31 do
  579. resultset^[i]:=
  580. p^.left^.value_set^[i] xor p^.right^.value_set^[i];
  581. t:=gensetconstnode(resultset,psetdef(ld));
  582. end;
  583. unequaln : begin
  584. b:=true;
  585. for i:=0 to 31 do
  586. if p^.right^.value_set^[i]=p^.left^.value_set^[i] then
  587. begin
  588. b:=false;
  589. break;
  590. end;
  591. t:=genordinalconstnode(ord(b),booldef);
  592. end;
  593. equaln : begin
  594. b:=true;
  595. for i:=0 to 31 do
  596. if p^.right^.value_set^[i]<>p^.left^.value_set^[i] then
  597. begin
  598. b:=false;
  599. break;
  600. end;
  601. t:=genordinalconstnode(ord(b),booldef);
  602. end;
  603. {$IfNDef NoSetInclusion}
  604. lten : Begin
  605. b := true;
  606. For i := 0 to 31 Do
  607. If (p^.right^.value_set^[i] And p^.left^.value_set^[i]) <>
  608. p^.left^.value_set^[i] Then
  609. Begin
  610. b := false;
  611. Break
  612. End;
  613. t := genordinalconstnode(ord(b),booldef);
  614. End;
  615. gten : Begin
  616. b := true;
  617. For i := 0 to 31 Do
  618. If (p^.left^.value_set^[i] And p^.right^.value_set^[i]) <>
  619. p^.right^.value_set^[i] Then
  620. Begin
  621. b := false;
  622. Break
  623. End;
  624. t := genordinalconstnode(ord(b),booldef);
  625. End;
  626. {$EndIf NoSetInclusion}
  627. end;
  628. dispose(resultset);
  629. disposetree(p);
  630. p:=t;
  631. firstpass(p);
  632. exit;
  633. end
  634. else
  635. if psetdef(ld)^.settype=smallset then
  636. begin
  637. calcregisters(p,1,0,0);
  638. p^.location.loc:=LOC_REGISTER;
  639. end
  640. else
  641. begin
  642. calcregisters(p,0,0,0);
  643. { here we call SET... }
  644. procinfo.flags:=procinfo.flags or pi_do_call;
  645. p^.location.loc:=LOC_MEM;
  646. end;
  647. convdone:=true;
  648. end
  649. else
  650. { is one of the operands a string?,
  651. chararrays are also handled as strings (after conversion) }
  652. if (rd^.deftype=stringdef) or (ld^.deftype=stringdef) or
  653. (is_chararray(rd) and is_chararray(ld)) then
  654. begin
  655. if is_widestring(rd) or is_widestring(ld) then
  656. begin
  657. if not(is_widestring(rd)) then
  658. p^.right:=gentypeconvnode(p^.right,cwidestringdef);
  659. if not(is_widestring(ld)) then
  660. p^.left:=gentypeconvnode(p^.left,cwidestringdef);
  661. p^.resulttype:=cwidestringdef;
  662. { this is only for add, the comparisaion is handled later }
  663. p^.location.loc:=LOC_REGISTER;
  664. end
  665. else if is_ansistring(rd) or is_ansistring(ld) then
  666. begin
  667. if not(is_ansistring(rd)) then
  668. p^.right:=gentypeconvnode(p^.right,cansistringdef);
  669. if not(is_ansistring(ld)) then
  670. p^.left:=gentypeconvnode(p^.left,cansistringdef);
  671. p^.resulttype:=cansistringdef;
  672. { this is only for add, the comparisaion is handled later }
  673. p^.location.loc:=LOC_REGISTER;
  674. end
  675. else if is_longstring(rd) or is_longstring(ld) then
  676. begin
  677. if not(is_longstring(rd)) then
  678. p^.right:=gentypeconvnode(p^.right,clongstringdef);
  679. if not(is_longstring(ld)) then
  680. p^.left:=gentypeconvnode(p^.left,clongstringdef);
  681. p^.resulttype:=clongstringdef;
  682. { this is only for add, the comparisaion is handled later }
  683. p^.location.loc:=LOC_MEM;
  684. end
  685. else
  686. begin
  687. if not(is_shortstring(rd)) then
  688. p^.right:=gentypeconvnode(p^.right,cshortstringdef);
  689. if not(is_shortstring(ld)) then
  690. p^.left:=gentypeconvnode(p^.left,cshortstringdef);
  691. p^.resulttype:=cshortstringdef;
  692. { this is only for add, the comparisaion is handled later }
  693. p^.location.loc:=LOC_MEM;
  694. end;
  695. { only if there is a type cast we need to do again }
  696. { the first pass }
  697. if p^.left^.treetype=typeconvn then
  698. firstpass(p^.left);
  699. if p^.right^.treetype=typeconvn then
  700. firstpass(p^.right);
  701. { here we call STRCONCAT or STRCMP or STRCOPY }
  702. procinfo.flags:=procinfo.flags or pi_do_call;
  703. if p^.location.loc=LOC_MEM then
  704. calcregisters(p,0,0,0)
  705. else
  706. calcregisters(p,1,0,0);
  707. convdone:=true;
  708. end
  709. else
  710. { is one a real float ? }
  711. if (rd^.deftype=floatdef) or (ld^.deftype=floatdef) then
  712. begin
  713. { if one is a fixed, then convert to f32bit }
  714. if ((rd^.deftype=floatdef) and (pfloatdef(rd)^.typ=f32bit)) or
  715. ((ld^.deftype=floatdef) and (pfloatdef(ld)^.typ=f32bit)) then
  716. begin
  717. if not is_integer(rd) or (p^.treetype<>muln) then
  718. p^.right:=gentypeconvnode(p^.right,s32fixeddef);
  719. if not is_integer(ld) or (p^.treetype<>muln) then
  720. p^.left:=gentypeconvnode(p^.left,s32fixeddef);
  721. firstpass(p^.left);
  722. firstpass(p^.right);
  723. calcregisters(p,1,0,0);
  724. p^.location.loc:=LOC_REGISTER;
  725. end
  726. else
  727. { convert both to bestreal }
  728. begin
  729. p^.right:=gentypeconvnode(p^.right,bestrealdef^);
  730. p^.left:=gentypeconvnode(p^.left,bestrealdef^);
  731. firstpass(p^.left);
  732. firstpass(p^.right);
  733. calcregisters(p,1,1,0);
  734. p^.location.loc:=LOC_FPU;
  735. end;
  736. convdone:=true;
  737. end
  738. else
  739. { pointer comperation and subtraction }
  740. if (rd^.deftype=pointerdef) and (ld^.deftype=pointerdef) then
  741. begin
  742. p^.location.loc:=LOC_REGISTER;
  743. { p^.right:=gentypeconvnode(p^.right,ld); }
  744. { firstpass(p^.right); }
  745. calcregisters(p,1,0,0);
  746. case p^.treetype of
  747. equaln,unequaln :
  748. begin
  749. if is_equal(p^.right^.resulttype,voidpointerdef) then
  750. begin
  751. p^.right:=gentypeconvnode(p^.right,ld);
  752. firstpass(p^.right);
  753. end
  754. else if is_equal(p^.left^.resulttype,voidpointerdef) then
  755. begin
  756. p^.left:=gentypeconvnode(p^.left,rd);
  757. firstpass(p^.left);
  758. end
  759. else if not(is_equal(ld,rd)) then
  760. CGMessage(type_e_mismatch);
  761. end;
  762. ltn,lten,gtn,gten:
  763. begin
  764. if is_equal(p^.right^.resulttype,voidpointerdef) then
  765. begin
  766. p^.right:=gentypeconvnode(p^.right,ld);
  767. firstpass(p^.right);
  768. end
  769. else if is_equal(p^.left^.resulttype,voidpointerdef) then
  770. begin
  771. p^.left:=gentypeconvnode(p^.left,rd);
  772. firstpass(p^.left);
  773. end
  774. else if not(is_equal(ld,rd)) then
  775. CGMessage(type_e_mismatch);
  776. if not(cs_extsyntax in aktmoduleswitches) then
  777. CGMessage(type_e_mismatch);
  778. end;
  779. subn:
  780. begin
  781. if not(is_equal(ld,rd)) then
  782. CGMessage(type_e_mismatch);
  783. if not(cs_extsyntax in aktmoduleswitches) then
  784. CGMessage(type_e_mismatch);
  785. p^.resulttype:=s32bitdef;
  786. exit;
  787. end;
  788. else CGMessage(type_e_mismatch);
  789. end;
  790. convdone:=true;
  791. end
  792. else
  793. if (rd^.deftype=objectdef) and (ld^.deftype=objectdef) and
  794. pobjectdef(rd)^.is_class and pobjectdef(ld)^.is_class then
  795. begin
  796. p^.location.loc:=LOC_REGISTER;
  797. if pobjectdef(rd)^.is_related(pobjectdef(ld)) then
  798. p^.right:=gentypeconvnode(p^.right,ld)
  799. else
  800. p^.left:=gentypeconvnode(p^.left,rd);
  801. firstpass(p^.right);
  802. firstpass(p^.left);
  803. calcregisters(p,1,0,0);
  804. case p^.treetype of
  805. equaln,unequaln : ;
  806. else CGMessage(type_e_mismatch);
  807. end;
  808. convdone:=true;
  809. end
  810. else
  811. if (rd^.deftype=classrefdef) and (ld^.deftype=classrefdef) then
  812. begin
  813. p^.location.loc:=LOC_REGISTER;
  814. if pobjectdef(pclassrefdef(rd)^.definition)^.is_related(pobjectdef(
  815. pclassrefdef(ld)^.definition)) then
  816. p^.right:=gentypeconvnode(p^.right,ld)
  817. else
  818. p^.left:=gentypeconvnode(p^.left,rd);
  819. firstpass(p^.right);
  820. firstpass(p^.left);
  821. calcregisters(p,1,0,0);
  822. case p^.treetype of
  823. equaln,unequaln : ;
  824. else CGMessage(type_e_mismatch);
  825. end;
  826. convdone:=true;
  827. end
  828. else
  829. { allows comperasion with nil pointer }
  830. if (rd^.deftype=objectdef) and
  831. pobjectdef(rd)^.is_class then
  832. begin
  833. p^.location.loc:=LOC_REGISTER;
  834. p^.left:=gentypeconvnode(p^.left,rd);
  835. firstpass(p^.left);
  836. calcregisters(p,1,0,0);
  837. case p^.treetype of
  838. equaln,unequaln : ;
  839. else CGMessage(type_e_mismatch);
  840. end;
  841. convdone:=true;
  842. end
  843. else
  844. if (ld^.deftype=objectdef) and
  845. pobjectdef(ld)^.is_class then
  846. begin
  847. p^.location.loc:=LOC_REGISTER;
  848. p^.right:=gentypeconvnode(p^.right,ld);
  849. firstpass(p^.right);
  850. calcregisters(p,1,0,0);
  851. case p^.treetype of
  852. equaln,unequaln : ;
  853. else CGMessage(type_e_mismatch);
  854. end;
  855. convdone:=true;
  856. end
  857. else
  858. if (rd^.deftype=classrefdef) then
  859. begin
  860. p^.left:=gentypeconvnode(p^.left,rd);
  861. firstpass(p^.left);
  862. calcregisters(p,1,0,0);
  863. case p^.treetype of
  864. equaln,unequaln : ;
  865. else CGMessage(type_e_mismatch);
  866. end;
  867. convdone:=true;
  868. end
  869. else
  870. if (ld^.deftype=classrefdef) then
  871. begin
  872. p^.right:=gentypeconvnode(p^.right,ld);
  873. firstpass(p^.right);
  874. calcregisters(p,1,0,0);
  875. case p^.treetype of
  876. equaln,unequaln : ;
  877. else
  878. CGMessage(type_e_mismatch);
  879. end;
  880. convdone:=true;
  881. end
  882. else
  883. { support procvar=nil,procvar<>nil }
  884. if ((ld^.deftype=procvardef) and (rt=niln)) or
  885. ((rd^.deftype=procvardef) and (lt=niln)) then
  886. begin
  887. calcregisters(p,1,0,0);
  888. p^.location.loc:=LOC_REGISTER;
  889. case p^.treetype of
  890. equaln,unequaln : ;
  891. else
  892. CGMessage(type_e_mismatch);
  893. end;
  894. convdone:=true;
  895. end
  896. else
  897. if (rd^.deftype=pointerdef) or
  898. is_zero_based_array(rd) then
  899. begin
  900. if is_zero_based_array(rd) then
  901. begin
  902. p^.resulttype:=new(ppointerdef,init(parraydef(rd)^.definition));
  903. p^.right:=gentypeconvnode(p^.right,p^.resulttype);
  904. firstpass(p^.right);
  905. end;
  906. p^.location.loc:=LOC_REGISTER;
  907. p^.left:=gentypeconvnode(p^.left,s32bitdef);
  908. firstpass(p^.left);
  909. calcregisters(p,1,0,0);
  910. if p^.treetype=addn then
  911. begin
  912. if not(cs_extsyntax in aktmoduleswitches) or
  913. (not(is_pchar(ld)) and (m_tp in aktmodeswitches)) then
  914. CGMessage(type_e_mismatch);
  915. end
  916. else
  917. CGMessage(type_e_mismatch);
  918. convdone:=true;
  919. end
  920. else
  921. if (ld^.deftype=pointerdef) or
  922. is_zero_based_array(ld) then
  923. begin
  924. if is_zero_based_array(ld) then
  925. begin
  926. p^.resulttype:=new(ppointerdef,init(parraydef(ld)^.definition));
  927. p^.left:=gentypeconvnode(p^.left,p^.resulttype);
  928. firstpass(p^.left);
  929. end;
  930. p^.location.loc:=LOC_REGISTER;
  931. p^.right:=gentypeconvnode(p^.right,s32bitdef);
  932. firstpass(p^.right);
  933. calcregisters(p,1,0,0);
  934. case p^.treetype of
  935. addn,subn : begin
  936. if not(cs_extsyntax in aktmoduleswitches) or
  937. (not(is_pchar(ld)) and (m_tp in aktmodeswitches)) then
  938. CGMessage(type_e_mismatch);
  939. end;
  940. else
  941. CGMessage(type_e_mismatch);
  942. end;
  943. convdone:=true;
  944. end
  945. else
  946. if (rd^.deftype=procvardef) and (ld^.deftype=procvardef) and is_equal(rd,ld) then
  947. begin
  948. calcregisters(p,1,0,0);
  949. p^.location.loc:=LOC_REGISTER;
  950. case p^.treetype of
  951. equaln,unequaln : ;
  952. else
  953. CGMessage(type_e_mismatch);
  954. end;
  955. convdone:=true;
  956. end
  957. else
  958. {$ifdef SUPPORT_MMX}
  959. if (cs_mmx in aktlocalswitches) and is_mmx_able_array(ld) and
  960. is_mmx_able_array(rd) and is_equal(ld,rd) then
  961. begin
  962. firstpass(p^.right);
  963. firstpass(p^.left);
  964. case p^.treetype of
  965. addn,subn,xorn,orn,andn:
  966. ;
  967. { mul is a little bit restricted }
  968. muln:
  969. if not(mmx_type(p^.left^.resulttype) in
  970. [mmxu16bit,mmxs16bit,mmxfixed16]) then
  971. CGMessage(type_e_mismatch);
  972. else
  973. CGMessage(type_e_mismatch);
  974. end;
  975. p^.location.loc:=LOC_MMXREGISTER;
  976. calcregisters(p,0,0,1);
  977. convdone:=true;
  978. end
  979. else
  980. {$endif SUPPORT_MMX}
  981. if (ld^.deftype=enumdef) and (rd^.deftype=enumdef) and (is_equal(ld,rd)) then
  982. begin
  983. calcregisters(p,1,0,0);
  984. case p^.treetype of
  985. equaln,unequaln,
  986. ltn,lten,gtn,gten : ;
  987. else CGMessage(type_e_mismatch);
  988. end;
  989. convdone:=true;
  990. end;
  991. { the general solution is to convert to 32 bit int }
  992. if not convdone then
  993. begin
  994. { but an int/int gives real/real! }
  995. if p^.treetype=slashn then
  996. begin
  997. CGMessage(type_h_use_div_for_int);
  998. p^.right:=gentypeconvnode(p^.right,bestrealdef^);
  999. p^.left:=gentypeconvnode(p^.left,bestrealdef^);
  1000. firstpass(p^.left);
  1001. firstpass(p^.right);
  1002. { maybe we need an integer register to save }
  1003. { a reference }
  1004. if ((p^.left^.location.loc<>LOC_FPU) or
  1005. (p^.right^.location.loc<>LOC_FPU)) and
  1006. (p^.left^.registers32=p^.right^.registers32) then
  1007. calcregisters(p,1,1,0)
  1008. else
  1009. calcregisters(p,0,1,0);
  1010. p^.location.loc:=LOC_FPU;
  1011. end
  1012. else
  1013. begin
  1014. p^.right:=gentypeconvnode(p^.right,s32bitdef);
  1015. p^.left:=gentypeconvnode(p^.left,s32bitdef);
  1016. firstpass(p^.left);
  1017. firstpass(p^.right);
  1018. calcregisters(p,1,0,0);
  1019. p^.location.loc:=LOC_REGISTER;
  1020. end;
  1021. end;
  1022. if codegenerror then
  1023. exit;
  1024. { determines result type for comparions }
  1025. { here the is a problem with multiple passes }
  1026. { example length(s)+1 gets internal 'longint' type first }
  1027. { if it is a arg it is converted to 'LONGINT' }
  1028. { but a second first pass will reset this to 'longint' }
  1029. case p^.treetype of
  1030. ltn,lten,gtn,gten,equaln,unequaln:
  1031. begin
  1032. if (not assigned(p^.resulttype)) or
  1033. (p^.resulttype^.deftype=stringdef) then
  1034. p^.resulttype:=booldef;
  1035. if is_64bitint(p^.left^.resulttype) then
  1036. p^.location.loc:=LOC_JUMP
  1037. else
  1038. p^.location.loc:=LOC_FLAGS;
  1039. end;
  1040. xorn:
  1041. begin
  1042. if not assigned(p^.resulttype) then
  1043. p^.resulttype:=p^.left^.resulttype;
  1044. p^.location.loc:=LOC_REGISTER;
  1045. end;
  1046. addn:
  1047. begin
  1048. if not assigned(p^.resulttype) then
  1049. begin
  1050. { for strings, return is always a 255 char string }
  1051. if is_shortstring(p^.left^.resulttype) then
  1052. p^.resulttype:=cshortstringdef
  1053. else
  1054. p^.resulttype:=p^.left^.resulttype;
  1055. end;
  1056. end;
  1057. else
  1058. p^.resulttype:=p^.left^.resulttype;
  1059. end;
  1060. end;
  1061. end.
  1062. {
  1063. $Log$
  1064. Revision 1.40 1999-08-04 13:03:13 jonas
  1065. * all tokens now start with an underscore
  1066. * PowerPC compiles!!
  1067. Revision 1.39 1999/08/04 00:23:33 florian
  1068. * renamed i386asm and i386base to cpuasm and cpubase
  1069. Revision 1.38 1999/08/03 22:03:24 peter
  1070. * moved bitmask constants to sets
  1071. * some other type/const renamings
  1072. Revision 1.37 1999/07/16 10:04:37 peter
  1073. * merged
  1074. Revision 1.36 1999/06/17 15:32:48 pierre
  1075. * merged from 0-99-12 branch
  1076. Revision 1.34.2.3 1999/07/16 09:54:58 peter
  1077. * @procvar support in tp7 mode works again
  1078. Revision 1.34.2.2 1999/06/17 15:25:07 pierre
  1079. * for arrays of char operators can not be overloaded
  1080. Revision 1.35 1999/06/17 13:19:57 pierre
  1081. * merged from 0_99_12 branch
  1082. Revision 1.34.2.1 1999/06/17 12:35:23 pierre
  1083. * allow array binary operator overloading if not with orddef
  1084. Revision 1.34 1999/06/02 10:11:52 florian
  1085. * make cycle fixed i.e. compilation with 0.99.10
  1086. * some fixes for qword
  1087. * start of register calling conventions
  1088. Revision 1.33 1999/05/27 19:45:12 peter
  1089. * removed oldasm
  1090. * plabel -> pasmlabel
  1091. * -a switches to source writing automaticly
  1092. * assembler readers OOPed
  1093. * asmsymbol automaticly external
  1094. * jumptables and other label fixes for asm readers
  1095. Revision 1.32 1999/05/23 18:42:18 florian
  1096. * better error recovering in typed constants
  1097. * some problems with arrays of const fixed, some problems
  1098. due my previous
  1099. - the location type of array constructor is now LOC_MEM
  1100. - the pushing of high fixed
  1101. - parameter copying fixed
  1102. - zero temp. allocation removed
  1103. * small problem in the assembler writers fixed:
  1104. ref to nil wasn't written correctly
  1105. Revision 1.31 1999/05/19 20:40:14 florian
  1106. * fixed a couple of array related bugs:
  1107. - var a : array[0..1] of char; p : pchar; p:=a+123; works now
  1108. - open arrays with an odd size doesn't work: movsb wasn't generated
  1109. - introduced some new array type helper routines (is_special_array) etc.
  1110. - made the array type checking in isconvertable more strict, often
  1111. open array can be used where is wasn't allowed etc...
  1112. Revision 1.30 1999/05/11 00:47:02 peter
  1113. + constant operations on enums, only in fpc mode
  1114. Revision 1.29 1999/05/06 09:05:32 peter
  1115. * generic write_float and str_float
  1116. * fixed constant float conversions
  1117. Revision 1.28 1999/05/01 13:24:46 peter
  1118. * merged nasm compiler
  1119. * old asm moved to oldasm/
  1120. Revision 1.27 1999/04/28 06:02:14 florian
  1121. * changes of Bruessel:
  1122. + message handler can now take an explicit self
  1123. * typinfo fixed: sometimes the type names weren't written
  1124. * the type checking for pointer comparisations and subtraction
  1125. and are now more strict (was also buggy)
  1126. * small bug fix to link.pas to support compiling on another
  1127. drive
  1128. * probable bug in popt386 fixed: call/jmp => push/jmp
  1129. transformation didn't count correctly the jmp references
  1130. + threadvar support
  1131. * warning if ln/sqrt gets an invalid constant argument
  1132. Revision 1.26 1999/04/16 20:44:37 florian
  1133. * the boolean operators =;<>;xor with LOC_JUMP and LOC_FLAGS
  1134. operands fixed, small things for new ansistring management
  1135. Revision 1.25 1999/04/15 09:01:34 peter
  1136. * fixed set loading
  1137. * object inheritance support for browser
  1138. Revision 1.24 1999/04/08 11:34:00 peter
  1139. * int/int warning removed, only the hint is left
  1140. Revision 1.23 1999/03/02 22:52:19 peter
  1141. * fixed char array, which can start with all possible values
  1142. Revision 1.22 1999/02/22 02:15:43 peter
  1143. * updates for ag386bin
  1144. Revision 1.21 1999/01/20 21:05:09 peter
  1145. * fixed set operations which still had array constructor as type
  1146. Revision 1.20 1999/01/20 17:39:26 jonas
  1147. + fixed bug0163 (set1 <= set2 support)
  1148. Revision 1.19 1998/12/30 13:35:35 peter
  1149. * fix for boolean=true compares
  1150. Revision 1.18 1998/12/15 17:12:35 peter
  1151. * pointer+ord not allowed in tp mode
  1152. Revision 1.17 1998/12/11 00:03:51 peter
  1153. + globtype,tokens,version unit splitted from globals
  1154. Revision 1.16 1998/12/10 09:47:31 florian
  1155. + basic operations with int64/qord (compiler with -dint64)
  1156. + rtti of enumerations extended: names are now written
  1157. Revision 1.15 1998/11/24 22:59:05 peter
  1158. * handle array of char the same as strings
  1159. Revision 1.14 1998/11/17 00:36:47 peter
  1160. * more ansistring fixes
  1161. Revision 1.13 1998/11/16 15:33:05 peter
  1162. * fixed return for ansistrings
  1163. Revision 1.12 1998/11/05 14:28:16 peter
  1164. * fixed unknown set operation msg
  1165. Revision 1.11 1998/11/05 12:03:02 peter
  1166. * released useansistring
  1167. * removed -Sv, its now available in fpc modes
  1168. Revision 1.10 1998/11/04 10:11:46 peter
  1169. * ansistring fixes
  1170. Revision 1.9 1998/10/25 23:32:04 peter
  1171. * fixed u32bit - s32bit conversion problems
  1172. Revision 1.8 1998/10/22 12:12:28 pierre
  1173. + better error info on unimplemented set operators
  1174. Revision 1.7 1998/10/21 15:12:57 pierre
  1175. * bug fix for IOCHECK inside a procedure with iocheck modifier
  1176. * removed the GPF for unexistant overloading
  1177. (firstcall was called with procedinition=nil !)
  1178. * changed typen to what Florian proposed
  1179. gentypenode(p : pdef) sets the typenodetype field
  1180. and resulttype is only set if inside bt_type block !
  1181. Revision 1.6 1998/10/20 15:09:24 florian
  1182. + binary operators for ansi strings
  1183. Revision 1.5 1998/10/20 08:07:05 pierre
  1184. * several memory corruptions due to double freemem solved
  1185. => never use p^.loc.location:=p^.left^.loc.location;
  1186. + finally I added now by default
  1187. that ra386dir translates global and unit symbols
  1188. + added a first field in tsymtable and
  1189. a nextsym field in tsym
  1190. (this allows to obtain ordered type info for
  1191. records and objects in gdb !)
  1192. Revision 1.4 1998/10/14 12:53:39 peter
  1193. * fixed small tp7 things
  1194. * boolean:=longbool and longbool fixed
  1195. Revision 1.3 1998/10/11 14:31:19 peter
  1196. + checks for division by zero
  1197. Revision 1.2 1998/10/05 21:33:31 peter
  1198. * fixed 161,165,166,167,168
  1199. Revision 1.1 1998/09/23 20:42:24 peter
  1200. * splitted pass_1
  1201. }