types.pas 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484
  1. {
  2. $Id$
  3. Copyright (C) 1993-98 by Florian Klaempfl
  4. This unit provides some help routines for type handling
  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 types;
  19. interface
  20. uses
  21. cobjects,globals,symtable,aasm;
  22. type
  23. tmmxtype = (mmxno,mmxu8bit,mmxs8bit,mmxu16bit,mmxs16bit,
  24. mmxu32bit,mmxs32bit,mmxfixed16,mmxsingle);
  25. { returns true, if def defines an ordinal type }
  26. function is_ordinal(def : pdef) : boolean;
  27. { returns the min. value of the type }
  28. function get_min_value(def : pdef) : longint;
  29. { returns true, if def defines an ordinal type }
  30. function is_integer(def : pdef) : boolean;
  31. { true if p is a boolean }
  32. function is_boolean(def : pdef) : boolean;
  33. { true if p is a char }
  34. function is_char(def : pdef) : boolean;
  35. { true if p points to an open string def }
  36. function is_open_string(p : pdef) : boolean;
  37. { true if p points to an open array def }
  38. function is_open_array(p : pdef) : boolean;
  39. { true, if p points to an array of const def }
  40. function is_array_constructor(p : pdef) : boolean;
  41. { true if p is an ansi string def }
  42. function is_ansistring(p : pdef) : boolean;
  43. { true if p is a long string def }
  44. function is_longstring(p : pdef) : boolean;
  45. { true if p is a wide string def }
  46. function is_widestring(p : pdef) : boolean;
  47. { true if p is a short string def }
  48. function is_shortstring(p : pdef) : boolean;
  49. { true if p is a char array def }
  50. function is_chararray(p : pdef) : boolean;
  51. { true if p is a pchar def }
  52. function is_pchar(p : pdef) : boolean;
  53. { true if p is a smallset def }
  54. function is_smallset(p : pdef) : boolean;
  55. { returns true, if def defines a signed data type (only for ordinal types) }
  56. function is_signed(def : pdef) : boolean;
  57. { returns true, if def uses FPU }
  58. function is_fpu(def : pdef) : boolean;
  59. { true if the return value is in EAX }
  60. function ret_in_acc(def : pdef) : boolean;
  61. { true if uses a parameter as return value }
  62. function ret_in_param(def : pdef) : boolean;
  63. { true, if def is a 64 bit int type }
  64. function is_64bitint(def : pdef) : boolean;
  65. function push_high_param(def : pdef) : boolean;
  66. { true if a parameter is too large to copy and only the address is pushed }
  67. function push_addr_param(def : pdef) : boolean;
  68. { true if we must never copy this parameter }
  69. const
  70. never_copy_const_param : boolean = false;
  71. { true, if def1 and def2 are semantical the same }
  72. function is_equal(def1,def2 : pdef) : boolean;
  73. { checks for type compatibility (subgroups of type) }
  74. { used for case statements... probably missing stuff }
  75. { to use on other types }
  76. function is_subequal(def1, def2: pdef): boolean;
  77. { true, if two parameter lists are equal }
  78. { if value_equal_const is true, call by value }
  79. { and call by const parameter are assumed as }
  80. { equal }
  81. function equal_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
  82. { true if a function can be assigned to a procvar }
  83. function proc_to_procvar_equal(def1,def2 : pabstractprocdef) : boolean;
  84. { if l isn't in the range of def a range check error is generated }
  85. procedure testrange(def : pdef;l : longint);
  86. { returns the range of def }
  87. procedure getrange(def : pdef;var l : longint;var h : longint);
  88. { generates a VMT for _class }
  89. procedure genvmt(_class : pobjectdef);
  90. { generates the message tables for a class }
  91. function genstrmsgtab(_class : pobjectdef) : plabel;
  92. function genintmsgtab(_class : pobjectdef) : plabel;
  93. { some type helper routines for MMX support }
  94. function is_mmx_able_array(p : pdef) : boolean;
  95. { returns the mmx type }
  96. function mmx_type(p : pdef) : tmmxtype;
  97. implementation
  98. uses
  99. strings,globtype,verbose;
  100. function equal_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
  101. begin
  102. while (assigned(def1)) and (assigned(def2)) do
  103. begin
  104. if value_equal_const then
  105. begin
  106. if not(is_equal(def1^.data,def2^.data)) or
  107. ((def1^.paratyp<>def2^.paratyp) and
  108. ((def1^.paratyp=vs_var) or
  109. (def1^.paratyp=vs_var)
  110. )
  111. ) then
  112. begin
  113. equal_paras:=false;
  114. exit;
  115. end;
  116. end
  117. else
  118. begin
  119. if not(is_equal(def1^.data,def2^.data)) or
  120. (def1^.paratyp<>def2^.paratyp) then
  121. begin
  122. equal_paras:=false;
  123. exit;
  124. end;
  125. end;
  126. def1:=def1^.next;
  127. def2:=def2^.next;
  128. end;
  129. if (def1=nil) and (def2=nil) then
  130. equal_paras:=true
  131. else
  132. equal_paras:=false;
  133. end;
  134. { true if a function can be assigned to a procvar }
  135. function proc_to_procvar_equal(def1,def2 : pabstractprocdef) : boolean;
  136. begin
  137. if is_equal(def1^.retdef,def2^.retdef) and
  138. equal_paras(def1^.para1,def2^.para1,false) and
  139. ((def1^.options and po_compatibility_options)=
  140. (def2^.options and po_compatibility_options)) then
  141. proc_to_procvar_equal:=true
  142. else
  143. proc_to_procvar_equal:=false;
  144. end;
  145. { returns true, if def uses FPU }
  146. function is_fpu(def : pdef) : boolean;
  147. begin
  148. is_fpu:=(def^.deftype=floatdef) and (pfloatdef(def)^.typ<>f32bit);
  149. end;
  150. { true if p is an ordinal }
  151. function is_ordinal(def : pdef) : boolean;
  152. var
  153. dt : tbasetype;
  154. begin
  155. case def^.deftype of
  156. orddef : begin
  157. dt:=porddef(def)^.typ;
  158. is_ordinal:=dt in [uchar,u8bit,u16bit,u32bit,u64bit,s8bit,s16bit,s32bit,
  159. s64bitint,bool8bit,bool16bit,bool32bit];
  160. end;
  161. enumdef : is_ordinal:=true;
  162. else
  163. is_ordinal:=false;
  164. end;
  165. end;
  166. { returns the min. value of the type }
  167. function get_min_value(def : pdef) : longint;
  168. begin
  169. case def^.deftype of
  170. orddef:
  171. get_min_value:=porddef(def)^.low;
  172. enumdef:
  173. get_min_value:=penumdef(def)^.min;
  174. else
  175. get_min_value:=0;
  176. end;
  177. end;
  178. { true if p is an integer }
  179. function is_integer(def : pdef) : boolean;
  180. begin
  181. is_integer:=(def^.deftype=orddef) and
  182. (porddef(def)^.typ in [uauto,u8bit,u16bit,u32bit,s8bit,s16bit,s32bit]);
  183. end;
  184. { true if p is a boolean }
  185. function is_boolean(def : pdef) : boolean;
  186. begin
  187. is_boolean:=(def^.deftype=orddef) and
  188. (porddef(def)^.typ in [bool8bit,bool16bit,bool32bit]);
  189. end;
  190. { true if p is a char }
  191. function is_char(def : pdef) : boolean;
  192. begin
  193. is_char:=(def^.deftype=orddef) and
  194. (porddef(def)^.typ=uchar);
  195. end;
  196. { true if p is signed (integer) }
  197. function is_signed(def : pdef) : boolean;
  198. var
  199. dt : tbasetype;
  200. begin
  201. case def^.deftype of
  202. orddef : begin
  203. dt:=porddef(def)^.typ;
  204. is_signed:=(dt in [s8bit,s16bit,s32bit]);
  205. end;
  206. enumdef : is_signed:=false;
  207. else
  208. is_signed:=false;
  209. end;
  210. end;
  211. { true, if p points to an open array def }
  212. function is_open_string(p : pdef) : boolean;
  213. begin
  214. is_open_string:=(p^.deftype=stringdef) and
  215. (pstringdef(p)^.string_typ=st_shortstring) and
  216. (pstringdef(p)^.len=0);
  217. end;
  218. { true, if p points to an open array def }
  219. function is_open_array(p : pdef) : boolean;
  220. begin
  221. is_open_array:=(p^.deftype=arraydef) and
  222. (parraydef(p)^.lowrange=0) and
  223. (parraydef(p)^.highrange=-1);
  224. end;
  225. { true, if p points to an array of const def }
  226. function is_array_constructor(p : pdef) : boolean;
  227. begin
  228. is_array_constructor:=(p^.deftype=arraydef) and
  229. (parraydef(p)^.IsConstructor);
  230. end;
  231. { true if p is an ansi string def }
  232. function is_ansistring(p : pdef) : boolean;
  233. begin
  234. is_ansistring:=(p^.deftype=stringdef) and
  235. (pstringdef(p)^.string_typ=st_ansistring);
  236. end;
  237. { true if p is an long string def }
  238. function is_longstring(p : pdef) : boolean;
  239. begin
  240. is_longstring:=(p^.deftype=stringdef) and
  241. (pstringdef(p)^.string_typ=st_longstring);
  242. end;
  243. { true if p is an wide string def }
  244. function is_widestring(p : pdef) : boolean;
  245. begin
  246. is_widestring:=(p^.deftype=stringdef) and
  247. (pstringdef(p)^.string_typ=st_widestring);
  248. end;
  249. { true if p is an short string def }
  250. function is_shortstring(p : pdef) : boolean;
  251. begin
  252. is_shortstring:=(p^.deftype=stringdef) and
  253. (pstringdef(p)^.string_typ=st_shortstring);
  254. end;
  255. { true if p is a char array def }
  256. function is_chararray(p : pdef) : boolean;
  257. begin
  258. is_chararray:=(p^.deftype=arraydef) and
  259. (parraydef(p)^.lowrange=0) and
  260. is_equal(parraydef(p)^.definition,cchardef);
  261. end;
  262. { true if p is a pchar def }
  263. function is_pchar(p : pdef) : boolean;
  264. begin
  265. is_pchar:=(p^.deftype=pointerdef) and
  266. is_equal(Ppointerdef(p)^.definition,cchardef);
  267. end;
  268. { true if p is a smallset def }
  269. function is_smallset(p : pdef) : boolean;
  270. begin
  271. is_smallset:=(p^.deftype=setdef) and
  272. (psetdef(p)^.settype=smallset);
  273. end;
  274. { true if the return value is in accumulator (EAX for i386), D0 for 68k }
  275. function ret_in_acc(def : pdef) : boolean;
  276. begin
  277. ret_in_acc:=(def^.deftype in [orddef,pointerdef,enumdef,classrefdef]) or
  278. ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_ansistring,st_widestring])) or
  279. ((def^.deftype=procvardef) and ((pprocvardef(def)^.options and pomethodpointer)=0)) or
  280. ((def^.deftype=objectdef) and pobjectdef(def)^.isclass) or
  281. ((def^.deftype=setdef) and (psetdef(def)^.settype=smallset)) or
  282. ((def^.deftype=floatdef) and (pfloatdef(def)^.typ=f32bit));
  283. end;
  284. { true, if def is a 64 bit int type }
  285. function is_64bitint(def : pdef) : boolean;
  286. begin
  287. is_64bitint:=(def^.deftype=orddef) and (porddef(def)^.typ in [u64bit,s64bitint])
  288. end;
  289. { true if uses a parameter as return value }
  290. function ret_in_param(def : pdef) : boolean;
  291. begin
  292. ret_in_param:=(def^.deftype in [arraydef,recorddef]) or
  293. ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_shortstring,st_longstring])) or
  294. ((def^.deftype=procvardef) and ((pprocvardef(def)^.options and pomethodpointer)<>0)) or
  295. ((def^.deftype=objectdef) and not(pobjectdef(def)^.isclass)) or
  296. ((def^.deftype=setdef) and (psetdef(def)^.settype<>smallset));
  297. end;
  298. function push_high_param(def : pdef) : boolean;
  299. begin
  300. push_high_param:=is_open_array(def) or is_open_string(def);
  301. end;
  302. { true if a parameter is too large to copy and only the address is pushed }
  303. function push_addr_param(def : pdef) : boolean;
  304. begin
  305. push_addr_param:=never_copy_const_param or
  306. (def^.deftype in [arraydef,formaldef,recorddef]) or
  307. ((def^.deftype=objectdef) and not(pobjectdef(def)^.isclass)) or
  308. ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_shortstring,st_longstring])) or
  309. ((def^.deftype=procvardef) and ((pprocvardef(def)^.options and pomethodpointer)<>0)) or
  310. ((def^.deftype=setdef) and (psetdef(def)^.settype<>smallset));
  311. end;
  312. { test if l is in the range of def, outputs error if out of range }
  313. procedure testrange(def : pdef;l : longint);
  314. var
  315. lv,hv: longint;
  316. begin
  317. getrange(def,lv,hv);
  318. if (def^.deftype=orddef) and
  319. (porddef(def)^.typ=u32bit) then
  320. begin
  321. if lv<=hv then
  322. begin
  323. if (l<lv) or (l>hv) then
  324. begin
  325. if (cs_check_range in aktlocalswitches) then
  326. Message(parser_e_range_check_error)
  327. else
  328. Message(parser_w_range_check_error);
  329. end;
  330. end
  331. else
  332. { this happens with the wrap around problem }
  333. { if lv is positive and hv is over $7ffffff }
  334. { so it seems negative }
  335. begin
  336. if ((l>=0) and (l<lv)) or
  337. ((l<0) and (l>hv)) then
  338. begin
  339. if (cs_check_range in aktlocalswitches) then
  340. Message(parser_e_range_check_error)
  341. else
  342. Message(parser_w_range_check_error);
  343. end;
  344. end;
  345. end
  346. else if (l<lv) or (l>hv) then
  347. begin
  348. if (cs_check_range in aktlocalswitches) then
  349. Message(parser_e_range_check_error)
  350. else
  351. Message(parser_w_range_check_error);
  352. end;
  353. end;
  354. { return the range from def in l and h }
  355. procedure getrange(def : pdef;var l : longint;var h : longint);
  356. begin
  357. case def^.deftype of
  358. orddef : begin
  359. l:=porddef(def)^.low;
  360. h:=porddef(def)^.high;
  361. end;
  362. enumdef : begin
  363. l:=penumdef(def)^.min;
  364. h:=penumdef(def)^.max;
  365. end;
  366. else
  367. internalerror(987);
  368. end;
  369. end;
  370. function mmx_type(p : pdef) : tmmxtype;
  371. begin
  372. mmx_type:=mmxno;
  373. if is_mmx_able_array(p) then
  374. begin
  375. if parraydef(p)^.definition^.deftype=floatdef then
  376. case pfloatdef(parraydef(p)^.definition)^.typ of
  377. s32real:
  378. mmx_type:=mmxsingle;
  379. f16bit:
  380. mmx_type:=mmxfixed16
  381. end
  382. else
  383. case porddef(parraydef(p)^.definition)^.typ of
  384. u8bit:
  385. mmx_type:=mmxu8bit;
  386. s8bit:
  387. mmx_type:=mmxs8bit;
  388. u16bit:
  389. mmx_type:=mmxu16bit;
  390. s16bit:
  391. mmx_type:=mmxs16bit;
  392. u32bit:
  393. mmx_type:=mmxu32bit;
  394. s32bit:
  395. mmx_type:=mmxs32bit;
  396. end;
  397. end;
  398. end;
  399. function is_mmx_able_array(p : pdef) : boolean;
  400. begin
  401. {$ifdef SUPPORT_MMX}
  402. if (cs_mmx_saturation in aktlocalswitches) then
  403. begin
  404. is_mmx_able_array:=(p^.deftype=arraydef) and
  405. (
  406. (
  407. (parraydef(p)^.definition^.deftype=orddef) and
  408. (
  409. (
  410. (parraydef(p)^.lowrange=0) and
  411. (parraydef(p)^.highrange=1) and
  412. (porddef(parraydef(p)^.definition)^.typ in [u32bit,s32bit])
  413. )
  414. or
  415. (
  416. (parraydef(p)^.lowrange=0) and
  417. (parraydef(p)^.highrange=3) and
  418. (porddef(parraydef(p)^.definition)^.typ in [u16bit,s16bit])
  419. )
  420. )
  421. )
  422. or
  423. (
  424. (
  425. (parraydef(p)^.definition^.deftype=floatdef) and
  426. (
  427. (parraydef(p)^.lowrange=0) and
  428. (parraydef(p)^.highrange=3) and
  429. (pfloatdef(parraydef(p)^.definition)^.typ=f16bit)
  430. ) or
  431. (
  432. (parraydef(p)^.lowrange=0) and
  433. (parraydef(p)^.highrange=1) and
  434. (pfloatdef(parraydef(p)^.definition)^.typ=s32real)
  435. )
  436. )
  437. )
  438. );
  439. end
  440. else
  441. begin
  442. is_mmx_able_array:=(p^.deftype=arraydef) and
  443. (
  444. (
  445. (parraydef(p)^.definition^.deftype=orddef) and
  446. (
  447. (
  448. (parraydef(p)^.lowrange=0) and
  449. (parraydef(p)^.highrange=1) and
  450. (porddef(parraydef(p)^.definition)^.typ in [u32bit,s32bit])
  451. )
  452. or
  453. (
  454. (parraydef(p)^.lowrange=0) and
  455. (parraydef(p)^.highrange=3) and
  456. (porddef(parraydef(p)^.definition)^.typ in [u16bit,s16bit])
  457. )
  458. or
  459. (
  460. (parraydef(p)^.lowrange=0) and
  461. (parraydef(p)^.highrange=7) and
  462. (porddef(parraydef(p)^.definition)^.typ in [u8bit,s8bit])
  463. )
  464. )
  465. )
  466. or
  467. (
  468. (parraydef(p)^.definition^.deftype=floatdef) and
  469. (
  470. (
  471. (parraydef(p)^.lowrange=0) and
  472. (parraydef(p)^.highrange=3) and
  473. (pfloatdef(parraydef(p)^.definition)^.typ=f32bit)
  474. )
  475. or
  476. (
  477. (parraydef(p)^.lowrange=0) and
  478. (parraydef(p)^.highrange=1) and
  479. (pfloatdef(parraydef(p)^.definition)^.typ=s32real)
  480. )
  481. )
  482. )
  483. );
  484. end;
  485. {$else SUPPORT_MMX}
  486. is_mmx_able_array:=false;
  487. {$endif SUPPORT_MMX}
  488. end;
  489. function is_equal(def1,def2 : pdef) : boolean;
  490. var
  491. b : boolean;
  492. hd : pdef;
  493. hp1,hp2 : pdefcoll;
  494. begin
  495. { both types must exists }
  496. if not (assigned(def1) and assigned(def2)) then
  497. begin
  498. is_equal:=false;
  499. exit;
  500. end;
  501. { be sure, that if there is a stringdef, that this is def1 }
  502. if def2^.deftype=stringdef then
  503. begin
  504. hd:=def1;
  505. def1:=def2;
  506. def2:=hd;
  507. end;
  508. b:=false;
  509. { both point to the same definition ? }
  510. if def1=def2 then
  511. b:=true
  512. else
  513. { pointer with an equal definition are equal }
  514. if (def1^.deftype=pointerdef) and (def2^.deftype=pointerdef) then
  515. { here a problem detected in tabsolutesym }
  516. { the types can be forward type !! }
  517. begin
  518. if assigned(def1^.sym) and ((def1^.sym^.properties and sp_forwarddef)<>0) then
  519. b:=(def1^.sym=def2^.sym)
  520. else
  521. b:=ppointerdef(def1)^.definition=ppointerdef(def2)^.definition;
  522. end
  523. else
  524. { ordinals are equal only when the ordinal type is equal }
  525. if (def1^.deftype=orddef) and (def2^.deftype=orddef) then
  526. begin
  527. case porddef(def1)^.typ of
  528. u8bit,u16bit,u32bit,
  529. s8bit,s16bit,s32bit:
  530. b:=((porddef(def1)^.typ=porddef(def2)^.typ) and
  531. (porddef(def1)^.low=porddef(def2)^.low) and
  532. (porddef(def1)^.high=porddef(def2)^.high));
  533. uvoid,uchar,
  534. bool8bit,bool16bit,bool32bit:
  535. b:=(porddef(def1)^.typ=porddef(def2)^.typ);
  536. end;
  537. end
  538. else
  539. if (def1^.deftype=floatdef) and (def2^.deftype=floatdef) then
  540. b:=pfloatdef(def1)^.typ=pfloatdef(def2)^.typ
  541. else
  542. { strings with the same length are equal }
  543. if (def1^.deftype=stringdef) and (def2^.deftype=stringdef) and
  544. (pstringdef(def1)^.string_typ=pstringdef(def2)^.string_typ) then
  545. begin
  546. b:=not(is_shortstring(def1)) or
  547. (pstringdef(def1)^.len=pstringdef(def2)^.len);
  548. end
  549. { STRING[N] ist equivalent zu ARRAY[0..N] OF CHAR (N<256) }
  550. {
  551. else if ((def1^.deftype=stringdef) and (def2^.deftype=arraydef)) and
  552. (parraydef(def2)^.definition^.deftype=orddef) and
  553. (porddef(parraydef(def1)^.definition)^.typ=uchar) and
  554. (parraydef(def2)^.lowrange=0) and
  555. (parraydef(def2)^.highrange=pstringdef(def1)^.len) then
  556. b:=true }
  557. else
  558. if (def1^.deftype=formaldef) and (def2^.deftype=formaldef) then
  559. b:=true
  560. { file types with the same file element type are equal }
  561. { this is a problem for assign !! }
  562. { changed to allow if one is untyped }
  563. { all typed files are equal to the special }
  564. { typed file that has voiddef as elemnt type }
  565. { but must NOT match for text file !!! }
  566. else
  567. if (def1^.deftype=filedef) and (def2^.deftype=filedef) then
  568. b:=(pfiledef(def1)^.filetype=pfiledef(def2)^.filetype) and
  569. ((
  570. ((pfiledef(def1)^.typed_as=nil) and
  571. (pfiledef(def2)^.typed_as=nil)) or
  572. (
  573. (pfiledef(def1)^.typed_as<>nil) and
  574. (pfiledef(def2)^.typed_as<>nil) and
  575. is_equal(pfiledef(def1)^.typed_as,pfiledef(def2)^.typed_as)
  576. ) or
  577. ( (pfiledef(def1)^.typed_as=pdef(voiddef)) or
  578. (pfiledef(def2)^.typed_as=pdef(voiddef))
  579. )))
  580. { sets with the same element type are equal }
  581. else
  582. if (def1^.deftype=setdef) and (def2^.deftype=setdef) then
  583. begin
  584. if assigned(psetdef(def1)^.setof) and
  585. assigned(psetdef(def2)^.setof) then
  586. b:=(psetdef(def1)^.setof^.deftype=psetdef(def2)^.setof^.deftype)
  587. else
  588. b:=true;
  589. end
  590. else
  591. if (def1^.deftype=procvardef) and (def2^.deftype=procvardef) then
  592. begin
  593. { poassembler isn't important for compatibility }
  594. { if a method is assigned to a methodpointer }
  595. { is checked before }
  596. b:=((pprocvardef(def1)^.options and not(poassembler or pomethodpointer or
  597. povirtualmethod or pooverridingmethod))=
  598. (pprocvardef(def2)^.options and not(poassembler or pomethodpointer or
  599. povirtualmethod or pooverridingmethod))
  600. ) and
  601. is_equal(pprocvardef(def1)^.retdef,pprocvardef(def2)^.retdef);
  602. { now evalute the parameters }
  603. if b then
  604. begin
  605. hp1:=pprocvardef(def1)^.para1;
  606. hp2:=pprocvardef(def1)^.para1;
  607. while assigned(hp1) and assigned(hp2) do
  608. begin
  609. if not(is_equal(hp1^.data,hp2^.data)) or
  610. not(hp1^.paratyp=hp2^.paratyp) then
  611. begin
  612. b:=false;
  613. break;
  614. end;
  615. hp1:=hp1^.next;
  616. hp2:=hp2^.next;
  617. end;
  618. b:=(hp1=nil) and (hp2=nil);
  619. end;
  620. end
  621. else
  622. if (def1^.deftype=arraydef) and (def2^.deftype=arraydef) and
  623. (is_open_array(def1) or is_open_array(def2)) then
  624. begin
  625. if parraydef(def1)^.IsArrayOfConst or parraydef(def2)^.IsArrayOfConst then
  626. b:=true
  627. else
  628. b:=is_equal(parraydef(def1)^.definition,parraydef(def2)^.definition);
  629. end
  630. else
  631. if (def1^.deftype=classrefdef) and (def2^.deftype=classrefdef) then
  632. begin
  633. { similar to pointerdef: }
  634. if assigned(def1^.sym) and ((def1^.sym^.properties and sp_forwarddef)<>0) then
  635. b:=(def1^.sym=def2^.sym)
  636. else
  637. b:=is_equal(pclassrefdef(def1)^.definition,pclassrefdef(def2)^.definition);
  638. end;
  639. is_equal:=b;
  640. end;
  641. function is_subequal(def1, def2: pdef): boolean;
  642. Begin
  643. if assigned(def1) and assigned(def2) then
  644. Begin
  645. is_subequal := FALSE;
  646. if (def1^.deftype = orddef) and (def2^.deftype = orddef) then
  647. Begin
  648. { see p.47 of Turbo Pascal 7.01 manual for the separation of types }
  649. { range checking for case statements is done with testrange }
  650. case porddef(def1)^.typ of
  651. u8bit,u16bit,u32bit,
  652. s8bit,s16bit,s32bit : is_subequal:=(porddef(def2)^.typ in [s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]);
  653. bool8bit,bool16bit,bool32bit : is_subequal:=(porddef(def2)^.typ in [bool8bit,bool16bit,bool32bit]);
  654. uchar : is_subequal:=(porddef(def2)^.typ=uchar);
  655. end;
  656. end
  657. else
  658. Begin
  659. { I assume that both enumerations are equal when the first }
  660. { pointers are equal. }
  661. if (def1^.deftype = enumdef) and (def2^.deftype =enumdef) then
  662. Begin
  663. if penumdef(def1)^.first = penumdef(def2)^.first then
  664. is_subequal := TRUE;
  665. end;
  666. end;
  667. end; { endif assigned ... }
  668. end;
  669. type
  670. pprocdeftree = ^tprocdeftree;
  671. tprocdeftree = record
  672. p : pprocdef;
  673. nl : plabel;
  674. l,r : pprocdeftree;
  675. end;
  676. var
  677. root : pprocdeftree;
  678. count : longint;
  679. procedure insertstr(p : pprocdeftree;var at : pprocdeftree);
  680. var
  681. i : longint;
  682. begin
  683. if at=nil then
  684. begin
  685. at:=p;
  686. inc(count);
  687. end
  688. else
  689. begin
  690. i:=strcomp(p^.p^.messageinf.str,at^.p^.messageinf.str);
  691. if i<0 then
  692. insertstr(p,at^.l)
  693. else if i>0 then
  694. insertstr(p,at^.r)
  695. else
  696. Message1(parser_e_duplicate_message_label,strpas(p^.p^.messageinf.str));
  697. end;
  698. end;
  699. procedure disposeprocdeftree(p : pprocdeftree);
  700. begin
  701. if assigned(p^.l) then
  702. disposeprocdeftree(p^.l);
  703. if assigned(p^.r) then
  704. disposeprocdeftree(p^.r);
  705. dispose(p);
  706. end;
  707. procedure insertmsgstr(p : psym);{$ifndef FPC}far;{$endif FPC}
  708. var
  709. hp : pprocdef;
  710. pt : pprocdeftree;
  711. begin
  712. if p^.typ=procsym then
  713. begin
  714. hp:=pprocsym(p)^.definition;
  715. while assigned(hp) do
  716. begin
  717. if (hp^.options and pomsgstr)<>0 then
  718. begin
  719. new(pt);
  720. pt^.p:=hp;
  721. pt^.l:=nil;
  722. pt^.r:=nil;
  723. insertstr(pt,root);
  724. end;
  725. hp:=hp^.nextoverloaded;
  726. end;
  727. end;
  728. end;
  729. procedure writenames(p : pprocdeftree);
  730. begin
  731. getlabel(p^.nl);
  732. if assigned(p^.l) then
  733. writenames(p^.l);
  734. datasegment^.concat(new(pai_label,init(p^.nl)));
  735. datasegment^.concat(new(pai_const,init_8bit(strlen(p^.p^.messageinf.str))));
  736. datasegment^.concat(new(pai_string,init_pchar(p^.p^.messageinf.str)));
  737. if assigned(p^.r) then
  738. writenames(p^.r);
  739. end;
  740. procedure writestrentry(p : pprocdeftree);
  741. begin
  742. if assigned(p^.l) then
  743. writestrentry(p^.l);
  744. { write name label }
  745. datasegment^.concat(new(pai_const,init_symbol(strpnew(lab2str(p^.nl)))));
  746. datasegment^.concat(new(pai_const,
  747. init_symbol(strpnew(p^.p^.mangledname))));
  748. maybe_concat_external(p^.p^.owner,p^.p^.mangledname);
  749. if assigned(p^.r) then
  750. writestrentry(p^.r);
  751. end;
  752. function genstrmsgtab(_class : pobjectdef) : plabel;
  753. var
  754. r : plabel;
  755. begin
  756. root:=nil;
  757. count:=0;
  758. { insert all message handlers into a tree, sorted by name }
  759. _class^.publicsyms^.foreach(insertmsgstr);
  760. { write all names }
  761. if assigned(root) then
  762. writenames(root);
  763. { now start writing of the message string table }
  764. getlabel(r);
  765. datasegment^.concat(new(pai_label,init(r)));
  766. genstrmsgtab:=r;
  767. datasegment^.concat(new(pai_const,init_32bit(count)));
  768. if assigned(root) then
  769. begin
  770. writestrentry(root);
  771. disposeprocdeftree(root);
  772. end;
  773. end;
  774. procedure insertint(p : pprocdeftree;var at : pprocdeftree);
  775. var
  776. i : longint;
  777. begin
  778. if at=nil then
  779. begin
  780. at:=p;
  781. inc(count);
  782. end
  783. else
  784. begin
  785. i:=strcomp(p^.p^.messageinf.str,at^.p^.messageinf.str);
  786. if p^.p^.messageinf.i<at^.p^.messageinf.i then
  787. insertstr(p,at^.l)
  788. else if p^.p^.messageinf.i>at^.p^.messageinf.i then
  789. insertstr(p,at^.r)
  790. else
  791. Message1(parser_e_duplicate_message_label,tostr(p^.p^.messageinf.i));
  792. end;
  793. end;
  794. procedure writeintentry(p : pprocdeftree);
  795. begin
  796. if assigned(p^.l) then
  797. writeintentry(p^.l);
  798. { write name label }
  799. datasegment^.concat(new(pai_const,init_32bit(p^.p^.messageinf.i)));
  800. datasegment^.concat(new(pai_const,
  801. init_symbol(strpnew(p^.p^.mangledname))));
  802. maybe_concat_external(p^.p^.owner,p^.p^.mangledname);
  803. if assigned(p^.r) then
  804. writeintentry(p^.r);
  805. end;
  806. procedure insertmsgint(p : psym);{$ifndef FPC}far;{$endif FPC}
  807. var
  808. hp : pprocdef;
  809. pt : pprocdeftree;
  810. begin
  811. if p^.typ=procsym then
  812. begin
  813. hp:=pprocsym(p)^.definition;
  814. while assigned(hp) do
  815. begin
  816. if (hp^.options and pomsgint)<>0 then
  817. begin
  818. new(pt);
  819. pt^.p:=hp;
  820. pt^.l:=nil;
  821. pt^.r:=nil;
  822. insertint(pt,root);
  823. end;
  824. hp:=hp^.nextoverloaded;
  825. end;
  826. end;
  827. end;
  828. function genintmsgtab(_class : pobjectdef) : plabel;
  829. var
  830. r : plabel;
  831. begin
  832. root:=nil;
  833. count:=0;
  834. { insert all message handlers into a tree, sorted by name }
  835. _class^.publicsyms^.foreach(insertmsgint);
  836. { now start writing of the message string table }
  837. getlabel(r);
  838. datasegment^.concat(new(pai_label,init(r)));
  839. genintmsgtab:=r;
  840. datasegment^.concat(new(pai_const,init_32bit(count)));
  841. if assigned(root) then
  842. begin
  843. writeintentry(root);
  844. disposeprocdeftree(root);
  845. end;
  846. end;
  847. type
  848. pprocdefcoll = ^tprocdefcoll;
  849. tprocdefcoll = record
  850. next : pprocdefcoll;
  851. data : pprocdef;
  852. end;
  853. psymcoll = ^tsymcoll;
  854. tsymcoll = record
  855. next : psymcoll;
  856. name : pstring;
  857. data : pprocdefcoll;
  858. end;
  859. var
  860. wurzel : psymcoll;
  861. nextvirtnumber : longint;
  862. _c : pobjectdef;
  863. has_constructor,has_virtual_method : boolean;
  864. procedure eachsym(sym : psym);{$ifndef FPC}far;{$endif FPC}
  865. var
  866. procdefcoll : pprocdefcoll;
  867. hp : pprocdef;
  868. symcoll : psymcoll;
  869. _name : string;
  870. stored : boolean;
  871. { creates a new entry in the procsym list }
  872. procedure newentry;
  873. begin
  874. { if not, generate a new symbol item }
  875. new(symcoll);
  876. symcoll^.name:=stringdup(sym^.name);
  877. symcoll^.next:=wurzel;
  878. symcoll^.data:=nil;
  879. wurzel:=symcoll;
  880. hp:=pprocsym(sym)^.definition;
  881. { inserts all definitions }
  882. while assigned(hp) do
  883. begin
  884. new(procdefcoll);
  885. procdefcoll^.data:=hp;
  886. procdefcoll^.next:=symcoll^.data;
  887. symcoll^.data:=procdefcoll;
  888. { if it's a virtual method }
  889. if (hp^.options and povirtualmethod)<>0 then
  890. begin
  891. { then it gets a number ... }
  892. hp^.extnumber:=nextvirtnumber;
  893. { and we inc the number }
  894. inc(nextvirtnumber);
  895. has_virtual_method:=true;
  896. end;
  897. if (hp^.options and poconstructor)<>0 then
  898. has_constructor:=true;
  899. { check, if a method should be overridden }
  900. if (hp^.options and pooverridingmethod)<>0 then
  901. Message1(parser_e_nothing_to_be_overridden,_c^.name^+'.'+_name);
  902. { next overloaded method }
  903. hp:=hp^.nextoverloaded;
  904. end;
  905. end;
  906. begin
  907. { put only sub routines into the VMT }
  908. if sym^.typ=procsym then
  909. begin
  910. _name:=sym^.name;
  911. symcoll:=wurzel;
  912. while assigned(symcoll) do
  913. begin
  914. { does the symbol already exist in the list ? }
  915. if _name=symcoll^.name^ then
  916. begin
  917. { walk through all defs of the symbol }
  918. hp:=pprocsym(sym)^.definition;
  919. while assigned(hp) do
  920. begin
  921. { compare with all stored definitions }
  922. procdefcoll:=symcoll^.data;
  923. stored:=false;
  924. while assigned(procdefcoll) do
  925. begin
  926. { compare parameters }
  927. if equal_paras(procdefcoll^.data^.para1,hp^.para1,false) and
  928. (
  929. ((procdefcoll^.data^.options and povirtualmethod)<>0) or
  930. ((hp^.options and povirtualmethod)<>0)
  931. ) then
  932. begin
  933. { wenn sie gleich sind }
  934. { und eine davon virtual deklariert ist }
  935. { Fehler falls nur eine VIRTUAL }
  936. if (procdefcoll^.data^.options and povirtualmethod)<>
  937. (hp^.options and povirtualmethod) then
  938. begin
  939. { in classes, we hide the old method }
  940. if _c^.isclass then
  941. begin
  942. { warn only if it is the first time,
  943. we hide the method }
  944. if _c=hp^._class then
  945. Message1(parser_w_should_use_override,_c^.name^+'.'+_name);
  946. newentry;
  947. exit;
  948. end
  949. else
  950. if _c=hp^._class then
  951. begin
  952. if (procdefcoll^.data^.options and povirtualmethod)<>0 then
  953. Message1(parser_w_overloaded_are_not_both_virtual,_c^.name^+'.'+_name)
  954. else
  955. Message1(parser_w_overloaded_are_not_both_non_virtual,
  956. _c^.name^+'.'+_name);
  957. newentry;
  958. exit;
  959. end;
  960. end;
  961. { check, if the overridden directive is set }
  962. { (povirtualmethod is set! }
  963. { class ? }
  964. if _c^.isclass and
  965. ((hp^.options and pooverridingmethod)=0) then
  966. begin
  967. { warn only if it is the first time,
  968. we hide the method }
  969. if _c=hp^._class then
  970. Message1(parser_w_should_use_override,_c^.name^+'.'+_name);
  971. newentry;
  972. exit;
  973. end;
  974. { error, if the return types aren't equal }
  975. if not(is_equal(procdefcoll^.data^.retdef,hp^.retdef)) and
  976. not((procdefcoll^.data^.retdef^.deftype=objectdef) and
  977. (hp^.retdef^.deftype=objectdef) and
  978. (pobjectdef(procdefcoll^.data^.retdef)^.isclass) and
  979. (pobjectdef(hp^.retdef)^.isclass) and
  980. (pobjectdef(hp^.retdef)^.isrelated(pobjectdef(procdefcoll^.data^.retdef)))) then
  981. Message1(parser_e_overloaded_methodes_not_same_ret,_c^.name^+'.'+_name);
  982. { the flags have to match }
  983. { except abstract and override }
  984. if (procdefcoll^.data^.options and not(poabstractmethod or pooverridingmethod))<>
  985. (hp^.options and not(poabstractmethod or pooverridingmethod)) then
  986. Message1(parser_e_header_dont_match_forward,_c^.name^+'.'+_name);
  987. { now set the number }
  988. hp^.extnumber:=procdefcoll^.data^.extnumber;
  989. { and exchange }
  990. procdefcoll^.data:=hp;
  991. stored:=true;
  992. end;
  993. procdefcoll:=procdefcoll^.next;
  994. end;
  995. { if it isn't saved in the list }
  996. { we create a new entry }
  997. if not(stored) then
  998. begin
  999. new(procdefcoll);
  1000. procdefcoll^.data:=hp;
  1001. procdefcoll^.next:=symcoll^.data;
  1002. symcoll^.data:=procdefcoll;
  1003. { if the method is virtual ... }
  1004. if (hp^.options and povirtualmethod)<>0 then
  1005. begin
  1006. { ... it will get a number }
  1007. hp^.extnumber:=nextvirtnumber;
  1008. inc(nextvirtnumber);
  1009. end;
  1010. { check, if a method should be overridden }
  1011. if (hp^.options and pooverridingmethod)<>0 then
  1012. Message1(parser_e_nothing_to_be_overridden,_c^.name^+'.'+_name);
  1013. end;
  1014. hp:=hp^.nextoverloaded;
  1015. end;
  1016. exit;
  1017. end;
  1018. symcoll:=symcoll^.next;
  1019. end;
  1020. newentry;
  1021. end;
  1022. end;
  1023. procedure genvmt(_class : pobjectdef);
  1024. procedure do_genvmt(p : pobjectdef);
  1025. begin
  1026. { start with the base class }
  1027. if assigned(p^.childof) then
  1028. do_genvmt(p^.childof);
  1029. { walk through all public syms }
  1030. _c:=_class;
  1031. {$ifdef tp}
  1032. p^.publicsyms^.foreach(eachsym);
  1033. {$else}
  1034. p^.publicsyms^.foreach(@eachsym);
  1035. {$endif}
  1036. end;
  1037. var
  1038. symcoll : psymcoll;
  1039. procdefcoll : pprocdefcoll;
  1040. i : longint;
  1041. begin
  1042. wurzel:=nil;
  1043. nextvirtnumber:=0;
  1044. has_constructor:=false;
  1045. has_virtual_method:=false;
  1046. { generates a tree of all used methods }
  1047. do_genvmt(_class);
  1048. if has_virtual_method and not(has_constructor) then
  1049. Message1(parser_w_virtual_without_constructor,_class^.name^);
  1050. { generates the VMT }
  1051. { walk trough all numbers for virtual methods and search }
  1052. { the method }
  1053. for i:=0 to nextvirtnumber-1 do
  1054. begin
  1055. symcoll:=wurzel;
  1056. { walk trough all symbols }
  1057. while assigned(symcoll) do
  1058. begin
  1059. { walk trough all methods }
  1060. procdefcoll:=symcoll^.data;
  1061. while assigned(procdefcoll) do
  1062. begin
  1063. { writes the addresses to the VMT }
  1064. { but only this which are declared as virtual }
  1065. if procdefcoll^.data^.extnumber=i then
  1066. begin
  1067. if (procdefcoll^.data^.options and povirtualmethod)<>0 then
  1068. begin
  1069. { if a method is abstract, then is also the }
  1070. { class abstract and it's not allow to }
  1071. { generates an instance }
  1072. if (procdefcoll^.data^.options and poabstractmethod)<>0 then
  1073. begin
  1074. _class^.options:=_class^.options or oo_is_abstract;
  1075. datasegment^.concat(new(pai_const,
  1076. init_symbol(strpnew('FPC_ABSTRACTERROR'))));
  1077. end
  1078. else
  1079. begin
  1080. datasegment^.concat(new(pai_const,
  1081. init_symbol(strpnew(procdefcoll^.data^.mangledname))));
  1082. maybe_concat_external(procdefcoll^.data^.owner,
  1083. procdefcoll^.data^.mangledname);
  1084. end;
  1085. end;
  1086. end;
  1087. procdefcoll:=procdefcoll^.next;
  1088. end;
  1089. symcoll:=symcoll^.next;
  1090. end;
  1091. end;
  1092. { disposes the above generated tree }
  1093. symcoll:=wurzel;
  1094. while assigned(symcoll) do
  1095. begin
  1096. wurzel:=symcoll^.next;
  1097. stringdispose(symcoll^.name);
  1098. procdefcoll:=symcoll^.data;
  1099. while assigned(procdefcoll) do
  1100. begin
  1101. symcoll^.data:=procdefcoll^.next;
  1102. dispose(procdefcoll);
  1103. procdefcoll:=symcoll^.data;
  1104. end;
  1105. dispose(symcoll);
  1106. symcoll:=wurzel;
  1107. end;
  1108. end;
  1109. end.
  1110. {
  1111. $Log$
  1112. Revision 1.52 1999-02-24 09:51:44 florian
  1113. * wrong warning fixed, if a non-virtual method was hidden by a virtual
  1114. method (repoerted by Matthias Koeppe)
  1115. Revision 1.51 1999/02/22 23:33:31 florian
  1116. + message directive for integers added
  1117. Revision 1.50 1999/02/22 20:13:42 florian
  1118. + first implementation of message keyword
  1119. Revision 1.49 1999/02/16 00:45:30 peter
  1120. * fixed crashes by forgotten strpnew() for init_symbol
  1121. Revision 1.48 1999/02/09 23:03:08 florian
  1122. * check for duplicate field names in inherited classes/objects
  1123. * bug with self from the mailing list solved (the problem
  1124. was that classes were sometimes pushed wrong)
  1125. Revision 1.47 1999/01/27 00:14:01 florian
  1126. * "procedure of object"-stuff fixed
  1127. Revision 1.46 1999/01/21 22:10:54 peter
  1128. * fixed array of const
  1129. * generic platform independent high() support
  1130. Revision 1.45 1999/01/20 12:34:22 peter
  1131. * fixed typed file read/write
  1132. Revision 1.44 1999/01/15 11:33:03 pierre
  1133. * bug in mmx code removed
  1134. Revision 1.43 1998/12/30 13:41:20 peter
  1135. * released valuepara
  1136. Revision 1.42 1998/12/11 00:04:03 peter
  1137. + globtype,tokens,version unit splitted from globals
  1138. Revision 1.41 1998/12/10 09:47:33 florian
  1139. + basic operations with int64/qord (compiler with -dint64)
  1140. + rtti of enumerations extended: names are now written
  1141. Revision 1.40 1998/12/04 10:18:14 florian
  1142. * some stuff for procedures of object added
  1143. * bug with overridden virtual constructors fixed (reported by Italo Gomes)
  1144. Revision 1.39 1998/11/27 14:50:55 peter
  1145. + open strings, $P switch support
  1146. Revision 1.38 1998/11/18 15:44:24 peter
  1147. * VALUEPARA for tp7 compatible value parameters
  1148. Revision 1.37 1998/11/13 10:15:50 peter
  1149. * fixed ptr() with constants
  1150. Revision 1.36 1998/11/10 10:09:21 peter
  1151. * va_list -> array of const
  1152. Revision 1.35 1998/10/19 08:55:13 pierre
  1153. * wrong stabs info corrected once again !!
  1154. + variable vmt offset with vmt field only if required
  1155. implemented now !!!
  1156. Revision 1.34 1998/10/12 09:50:06 florian
  1157. + support of <procedure var type>:=<pointer> in delphi mode added
  1158. Revision 1.33 1998/10/06 20:43:30 peter
  1159. * fixed set of bugs. like set of false..true set of #1..#255 and
  1160. set of #1..true which was allowed
  1161. Revision 1.32 1998/10/05 21:33:35 peter
  1162. * fixed 161,165,166,167,168
  1163. Revision 1.31 1998/09/23 09:58:56 peter
  1164. * first working array of const things
  1165. Revision 1.30 1998/09/22 15:40:58 peter
  1166. * some extra ifdef GDB
  1167. Revision 1.29 1998/09/16 12:37:31 michael
  1168. Added FPC_ prefix to abstracterror
  1169. Revision 1.28 1998/09/09 16:44:23 florian
  1170. * I hope, the case bug is fixed now
  1171. Revision 1.27 1998/09/07 17:37:07 florian
  1172. * first fixes for published properties
  1173. Revision 1.26 1998/09/04 12:24:31 florian
  1174. * bug0159 fixed
  1175. Revision 1.25 1998/09/04 09:06:36 florian
  1176. * bug0132 fixed
  1177. Revision 1.24 1998/09/04 08:36:49 peter
  1178. * fixed boolean:=integer which is not explicit
  1179. Revision 1.23 1998/09/01 17:39:55 peter
  1180. + internal constant functions
  1181. Revision 1.22 1998/09/01 12:53:28 peter
  1182. + aktpackenum
  1183. Revision 1.21 1998/08/19 00:42:45 peter
  1184. + subrange types for enums
  1185. + checking for bounds type with ranges
  1186. Revision 1.20 1998/08/18 14:17:14 pierre
  1187. * bug about assigning the return value of a function to
  1188. a procvar fixed : warning
  1189. assigning a proc to a procvar need @ in FPC mode !!
  1190. * missing file/line info restored
  1191. Revision 1.19 1998/08/18 09:24:48 pierre
  1192. * small warning position bug fixed
  1193. * support_mmx switches splitting was missing
  1194. * rhide error and warning output corrected
  1195. Revision 1.18 1998/08/14 18:18:49 peter
  1196. + dynamic set contruction
  1197. * smallsets are now working (always longint size)
  1198. Revision 1.17 1998/08/05 16:00:17 florian
  1199. * some fixes for ansi strings
  1200. Revision 1.16 1998/07/20 23:35:50 michael
  1201. Const ansistrings are not copied.
  1202. Revision 1.15 1998/07/18 22:54:32 florian
  1203. * some ansi/wide/longstring support fixed:
  1204. o parameter passing
  1205. o returning as result from functions
  1206. Revision 1.14 1998/06/12 14:50:50 peter
  1207. * removed the tree dependency to types.pas
  1208. * long_fil.pas support (not fully tested yet)
  1209. Revision 1.13 1998/06/03 22:49:07 peter
  1210. + wordbool,longbool
  1211. * rename bis,von -> high,low
  1212. * moved some systemunit loading/creating to psystem.pas
  1213. Revision 1.12 1998/05/12 10:47:00 peter
  1214. * moved printstatus to verb_def
  1215. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1216. prefix like error: warning: and is included in V_Default
  1217. * fixed some messages
  1218. * first time parameter scan is only for -v and -T
  1219. - removed old style messages
  1220. Revision 1.11 1998/05/01 16:38:46 florian
  1221. * handling of private and protected fixed
  1222. + change_keywords_to_tp implemented to remove
  1223. keywords which aren't supported by tp
  1224. * break and continue are now symbols of the system unit
  1225. + widestring, longstring and ansistring type released
  1226. Revision 1.10 1998/04/29 10:34:08 pierre
  1227. + added some code for ansistring (not complete nor working yet)
  1228. * corrected operator overloading
  1229. * corrected nasm output
  1230. + started inline procedures
  1231. + added starstarn : use ** for exponentiation (^ gave problems)
  1232. + started UseTokenInfo cond to get accurate positions
  1233. Revision 1.9 1998/04/21 10:16:49 peter
  1234. * patches from strasbourg
  1235. * objects is not used anymore in the fpc compiled version
  1236. Revision 1.8 1998/04/12 22:39:44 florian
  1237. * problem with read access to properties solved
  1238. * correct handling of hidding methods via virtual (COM)
  1239. * correct result type of constructor calls (COM), the resulttype
  1240. depends now on the type of the class reference
  1241. Revision 1.7 1998/04/10 21:36:56 florian
  1242. + some stuff to support method pointers (procedure of object) added
  1243. (declaration, parameter handling)
  1244. Revision 1.6 1998/04/10 15:39:49 florian
  1245. * more fixes to get classes.pas compiled
  1246. Revision 1.5 1998/04/09 23:02:16 florian
  1247. * small problems solved to get remake3 work
  1248. Revision 1.4 1998/04/08 16:58:09 pierre
  1249. * several bugfixes
  1250. ADD ADC and AND are also sign extended
  1251. nasm output OK (program still crashes at end
  1252. and creates wrong assembler files !!)
  1253. procsym types sym in tdef removed !!
  1254. Revision 1.3 1998/04/08 11:34:22 peter
  1255. * nasm works (linux only tested)
  1256. }