htypechk.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. {
  2. $Id$
  3. Copyright (c) 1996-98 by Florian Klaempfl
  4. This unit exports some help routines for the type checking
  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 htypechk;
  19. interface
  20. uses
  21. tree,symtable;
  22. const
  23. { firstcallparan without varspez we don't count the ref }
  24. count_ref : boolean = true;
  25. get_para_resulttype : boolean = false;
  26. allow_array_constructor : boolean = false;
  27. { Conversion }
  28. function isconvertable(def_from,def_to : pdef;
  29. var doconv : tconverttype;fromtreetype : ttreetyp;
  30. explicit : boolean) : byte;
  31. { Register Allocation }
  32. procedure make_not_regable(p : ptree);
  33. procedure left_right_max(p : ptree);
  34. procedure calcregisters(p : ptree;r32,fpu,mmx : word);
  35. { subroutine handling }
  36. procedure test_protected_sym(sym : psym);
  37. procedure test_protected(p : ptree);
  38. function valid_for_formal_var(p : ptree) : boolean;
  39. function valid_for_formal_const(p : ptree) : boolean;
  40. function is_procsym_load(p:Ptree):boolean;
  41. function is_procsym_call(p:Ptree):boolean;
  42. function assignment_overloaded(from_def,to_def : pdef) : pprocdef;
  43. implementation
  44. uses
  45. globtype,systems,tokens,
  46. cobjects,verbose,globals,
  47. types,
  48. hcodegen;
  49. {****************************************************************************
  50. Convert
  51. ****************************************************************************}
  52. { Returns:
  53. 0 - Not convertable
  54. 1 - Convertable
  55. 2 - Convertable, but not first choice }
  56. function isconvertable(def_from,def_to : pdef;
  57. var doconv : tconverttype;fromtreetype : ttreetyp;
  58. explicit : boolean) : byte;
  59. { Tbasetype: uauto,uvoid,uchar,
  60. u8bit,u16bit,u32bit,
  61. s8bit,s16bit,s32,
  62. bool8bit,bool16bit,bool32bit,
  63. u64bit,s64bitint }
  64. type
  65. tbasedef=(bvoid,bchar,bint,bbool);
  66. const
  67. basedeftbl:array[tbasetype] of tbasedef =
  68. (bvoid,bvoid,bchar,
  69. bint,bint,bint,
  70. bint,bint,bint,
  71. bbool,bbool,bbool,bint,bint);
  72. basedefconverts : array[tbasedef,tbasedef] of tconverttype =
  73. ((tc_not_possible,tc_not_possible,tc_not_possible,tc_not_possible),
  74. (tc_not_possible,tc_equal,tc_not_possible,tc_not_possible),
  75. (tc_not_possible,tc_not_possible,tc_int_2_int,tc_int_2_bool),
  76. (tc_not_possible,tc_not_possible,tc_bool_2_int,tc_bool_2_bool));
  77. var
  78. b : byte;
  79. hd1,hd2 : pdef;
  80. begin
  81. { safety check }
  82. if not(assigned(def_from) and assigned(def_to)) then
  83. begin
  84. isconvertable:=0;
  85. exit;
  86. end;
  87. b:=0;
  88. { we walk the wanted (def_to) types and check then the def_from
  89. types if there is a conversion possible }
  90. case def_to^.deftype of
  91. orddef :
  92. begin
  93. case def_from^.deftype of
  94. orddef :
  95. begin
  96. doconv:=basedefconverts[basedeftbl[porddef(def_from)^.typ],basedeftbl[porddef(def_to)^.typ]];
  97. b:=1;
  98. if (doconv=tc_not_possible) or
  99. ((doconv=tc_int_2_bool) and
  100. (not explicit) and
  101. (not is_boolean(def_from))) or
  102. ((doconv=tc_bool_2_int) and
  103. (not explicit) and
  104. (not is_boolean(def_to))) then
  105. b:=0;
  106. end;
  107. enumdef :
  108. begin
  109. { needed for char(enum) }
  110. if explicit then
  111. begin
  112. doconv:=tc_int_2_int;
  113. b:=1;
  114. end;
  115. end;
  116. end;
  117. end;
  118. stringdef :
  119. begin
  120. case def_from^.deftype of
  121. stringdef :
  122. begin
  123. doconv:=tc_string_2_string;
  124. b:=1;
  125. end;
  126. orddef :
  127. begin
  128. { char to string}
  129. if is_char(def_from) then
  130. begin
  131. doconv:=tc_char_2_string;
  132. b:=1;
  133. end;
  134. end;
  135. arraydef :
  136. begin
  137. { array of char to string, the length check is done by the firstpass of this node }
  138. if is_chararray(def_from) then
  139. begin
  140. doconv:=tc_chararray_2_string;
  141. if (not(cs_ansistrings in aktlocalswitches) and
  142. is_shortstring(def_to)) or
  143. ((cs_ansistrings in aktlocalswitches) and
  144. is_ansistring(def_to)) then
  145. b:=1
  146. else
  147. b:=2;
  148. end;
  149. end;
  150. pointerdef :
  151. begin
  152. { pchar can be assigned to short/ansistrings }
  153. if is_pchar(def_from) and not(m_tp in aktmodeswitches) then
  154. begin
  155. doconv:=tc_pchar_2_string;
  156. b:=1;
  157. end;
  158. end;
  159. end;
  160. end;
  161. floatdef :
  162. begin
  163. case def_from^.deftype of
  164. orddef :
  165. begin { ordinal to real }
  166. if is_integer(def_from) then
  167. begin
  168. if pfloatdef(def_to)^.typ=f32bit then
  169. doconv:=tc_int_2_fix
  170. else
  171. doconv:=tc_int_2_real;
  172. b:=1;
  173. end;
  174. end;
  175. floatdef :
  176. begin { 2 float types ? }
  177. if pfloatdef(def_from)^.typ=pfloatdef(def_to)^.typ then
  178. doconv:=tc_equal
  179. else
  180. begin
  181. if pfloatdef(def_from)^.typ=f32bit then
  182. doconv:=tc_fix_2_real
  183. else
  184. if pfloatdef(def_to)^.typ=f32bit then
  185. doconv:=tc_real_2_fix
  186. else
  187. doconv:=tc_real_2_real;
  188. end;
  189. b:=1;
  190. end;
  191. end;
  192. end;
  193. enumdef :
  194. begin
  195. if (def_from^.deftype=enumdef) then
  196. begin
  197. if assigned(penumdef(def_from)^.basedef) then
  198. hd1:=penumdef(def_from)^.basedef
  199. else
  200. hd1:=def_from;
  201. if assigned(penumdef(def_to)^.basedef) then
  202. hd2:=penumdef(def_to)^.basedef
  203. else
  204. hd2:=def_to;
  205. if (hd1=hd2) then
  206. b:=1;
  207. end;
  208. end;
  209. arraydef :
  210. begin
  211. { open array is also compatible with a single element of its base type }
  212. if is_open_array(def_to) and
  213. is_equal(parraydef(def_to)^.definition,def_from) then
  214. begin
  215. doconv:=tc_equal;
  216. b:=1;
  217. end
  218. else
  219. begin
  220. case def_from^.deftype of
  221. pointerdef :
  222. begin
  223. if is_zero_based_array(def_to) and
  224. is_equal(ppointerdef(def_from)^.definition,parraydef(def_to)^.definition) then
  225. begin
  226. doconv:=tc_pointer_2_array;
  227. b:=1;
  228. end;
  229. end;
  230. stringdef :
  231. begin
  232. { string to array of char}
  233. if (not(is_special_array(def_to)) or is_open_array(def_to)) and
  234. is_equal(parraydef(def_to)^.definition,cchardef) then
  235. begin
  236. doconv:=tc_string_2_chararray;
  237. b:=1;
  238. end;
  239. end;
  240. end;
  241. end;
  242. end;
  243. pointerdef :
  244. begin
  245. case def_from^.deftype of
  246. stringdef :
  247. begin
  248. { string constant to zero terminated string constant }
  249. if (fromtreetype=stringconstn) and
  250. is_pchar(def_to) then
  251. begin
  252. doconv:=tc_cstring_2_pchar;
  253. b:=1;
  254. end;
  255. end;
  256. orddef :
  257. begin
  258. { char constant to zero terminated string constant }
  259. if (fromtreetype=ordconstn) and is_equal(def_from,cchardef) and
  260. is_pchar(def_to) then
  261. begin
  262. doconv:=tc_cchar_2_pchar;
  263. b:=1;
  264. end;
  265. end;
  266. arraydef :
  267. begin
  268. { chararray to pointer }
  269. if is_zero_based_array(def_from) and
  270. is_equal(parraydef(def_from)^.definition,ppointerdef(def_to)^.definition) then
  271. begin
  272. doconv:=tc_array_2_pointer;
  273. b:=1;
  274. end;
  275. end;
  276. pointerdef :
  277. begin
  278. { child class pointer can be assigned to anchestor pointers }
  279. if (
  280. (ppointerdef(def_from)^.definition^.deftype=objectdef) and
  281. (ppointerdef(def_to)^.definition^.deftype=objectdef) and
  282. pobjectdef(ppointerdef(def_from)^.definition)^.isrelated(
  283. pobjectdef(ppointerdef(def_to)^.definition))
  284. ) or
  285. { all pointers can be assigned to void-pointer }
  286. is_equal(ppointerdef(def_to)^.definition,voiddef) or
  287. { in my opnion, is this not clean pascal }
  288. { well, but it's handy to use, it isn't ? (FK) }
  289. is_equal(ppointerdef(def_from)^.definition,voiddef) then
  290. begin
  291. doconv:=tc_equal;
  292. b:=1;
  293. end;
  294. end;
  295. procvardef :
  296. begin
  297. { procedure variable can be assigned to an void pointer }
  298. { Not anymore. Use the @ operator now.}
  299. if not(m_tp_procvar in aktmodeswitches) and
  300. (ppointerdef(def_to)^.definition^.deftype=orddef) and
  301. (porddef(ppointerdef(def_to)^.definition)^.typ=uvoid) then
  302. begin
  303. doconv:=tc_equal;
  304. b:=1;
  305. end;
  306. end;
  307. classrefdef,
  308. objectdef :
  309. begin
  310. { class types and class reference type
  311. can be assigned to void pointers }
  312. if (
  313. ((def_from^.deftype=objectdef) and pobjectdef(def_from)^.isclass) or
  314. (def_from^.deftype=classrefdef)
  315. ) and
  316. (ppointerdef(def_to)^.definition^.deftype=orddef) and
  317. (porddef(ppointerdef(def_to)^.definition)^.typ=uvoid) then
  318. begin
  319. doconv:=tc_equal;
  320. b:=1;
  321. end;
  322. end;
  323. end;
  324. end;
  325. setdef :
  326. begin
  327. { automatic arrayconstructor -> set conversion }
  328. if is_array_constructor(def_from) then
  329. begin
  330. doconv:=tc_arrayconstructor_2_set;
  331. b:=1;
  332. end;
  333. end;
  334. procvardef :
  335. begin
  336. { proc -> procvar }
  337. if (def_from^.deftype=procdef) then
  338. begin
  339. doconv:=tc_proc_2_procvar;
  340. if proc_to_procvar_equal(pprocdef(def_from),pprocvardef(def_to)) then
  341. b:=1;
  342. end
  343. else
  344. { for example delphi allows the assignement from pointers }
  345. { to procedure variables }
  346. if (m_pointer_2_procedure in aktmodeswitches) and
  347. (def_from^.deftype=pointerdef) and
  348. (ppointerdef(def_from)^.definition^.deftype=orddef) and
  349. (porddef(ppointerdef(def_from)^.definition)^.typ=uvoid) then
  350. begin
  351. doconv:=tc_equal;
  352. b:=1;
  353. end
  354. else
  355. { nil is compatible with procvars }
  356. if (fromtreetype=niln) then
  357. begin
  358. doconv:=tc_equal;
  359. b:=1;
  360. end;
  361. end;
  362. objectdef :
  363. begin
  364. { object pascal objects }
  365. if (def_from^.deftype=objectdef) {and
  366. pobjectdef(def_from)^.isclass and pobjectdef(def_to)^.isclass }then
  367. begin
  368. doconv:=tc_equal;
  369. if pobjectdef(def_from)^.isrelated(pobjectdef(def_to)) then
  370. b:=1;
  371. end
  372. else
  373. { nil is compatible with class instances }
  374. if (fromtreetype=niln) and (pobjectdef(def_to)^.isclass) then
  375. begin
  376. doconv:=tc_equal;
  377. b:=1;
  378. end;
  379. end;
  380. classrefdef :
  381. begin
  382. { class reference types }
  383. if (def_from^.deftype=classrefdef) then
  384. begin
  385. doconv:=tc_equal;
  386. if pobjectdef(pclassrefdef(def_from)^.definition)^.isrelated(
  387. pobjectdef(pclassrefdef(def_to)^.definition)) then
  388. b:=1;
  389. end
  390. else
  391. { nil is compatible with class references }
  392. if (fromtreetype=niln) then
  393. begin
  394. doconv:=tc_equal;
  395. b:=1;
  396. end;
  397. end;
  398. filedef :
  399. begin
  400. { typed files are all equal to the abstract file type
  401. name TYPEDFILE in system.pp in is_equal in types.pas
  402. the problem is that it sholud be also compatible to FILE
  403. but this would leed to a problem for ASSIGN RESET and REWRITE
  404. when trying to find the good overloaded function !!
  405. so all file function are doubled in system.pp
  406. this is not very beautiful !!}
  407. if (def_from^.deftype=filedef) and
  408. (
  409. (
  410. (pfiledef(def_from)^.filetype = ft_typed) and
  411. (pfiledef(def_to)^.filetype = ft_typed) and
  412. (
  413. (pfiledef(def_from)^.typed_as = pdef(voiddef)) or
  414. (pfiledef(def_to)^.typed_as = pdef(voiddef))
  415. )
  416. ) or
  417. (
  418. (
  419. (pfiledef(def_from)^.filetype = ft_untyped) and
  420. (pfiledef(def_to)^.filetype = ft_typed)
  421. ) or
  422. (
  423. (pfiledef(def_from)^.filetype = ft_typed) and
  424. (pfiledef(def_to)^.filetype = ft_untyped)
  425. )
  426. )
  427. ) then
  428. begin
  429. doconv:=tc_equal;
  430. b:=1;
  431. end
  432. end;
  433. else
  434. begin
  435. { assignment overwritten ?? }
  436. if assignment_overloaded(def_from,def_to)<>nil then
  437. b:=2;
  438. end;
  439. end;
  440. isconvertable:=b;
  441. end;
  442. {****************************************************************************
  443. Register Calculation
  444. ****************************************************************************}
  445. { marks an lvalue as "unregable" }
  446. procedure make_not_regable(p : ptree);
  447. begin
  448. case p^.treetype of
  449. typeconvn :
  450. make_not_regable(p^.left);
  451. loadn :
  452. if p^.symtableentry^.typ=varsym then
  453. pvarsym(p^.symtableentry)^.var_options :=
  454. pvarsym(p^.symtableentry)^.var_options and not vo_regable;
  455. end;
  456. end;
  457. procedure left_right_max(p : ptree);
  458. begin
  459. if assigned(p^.left) then
  460. begin
  461. if assigned(p^.right) then
  462. begin
  463. p^.registers32:=max(p^.left^.registers32,p^.right^.registers32);
  464. p^.registersfpu:=max(p^.left^.registersfpu,p^.right^.registersfpu);
  465. {$ifdef SUPPORT_MMX}
  466. p^.registersmmx:=max(p^.left^.registersmmx,p^.right^.registersmmx);
  467. {$endif SUPPORT_MMX}
  468. end
  469. else
  470. begin
  471. p^.registers32:=p^.left^.registers32;
  472. p^.registersfpu:=p^.left^.registersfpu;
  473. {$ifdef SUPPORT_MMX}
  474. p^.registersmmx:=p^.left^.registersmmx;
  475. {$endif SUPPORT_MMX}
  476. end;
  477. end;
  478. end;
  479. { calculates the needed registers for a binary operator }
  480. procedure calcregisters(p : ptree;r32,fpu,mmx : word);
  481. begin
  482. left_right_max(p);
  483. { Only when the difference between the left and right registers < the
  484. wanted registers allocate the amount of registers }
  485. if assigned(p^.left) then
  486. begin
  487. if assigned(p^.right) then
  488. begin
  489. if (abs(p^.left^.registers32-p^.right^.registers32)<r32) then
  490. inc(p^.registers32,r32);
  491. if (abs(p^.left^.registersfpu-p^.right^.registersfpu)<fpu) then
  492. inc(p^.registersfpu,fpu);
  493. {$ifdef SUPPORT_MMX}
  494. if (abs(p^.left^.registersmmx-p^.right^.registersmmx)<mmx) then
  495. inc(p^.registersmmx,mmx);
  496. {$endif SUPPORT_MMX}
  497. end
  498. else
  499. begin
  500. if (p^.left^.registers32<r32) then
  501. inc(p^.registers32,r32);
  502. if (p^.left^.registersfpu<fpu) then
  503. inc(p^.registersfpu,fpu);
  504. {$ifdef SUPPORT_MMX}
  505. if (p^.left^.registersmmx<mmx) then
  506. inc(p^.registersmmx,mmx);
  507. {$endif SUPPORT_MMX}
  508. end;
  509. end;
  510. { error CGMessage, if more than 8 floating point }
  511. { registers are needed }
  512. if p^.registersfpu>8 then
  513. CGMessage(cg_e_too_complex_expr);
  514. end;
  515. {****************************************************************************
  516. Subroutine Handling
  517. ****************************************************************************}
  518. { protected field handling
  519. protected field can not appear in
  520. var parameters of function !!
  521. this can only be done after we have determined the
  522. overloaded function
  523. this is the reason why it is not in the parser, PM }
  524. procedure test_protected_sym(sym : psym);
  525. begin
  526. if ((sym^.properties and sp_protected)<>0) and
  527. ((sym^.owner^.symtabletype=unitsymtable) or
  528. ((sym^.owner^.symtabletype=objectsymtable) and
  529. (pobjectdef(sym^.owner^.defowner)^.owner^.symtabletype=unitsymtable))) then
  530. CGMessage(parser_e_cant_access_protected_member);
  531. end;
  532. procedure test_protected(p : ptree);
  533. begin
  534. case p^.treetype of
  535. loadn : test_protected_sym(p^.symtableentry);
  536. typeconvn : test_protected(p^.left);
  537. derefn : test_protected(p^.left);
  538. subscriptn : begin
  539. { test_protected(p^.left);
  540. Is a field of a protected var
  541. also protected ??? PM }
  542. test_protected_sym(p^.vs);
  543. end;
  544. end;
  545. end;
  546. function valid_for_formal_var(p : ptree) : boolean;
  547. var
  548. v : boolean;
  549. begin
  550. case p^.treetype of
  551. loadn : v:=(p^.symtableentry^.typ in [typedconstsym,varsym]);
  552. typeconvn : v:=valid_for_formal_var(p^.left);
  553. typen : v:=false;
  554. derefn,subscriptn,vecn,
  555. funcretn,selfn : v:=true;
  556. { procvars are callnodes first }
  557. calln : v:=assigned(p^.right) and not assigned(p^.left);
  558. { should this depend on mode ? }
  559. addrn : v:=true;
  560. { no other node accepted (PM) }
  561. else v:=false;
  562. end;
  563. valid_for_formal_var:=v;
  564. end;
  565. function valid_for_formal_const(p : ptree) : boolean;
  566. var
  567. v : boolean;
  568. begin
  569. { p must have been firstpass'd before }
  570. { accept about anything but not a statement ! }
  571. v:=true;
  572. if (p^.treetype in [calln,statementn]) then
  573. { if not assigned(p^.resulttype) or (p^.resulttype=pdef(voiddef)) then }
  574. v:=false;
  575. valid_for_formal_const:=v;
  576. end;
  577. function is_procsym_load(p:Ptree):boolean;
  578. begin
  579. is_procsym_load:=((p^.treetype=loadn) and (p^.symtableentry^.typ=procsym)) or
  580. ((p^.treetype=addrn) and (p^.left^.treetype=loadn)
  581. and (p^.left^.symtableentry^.typ=procsym)) ;
  582. end;
  583. { change a proc call to a procload for assignment to a procvar }
  584. { this can only happen for proc/function without arguments }
  585. function is_procsym_call(p:Ptree):boolean;
  586. begin
  587. is_procsym_call:=(p^.treetype=calln) and (p^.left=nil) and
  588. (((p^.symtableprocentry^.typ=procsym) and (p^.right=nil)) or
  589. ((p^.right<>nil) and (p^.right^.symtableprocentry^.typ=varsym)));
  590. end;
  591. function assignment_overloaded(from_def,to_def : pdef) : pprocdef;
  592. var
  593. passproc : pprocdef;
  594. convtyp : tconverttype;
  595. begin
  596. assignment_overloaded:=nil;
  597. if assigned(overloaded_operators[assignment]) then
  598. passproc:=overloaded_operators[assignment]^.definition
  599. else
  600. exit;
  601. while passproc<>nil do
  602. begin
  603. if is_equal(passproc^.retdef,to_def) and
  604. (is_equal(passproc^.para1^.data,from_def) or
  605. (isconvertable(from_def,passproc^.para1^.data,convtyp,ordconstn,false)=1)) then
  606. begin
  607. assignment_overloaded:=passproc;
  608. break;
  609. end;
  610. passproc:=passproc^.nextoverloaded;
  611. end;
  612. end;
  613. end.
  614. {
  615. $Log$
  616. Revision 1.31 1999-07-16 10:04:32 peter
  617. * merged
  618. Revision 1.30 1999/06/28 16:02:30 peter
  619. * merged
  620. Revision 1.27.2.4 1999/07/16 09:52:18 peter
  621. * allow char(enum)
  622. Revision 1.27.2.3 1999/06/28 15:51:27 peter
  623. * tp7 fix
  624. Revision 1.27.2.2 1999/06/18 10:56:58 daniel
  625. - Enumerations no longer compatible with integer types
  626. Revision 1.27.2.1 1999/06/17 12:51:42 pierre
  627. * changed is_assignment_overloaded into
  628. function assignment_overloaded : pprocdef
  629. to allow overloading of assignment with only different result type
  630. Revision 1.27 1999/06/01 19:27:47 peter
  631. * better checks for procvar and methodpointer
  632. Revision 1.26 1999/05/20 14:58:26 peter
  633. * fixed arrayconstruct->set conversion which didn't work for enum sets
  634. Revision 1.25 1999/05/19 20:40:12 florian
  635. * fixed a couple of array related bugs:
  636. - var a : array[0..1] of char; p : pchar; p:=a+123; works now
  637. - open arrays with an odd size doesn't work: movsb wasn't generated
  638. - introduced some new array type helper routines (is_special_array) etc.
  639. - made the array type checking in isconvertable more strict, often
  640. open array can be used where is wasn't allowed etc...
  641. Revision 1.24 1999/05/06 10:10:02 peter
  642. * overloaded conversion has lower priority
  643. Revision 1.23 1999/04/26 09:30:47 peter
  644. * small tp7 fix
  645. * fix void pointer with formaldef
  646. Revision 1.22 1999/04/21 22:00:01 pierre
  647. + valid_for_formal_var and valid_for_formal_const added
  648. Revision 1.21 1999/04/21 16:31:40 pierre
  649. ra386att.pas : problem with commit -m !
  650. Revision 1.20 1999/04/15 08:56:27 peter
  651. * fixed bool-bool conversion
  652. Revision 1.19 1999/03/24 23:17:02 peter
  653. * fixed bugs 212,222,225,227,229,231,233
  654. Revision 1.18 1999/03/06 17:25:19 peter
  655. * moved comp<->real warning so it doesn't occure everytime that
  656. isconvertable is called with
  657. Revision 1.17 1999/03/02 18:24:20 peter
  658. * fixed overloading of array of char
  659. Revision 1.16 1999/01/27 13:53:27 pierre
  660. htypechk.pas
  661. Revision 1.15 1999/01/27 13:12:10 pierre
  662. * bool to int must be explicit
  663. Revision 1.14 1999/01/19 15:55:32 pierre
  664. * fix for boolean to comp conversion (now disabled)
  665. Revision 1.13 1998/12/15 17:11:37 peter
  666. * string:=pchar not allowed in tp mode
  667. Revision 1.12 1998/12/11 00:03:18 peter
  668. + globtype,tokens,version unit splitted from globals
  669. Revision 1.11 1998/12/10 09:47:21 florian
  670. + basic operations with int64/qord (compiler with -dint64)
  671. + rtti of enumerations extended: names are now written
  672. Revision 1.10 1998/11/29 12:40:23 peter
  673. * newcnv -> not oldcnv
  674. Revision 1.9 1998/11/26 13:10:42 peter
  675. * new int - int conversion -dNEWCNV
  676. * some function renamings
  677. Revision 1.8 1998/11/17 00:36:42 peter
  678. * more ansistring fixes
  679. Revision 1.7 1998/10/14 13:33:24 peter
  680. * fixed small typo
  681. Revision 1.6 1998/10/14 12:53:38 peter
  682. * fixed small tp7 things
  683. * boolean:=longbool and longbool fixed
  684. Revision 1.5 1998/10/12 09:49:58 florian
  685. + support of <procedure var type>:=<pointer> in delphi mode added
  686. Revision 1.4 1998/09/30 16:42:52 peter
  687. * fixed bool-bool cnv
  688. Revision 1.3 1998/09/24 23:49:05 peter
  689. + aktmodeswitches
  690. Revision 1.2 1998/09/24 09:02:14 peter
  691. * rewritten isconvertable to use case
  692. * array of .. and single variable are compatible
  693. Revision 1.1 1998/09/23 20:42:22 peter
  694. * splitted pass_1
  695. }