htypechk.pas 27 KB

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