tcadd.pas 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293
  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. {$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)^.is_class) 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)^.is_class) 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=s64bit) or (porddef(ld)^.typ=s64bit) then
  434. begin
  435. if (porddef(ld)^.typ<>s64bit) then
  436. begin
  437. p^.left:=gentypeconvnode(p^.left,cs64bitdef);
  438. firstpass(p^.left);
  439. end;
  440. if (porddef(rd)^.typ<>s64bit) then
  441. begin
  442. p^.right:=gentypeconvnode(p^.right,cs64bitdef);
  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)^.is_class and pobjectdef(ld)^.is_class then
  801. begin
  802. p^.location.loc:=LOC_REGISTER;
  803. if pobjectdef(rd)^.is_related(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)^.is_related(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)^.is_class 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)^.is_class 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. { support procvar=nil,procvar<>nil }
  890. if ((ld^.deftype=procvardef) and (rt=niln)) or
  891. ((rd^.deftype=procvardef) and (lt=niln)) then
  892. begin
  893. calcregisters(p,1,0,0);
  894. p^.location.loc:=LOC_REGISTER;
  895. case p^.treetype of
  896. equaln,unequaln : ;
  897. else
  898. CGMessage(type_e_mismatch);
  899. end;
  900. convdone:=true;
  901. end
  902. else
  903. if (rd^.deftype=pointerdef) or
  904. is_zero_based_array(rd) then
  905. begin
  906. if is_zero_based_array(rd) then
  907. begin
  908. p^.resulttype:=new(ppointerdef,init(parraydef(rd)^.definition));
  909. p^.right:=gentypeconvnode(p^.right,p^.resulttype);
  910. firstpass(p^.right);
  911. end;
  912. p^.location.loc:=LOC_REGISTER;
  913. p^.left:=gentypeconvnode(p^.left,s32bitdef);
  914. firstpass(p^.left);
  915. calcregisters(p,1,0,0);
  916. if p^.treetype=addn then
  917. begin
  918. if not(cs_extsyntax in aktmoduleswitches) or
  919. (not(is_pchar(ld)) and (m_tp in aktmodeswitches)) then
  920. CGMessage(type_e_mismatch);
  921. end
  922. else
  923. CGMessage(type_e_mismatch);
  924. convdone:=true;
  925. end
  926. else
  927. if (ld^.deftype=pointerdef) or
  928. is_zero_based_array(ld) then
  929. begin
  930. if is_zero_based_array(ld) then
  931. begin
  932. p^.resulttype:=new(ppointerdef,init(parraydef(ld)^.definition));
  933. p^.left:=gentypeconvnode(p^.left,p^.resulttype);
  934. firstpass(p^.left);
  935. end;
  936. p^.location.loc:=LOC_REGISTER;
  937. p^.right:=gentypeconvnode(p^.right,s32bitdef);
  938. firstpass(p^.right);
  939. calcregisters(p,1,0,0);
  940. case p^.treetype of
  941. addn,subn : begin
  942. if not(cs_extsyntax in aktmoduleswitches) or
  943. (not(is_pchar(ld)) and (m_tp in aktmodeswitches)) then
  944. CGMessage(type_e_mismatch);
  945. end;
  946. else
  947. CGMessage(type_e_mismatch);
  948. end;
  949. convdone:=true;
  950. end
  951. else
  952. if (rd^.deftype=procvardef) and (ld^.deftype=procvardef) and is_equal(rd,ld) then
  953. begin
  954. calcregisters(p,1,0,0);
  955. p^.location.loc:=LOC_REGISTER;
  956. case p^.treetype of
  957. equaln,unequaln : ;
  958. else
  959. CGMessage(type_e_mismatch);
  960. end;
  961. convdone:=true;
  962. end
  963. else
  964. {$ifdef SUPPORT_MMX}
  965. if (cs_mmx in aktlocalswitches) and is_mmx_able_array(ld) and
  966. is_mmx_able_array(rd) and is_equal(ld,rd) then
  967. begin
  968. firstpass(p^.right);
  969. firstpass(p^.left);
  970. case p^.treetype of
  971. addn,subn,xorn,orn,andn:
  972. ;
  973. { mul is a little bit restricted }
  974. muln:
  975. if not(mmx_type(p^.left^.resulttype) in
  976. [mmxu16bit,mmxs16bit,mmxfixed16]) then
  977. CGMessage(type_e_mismatch);
  978. else
  979. CGMessage(type_e_mismatch);
  980. end;
  981. p^.location.loc:=LOC_MMXREGISTER;
  982. calcregisters(p,0,0,1);
  983. convdone:=true;
  984. end
  985. else
  986. {$endif SUPPORT_MMX}
  987. if (ld^.deftype=enumdef) and (rd^.deftype=enumdef) and (is_equal(ld,rd)) then
  988. begin
  989. calcregisters(p,1,0,0);
  990. case p^.treetype of
  991. equaln,unequaln,
  992. ltn,lten,gtn,gten : ;
  993. else CGMessage(type_e_mismatch);
  994. end;
  995. convdone:=true;
  996. end;
  997. { the general solution is to convert to 32 bit int }
  998. if not convdone then
  999. begin
  1000. { but an int/int gives real/real! }
  1001. if p^.treetype=slashn then
  1002. begin
  1003. CGMessage(type_h_use_div_for_int);
  1004. p^.right:=gentypeconvnode(p^.right,bestrealdef^);
  1005. p^.left:=gentypeconvnode(p^.left,bestrealdef^);
  1006. firstpass(p^.left);
  1007. firstpass(p^.right);
  1008. { maybe we need an integer register to save }
  1009. { a reference }
  1010. if ((p^.left^.location.loc<>LOC_FPU) or
  1011. (p^.right^.location.loc<>LOC_FPU)) and
  1012. (p^.left^.registers32=p^.right^.registers32) then
  1013. calcregisters(p,1,1,0)
  1014. else
  1015. calcregisters(p,0,1,0);
  1016. p^.location.loc:=LOC_FPU;
  1017. end
  1018. else
  1019. begin
  1020. p^.right:=gentypeconvnode(p^.right,s32bitdef);
  1021. p^.left:=gentypeconvnode(p^.left,s32bitdef);
  1022. firstpass(p^.left);
  1023. firstpass(p^.right);
  1024. calcregisters(p,1,0,0);
  1025. p^.location.loc:=LOC_REGISTER;
  1026. end;
  1027. end;
  1028. if codegenerror then
  1029. exit;
  1030. { determines result type for comparions }
  1031. { here the is a problem with multiple passes }
  1032. { example length(s)+1 gets internal 'longint' type first }
  1033. { if it is a arg it is converted to 'LONGINT' }
  1034. { but a second first pass will reset this to 'longint' }
  1035. case p^.treetype of
  1036. ltn,lten,gtn,gten,equaln,unequaln:
  1037. begin
  1038. if (not assigned(p^.resulttype)) or
  1039. (p^.resulttype^.deftype=stringdef) then
  1040. p^.resulttype:=booldef;
  1041. if is_64bitint(p^.left^.resulttype) then
  1042. p^.location.loc:=LOC_JUMP
  1043. else
  1044. p^.location.loc:=LOC_FLAGS;
  1045. end;
  1046. xorn:
  1047. begin
  1048. if not assigned(p^.resulttype) then
  1049. p^.resulttype:=p^.left^.resulttype;
  1050. p^.location.loc:=LOC_REGISTER;
  1051. end;
  1052. addn:
  1053. begin
  1054. if not assigned(p^.resulttype) then
  1055. begin
  1056. { for strings, return is always a 255 char string }
  1057. if is_shortstring(p^.left^.resulttype) then
  1058. p^.resulttype:=cshortstringdef
  1059. else
  1060. p^.resulttype:=p^.left^.resulttype;
  1061. end;
  1062. end;
  1063. else
  1064. p^.resulttype:=p^.left^.resulttype;
  1065. end;
  1066. end;
  1067. end.
  1068. {
  1069. $Log$
  1070. Revision 1.38 1999-08-03 22:03:24 peter
  1071. * moved bitmask constants to sets
  1072. * some other type/const renamings
  1073. Revision 1.37 1999/07/16 10:04:37 peter
  1074. * merged
  1075. Revision 1.36 1999/06/17 15:32:48 pierre
  1076. * merged from 0-99-12 branch
  1077. Revision 1.34.2.3 1999/07/16 09:54:58 peter
  1078. * @procvar support in tp7 mode works again
  1079. Revision 1.34.2.2 1999/06/17 15:25:07 pierre
  1080. * for arrays of char operators can not be overloaded
  1081. Revision 1.35 1999/06/17 13:19:57 pierre
  1082. * merged from 0_99_12 branch
  1083. Revision 1.34.2.1 1999/06/17 12:35:23 pierre
  1084. * allow array binary operator overloading if not with orddef
  1085. Revision 1.34 1999/06/02 10:11:52 florian
  1086. * make cycle fixed i.e. compilation with 0.99.10
  1087. * some fixes for qword
  1088. * start of register calling conventions
  1089. Revision 1.33 1999/05/27 19:45:12 peter
  1090. * removed oldasm
  1091. * plabel -> pasmlabel
  1092. * -a switches to source writing automaticly
  1093. * assembler readers OOPed
  1094. * asmsymbol automaticly external
  1095. * jumptables and other label fixes for asm readers
  1096. Revision 1.32 1999/05/23 18:42:18 florian
  1097. * better error recovering in typed constants
  1098. * some problems with arrays of const fixed, some problems
  1099. due my previous
  1100. - the location type of array constructor is now LOC_MEM
  1101. - the pushing of high fixed
  1102. - parameter copying fixed
  1103. - zero temp. allocation removed
  1104. * small problem in the assembler writers fixed:
  1105. ref to nil wasn't written correctly
  1106. Revision 1.31 1999/05/19 20:40:14 florian
  1107. * fixed a couple of array related bugs:
  1108. - var a : array[0..1] of char; p : pchar; p:=a+123; works now
  1109. - open arrays with an odd size doesn't work: movsb wasn't generated
  1110. - introduced some new array type helper routines (is_special_array) etc.
  1111. - made the array type checking in isconvertable more strict, often
  1112. open array can be used where is wasn't allowed etc...
  1113. Revision 1.30 1999/05/11 00:47:02 peter
  1114. + constant operations on enums, only in fpc mode
  1115. Revision 1.29 1999/05/06 09:05:32 peter
  1116. * generic write_float and str_float
  1117. * fixed constant float conversions
  1118. Revision 1.28 1999/05/01 13:24:46 peter
  1119. * merged nasm compiler
  1120. * old asm moved to oldasm/
  1121. Revision 1.27 1999/04/28 06:02:14 florian
  1122. * changes of Bruessel:
  1123. + message handler can now take an explicit self
  1124. * typinfo fixed: sometimes the type names weren't written
  1125. * the type checking for pointer comparisations and subtraction
  1126. and are now more strict (was also buggy)
  1127. * small bug fix to link.pas to support compiling on another
  1128. drive
  1129. * probable bug in popt386 fixed: call/jmp => push/jmp
  1130. transformation didn't count correctly the jmp references
  1131. + threadvar support
  1132. * warning if ln/sqrt gets an invalid constant argument
  1133. Revision 1.26 1999/04/16 20:44:37 florian
  1134. * the boolean operators =;<>;xor with LOC_JUMP and LOC_FLAGS
  1135. operands fixed, small things for new ansistring management
  1136. Revision 1.25 1999/04/15 09:01:34 peter
  1137. * fixed set loading
  1138. * object inheritance support for browser
  1139. Revision 1.24 1999/04/08 11:34:00 peter
  1140. * int/int warning removed, only the hint is left
  1141. Revision 1.23 1999/03/02 22:52:19 peter
  1142. * fixed char array, which can start with all possible values
  1143. Revision 1.22 1999/02/22 02:15:43 peter
  1144. * updates for ag386bin
  1145. Revision 1.21 1999/01/20 21:05:09 peter
  1146. * fixed set operations which still had array constructor as type
  1147. Revision 1.20 1999/01/20 17:39:26 jonas
  1148. + fixed bug0163 (set1 <= set2 support)
  1149. Revision 1.19 1998/12/30 13:35:35 peter
  1150. * fix for boolean=true compares
  1151. Revision 1.18 1998/12/15 17:12:35 peter
  1152. * pointer+ord not allowed in tp mode
  1153. Revision 1.17 1998/12/11 00:03:51 peter
  1154. + globtype,tokens,version unit splitted from globals
  1155. Revision 1.16 1998/12/10 09:47:31 florian
  1156. + basic operations with int64/qord (compiler with -dint64)
  1157. + rtti of enumerations extended: names are now written
  1158. Revision 1.15 1998/11/24 22:59:05 peter
  1159. * handle array of char the same as strings
  1160. Revision 1.14 1998/11/17 00:36:47 peter
  1161. * more ansistring fixes
  1162. Revision 1.13 1998/11/16 15:33:05 peter
  1163. * fixed return for ansistrings
  1164. Revision 1.12 1998/11/05 14:28:16 peter
  1165. * fixed unknown set operation msg
  1166. Revision 1.11 1998/11/05 12:03:02 peter
  1167. * released useansistring
  1168. * removed -Sv, its now available in fpc modes
  1169. Revision 1.10 1998/11/04 10:11:46 peter
  1170. * ansistring fixes
  1171. Revision 1.9 1998/10/25 23:32:04 peter
  1172. * fixed u32bit - s32bit conversion problems
  1173. Revision 1.8 1998/10/22 12:12:28 pierre
  1174. + better error info on unimplemented set operators
  1175. Revision 1.7 1998/10/21 15:12:57 pierre
  1176. * bug fix for IOCHECK inside a procedure with iocheck modifier
  1177. * removed the GPF for unexistant overloading
  1178. (firstcall was called with procedinition=nil !)
  1179. * changed typen to what Florian proposed
  1180. gentypenode(p : pdef) sets the typenodetype field
  1181. and resulttype is only set if inside bt_type block !
  1182. Revision 1.6 1998/10/20 15:09:24 florian
  1183. + binary operators for ansi strings
  1184. Revision 1.5 1998/10/20 08:07:05 pierre
  1185. * several memory corruptions due to double freemem solved
  1186. => never use p^.loc.location:=p^.left^.loc.location;
  1187. + finally I added now by default
  1188. that ra386dir translates global and unit symbols
  1189. + added a first field in tsymtable and
  1190. a nextsym field in tsym
  1191. (this allows to obtain ordered type info for
  1192. records and objects in gdb !)
  1193. Revision 1.4 1998/10/14 12:53:39 peter
  1194. * fixed small tp7 things
  1195. * boolean:=longbool and longbool fixed
  1196. Revision 1.3 1998/10/11 14:31:19 peter
  1197. + checks for division by zero
  1198. Revision 1.2 1998/10/05 21:33:31 peter
  1199. * fixed 161,165,166,167,168
  1200. Revision 1.1 1998/09/23 20:42:24 peter
  1201. * splitted pass_1
  1202. }