tcadd.pas 49 KB

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