types.pas 52 KB

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