htypechk.pas 27 KB

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