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_symbol,init(lab2str(p^.nl))));
  746. datasegment^.concat(new(pai_const_symbol,init(p^.p^.mangledname)));
  747. maybe_concat_external(p^.p^.owner,p^.p^.mangledname);
  748. if assigned(p^.r) then
  749. writestrentry(p^.r);
  750. end;
  751. function genstrmsgtab(_class : pobjectdef) : plabel;
  752. var
  753. r : plabel;
  754. begin
  755. root:=nil;
  756. count:=0;
  757. { insert all message handlers into a tree, sorted by name }
  758. _class^.publicsyms^.foreach(insertmsgstr);
  759. { write all names }
  760. if assigned(root) then
  761. writenames(root);
  762. { now start writing of the message string table }
  763. getlabel(r);
  764. datasegment^.concat(new(pai_label,init(r)));
  765. genstrmsgtab:=r;
  766. datasegment^.concat(new(pai_const,init_32bit(count)));
  767. if assigned(root) then
  768. begin
  769. writestrentry(root);
  770. disposeprocdeftree(root);
  771. end;
  772. end;
  773. procedure insertint(p : pprocdeftree;var at : pprocdeftree);
  774. var
  775. i : longint;
  776. begin
  777. if at=nil then
  778. begin
  779. at:=p;
  780. inc(count);
  781. end
  782. else
  783. begin
  784. i:=strcomp(p^.p^.messageinf.str,at^.p^.messageinf.str);
  785. if p^.p^.messageinf.i<at^.p^.messageinf.i then
  786. insertstr(p,at^.l)
  787. else if p^.p^.messageinf.i>at^.p^.messageinf.i then
  788. insertstr(p,at^.r)
  789. else
  790. Message1(parser_e_duplicate_message_label,tostr(p^.p^.messageinf.i));
  791. end;
  792. end;
  793. procedure writeintentry(p : pprocdeftree);
  794. begin
  795. if assigned(p^.l) then
  796. writeintentry(p^.l);
  797. { write name label }
  798. datasegment^.concat(new(pai_const,init_32bit(p^.p^.messageinf.i)));
  799. datasegment^.concat(new(pai_const_symbol,init(p^.p^.mangledname)));
  800. maybe_concat_external(p^.p^.owner,p^.p^.mangledname);
  801. if assigned(p^.r) then
  802. writeintentry(p^.r);
  803. end;
  804. procedure insertmsgint(p : psym);{$ifndef FPC}far;{$endif FPC}
  805. var
  806. hp : pprocdef;
  807. pt : pprocdeftree;
  808. begin
  809. if p^.typ=procsym then
  810. begin
  811. hp:=pprocsym(p)^.definition;
  812. while assigned(hp) do
  813. begin
  814. if (hp^.options and pomsgint)<>0 then
  815. begin
  816. new(pt);
  817. pt^.p:=hp;
  818. pt^.l:=nil;
  819. pt^.r:=nil;
  820. insertint(pt,root);
  821. end;
  822. hp:=hp^.nextoverloaded;
  823. end;
  824. end;
  825. end;
  826. function genintmsgtab(_class : pobjectdef) : plabel;
  827. var
  828. r : plabel;
  829. begin
  830. root:=nil;
  831. count:=0;
  832. { insert all message handlers into a tree, sorted by name }
  833. _class^.publicsyms^.foreach(insertmsgint);
  834. { now start writing of the message string table }
  835. getlabel(r);
  836. datasegment^.concat(new(pai_label,init(r)));
  837. genintmsgtab:=r;
  838. datasegment^.concat(new(pai_const,init_32bit(count)));
  839. if assigned(root) then
  840. begin
  841. writeintentry(root);
  842. disposeprocdeftree(root);
  843. end;
  844. end;
  845. type
  846. pprocdefcoll = ^tprocdefcoll;
  847. tprocdefcoll = record
  848. next : pprocdefcoll;
  849. data : pprocdef;
  850. end;
  851. psymcoll = ^tsymcoll;
  852. tsymcoll = record
  853. next : psymcoll;
  854. name : pstring;
  855. data : pprocdefcoll;
  856. end;
  857. var
  858. wurzel : psymcoll;
  859. nextvirtnumber : longint;
  860. _c : pobjectdef;
  861. has_constructor,has_virtual_method : boolean;
  862. procedure eachsym(sym : psym);{$ifndef FPC}far;{$endif FPC}
  863. var
  864. procdefcoll : pprocdefcoll;
  865. hp : pprocdef;
  866. symcoll : psymcoll;
  867. _name : string;
  868. stored : boolean;
  869. { creates a new entry in the procsym list }
  870. procedure newentry;
  871. begin
  872. { if not, generate a new symbol item }
  873. new(symcoll);
  874. symcoll^.name:=stringdup(sym^.name);
  875. symcoll^.next:=wurzel;
  876. symcoll^.data:=nil;
  877. wurzel:=symcoll;
  878. hp:=pprocsym(sym)^.definition;
  879. { inserts all definitions }
  880. while assigned(hp) do
  881. begin
  882. new(procdefcoll);
  883. procdefcoll^.data:=hp;
  884. procdefcoll^.next:=symcoll^.data;
  885. symcoll^.data:=procdefcoll;
  886. { if it's a virtual method }
  887. if (hp^.options and povirtualmethod)<>0 then
  888. begin
  889. { then it gets a number ... }
  890. hp^.extnumber:=nextvirtnumber;
  891. { and we inc the number }
  892. inc(nextvirtnumber);
  893. has_virtual_method:=true;
  894. end;
  895. if (hp^.options and poconstructor)<>0 then
  896. has_constructor:=true;
  897. { check, if a method should be overridden }
  898. if (hp^.options and pooverridingmethod)<>0 then
  899. Message1(parser_e_nothing_to_be_overridden,_c^.name^+'.'+_name);
  900. { next overloaded method }
  901. hp:=hp^.nextoverloaded;
  902. end;
  903. end;
  904. begin
  905. { put only sub routines into the VMT }
  906. if sym^.typ=procsym then
  907. begin
  908. _name:=sym^.name;
  909. symcoll:=wurzel;
  910. while assigned(symcoll) do
  911. begin
  912. { does the symbol already exist in the list ? }
  913. if _name=symcoll^.name^ then
  914. begin
  915. { walk through all defs of the symbol }
  916. hp:=pprocsym(sym)^.definition;
  917. while assigned(hp) do
  918. begin
  919. { compare with all stored definitions }
  920. procdefcoll:=symcoll^.data;
  921. stored:=false;
  922. while assigned(procdefcoll) do
  923. begin
  924. { compare parameters }
  925. if equal_paras(procdefcoll^.data^.para1,hp^.para1,false) and
  926. (
  927. ((procdefcoll^.data^.options and povirtualmethod)<>0) or
  928. ((hp^.options and povirtualmethod)<>0)
  929. ) then
  930. begin
  931. { wenn sie gleich sind }
  932. { und eine davon virtual deklariert ist }
  933. { Fehler falls nur eine VIRTUAL }
  934. if (procdefcoll^.data^.options and povirtualmethod)<>
  935. (hp^.options and povirtualmethod) then
  936. begin
  937. { in classes, we hide the old method }
  938. if _c^.isclass then
  939. begin
  940. { warn only if it is the first time,
  941. we hide the method }
  942. if _c=hp^._class then
  943. Message1(parser_w_should_use_override,_c^.name^+'.'+_name);
  944. newentry;
  945. exit;
  946. end
  947. else
  948. if _c=hp^._class then
  949. begin
  950. if (procdefcoll^.data^.options and povirtualmethod)<>0 then
  951. Message1(parser_w_overloaded_are_not_both_virtual,_c^.name^+'.'+_name)
  952. else
  953. Message1(parser_w_overloaded_are_not_both_non_virtual,
  954. _c^.name^+'.'+_name);
  955. newentry;
  956. exit;
  957. end;
  958. end;
  959. { check, if the overridden directive is set }
  960. { (povirtualmethod is set! }
  961. { class ? }
  962. if _c^.isclass and
  963. ((hp^.options and pooverridingmethod)=0) then
  964. begin
  965. { warn only if it is the first time,
  966. we hide the method }
  967. if _c=hp^._class then
  968. Message1(parser_w_should_use_override,_c^.name^+'.'+_name);
  969. newentry;
  970. exit;
  971. end;
  972. { error, if the return types aren't equal }
  973. if not(is_equal(procdefcoll^.data^.retdef,hp^.retdef)) and
  974. not((procdefcoll^.data^.retdef^.deftype=objectdef) and
  975. (hp^.retdef^.deftype=objectdef) and
  976. (pobjectdef(procdefcoll^.data^.retdef)^.isclass) and
  977. (pobjectdef(hp^.retdef)^.isclass) and
  978. (pobjectdef(hp^.retdef)^.isrelated(pobjectdef(procdefcoll^.data^.retdef)))) then
  979. Message1(parser_e_overloaded_methodes_not_same_ret,_c^.name^+'.'+_name);
  980. { the flags have to match }
  981. { except abstract and override }
  982. if (procdefcoll^.data^.options and not(poabstractmethod or pooverridingmethod))<>
  983. (hp^.options and not(poabstractmethod or pooverridingmethod)) then
  984. Message1(parser_e_header_dont_match_forward,_c^.name^+'.'+_name);
  985. { now set the number }
  986. hp^.extnumber:=procdefcoll^.data^.extnumber;
  987. { and exchange }
  988. procdefcoll^.data:=hp;
  989. stored:=true;
  990. end;
  991. procdefcoll:=procdefcoll^.next;
  992. end;
  993. { if it isn't saved in the list }
  994. { we create a new entry }
  995. if not(stored) then
  996. begin
  997. new(procdefcoll);
  998. procdefcoll^.data:=hp;
  999. procdefcoll^.next:=symcoll^.data;
  1000. symcoll^.data:=procdefcoll;
  1001. { if the method is virtual ... }
  1002. if (hp^.options and povirtualmethod)<>0 then
  1003. begin
  1004. { ... it will get a number }
  1005. hp^.extnumber:=nextvirtnumber;
  1006. inc(nextvirtnumber);
  1007. end;
  1008. { check, if a method should be overridden }
  1009. if (hp^.options and pooverridingmethod)<>0 then
  1010. Message1(parser_e_nothing_to_be_overridden,_c^.name^+'.'+_name);
  1011. end;
  1012. hp:=hp^.nextoverloaded;
  1013. end;
  1014. exit;
  1015. end;
  1016. symcoll:=symcoll^.next;
  1017. end;
  1018. newentry;
  1019. end;
  1020. end;
  1021. procedure genvmt(_class : pobjectdef);
  1022. procedure do_genvmt(p : pobjectdef);
  1023. begin
  1024. { start with the base class }
  1025. if assigned(p^.childof) then
  1026. do_genvmt(p^.childof);
  1027. { walk through all public syms }
  1028. _c:=_class;
  1029. {$ifdef tp}
  1030. p^.publicsyms^.foreach(eachsym);
  1031. {$else}
  1032. p^.publicsyms^.foreach(@eachsym);
  1033. {$endif}
  1034. end;
  1035. var
  1036. symcoll : psymcoll;
  1037. procdefcoll : pprocdefcoll;
  1038. i : longint;
  1039. begin
  1040. wurzel:=nil;
  1041. nextvirtnumber:=0;
  1042. has_constructor:=false;
  1043. has_virtual_method:=false;
  1044. { generates a tree of all used methods }
  1045. do_genvmt(_class);
  1046. if has_virtual_method and not(has_constructor) then
  1047. Message1(parser_w_virtual_without_constructor,_class^.name^);
  1048. { generates the VMT }
  1049. { walk trough all numbers for virtual methods and search }
  1050. { the method }
  1051. for i:=0 to nextvirtnumber-1 do
  1052. begin
  1053. symcoll:=wurzel;
  1054. { walk trough all symbols }
  1055. while assigned(symcoll) do
  1056. begin
  1057. { walk trough all methods }
  1058. procdefcoll:=symcoll^.data;
  1059. while assigned(procdefcoll) do
  1060. begin
  1061. { writes the addresses to the VMT }
  1062. { but only this which are declared as virtual }
  1063. if procdefcoll^.data^.extnumber=i then
  1064. begin
  1065. if (procdefcoll^.data^.options and povirtualmethod)<>0 then
  1066. begin
  1067. { if a method is abstract, then is also the }
  1068. { class abstract and it's not allow to }
  1069. { generates an instance }
  1070. if (procdefcoll^.data^.options and poabstractmethod)<>0 then
  1071. begin
  1072. _class^.options:=_class^.options or oo_is_abstract;
  1073. datasegment^.concat(new(pai_const_symbol,
  1074. init('FPC_ABSTRACTERROR')));
  1075. end
  1076. else
  1077. begin
  1078. datasegment^.concat(new(pai_const_symbol,
  1079. init(procdefcoll^.data^.mangledname)));
  1080. maybe_concat_external(procdefcoll^.data^.owner,
  1081. procdefcoll^.data^.mangledname);
  1082. end;
  1083. end;
  1084. end;
  1085. procdefcoll:=procdefcoll^.next;
  1086. end;
  1087. symcoll:=symcoll^.next;
  1088. end;
  1089. end;
  1090. { disposes the above generated tree }
  1091. symcoll:=wurzel;
  1092. while assigned(symcoll) do
  1093. begin
  1094. wurzel:=symcoll^.next;
  1095. stringdispose(symcoll^.name);
  1096. procdefcoll:=symcoll^.data;
  1097. while assigned(procdefcoll) do
  1098. begin
  1099. symcoll^.data:=procdefcoll^.next;
  1100. dispose(procdefcoll);
  1101. procdefcoll:=symcoll^.data;
  1102. end;
  1103. dispose(symcoll);
  1104. symcoll:=wurzel;
  1105. end;
  1106. end;
  1107. end.
  1108. {
  1109. $Log$
  1110. Revision 1.53 1999-02-25 21:02:57 peter
  1111. * ag386bin updates
  1112. + coff writer
  1113. Revision 1.52 1999/02/24 09:51:44 florian
  1114. * wrong warning fixed, if a non-virtual method was hidden by a virtual
  1115. method (repoerted by Matthias Koeppe)
  1116. Revision 1.51 1999/02/22 23:33:31 florian
  1117. + message directive for integers added
  1118. Revision 1.50 1999/02/22 20:13:42 florian
  1119. + first implementation of message keyword
  1120. Revision 1.49 1999/02/16 00:45:30 peter
  1121. * fixed crashes by forgotten strpnew() for init_symbol
  1122. Revision 1.48 1999/02/09 23:03:08 florian
  1123. * check for duplicate field names in inherited classes/objects
  1124. * bug with self from the mailing list solved (the problem
  1125. was that classes were sometimes pushed wrong)
  1126. Revision 1.47 1999/01/27 00:14:01 florian
  1127. * "procedure of object"-stuff fixed
  1128. Revision 1.46 1999/01/21 22:10:54 peter
  1129. * fixed array of const
  1130. * generic platform independent high() support
  1131. Revision 1.45 1999/01/20 12:34:22 peter
  1132. * fixed typed file read/write
  1133. Revision 1.44 1999/01/15 11:33:03 pierre
  1134. * bug in mmx code removed
  1135. Revision 1.43 1998/12/30 13:41:20 peter
  1136. * released valuepara
  1137. Revision 1.42 1998/12/11 00:04:03 peter
  1138. + globtype,tokens,version unit splitted from globals
  1139. Revision 1.41 1998/12/10 09:47:33 florian
  1140. + basic operations with int64/qord (compiler with -dint64)
  1141. + rtti of enumerations extended: names are now written
  1142. Revision 1.40 1998/12/04 10:18:14 florian
  1143. * some stuff for procedures of object added
  1144. * bug with overridden virtual constructors fixed (reported by Italo Gomes)
  1145. Revision 1.39 1998/11/27 14:50:55 peter
  1146. + open strings, $P switch support
  1147. Revision 1.38 1998/11/18 15:44:24 peter
  1148. * VALUEPARA for tp7 compatible value parameters
  1149. Revision 1.37 1998/11/13 10:15:50 peter
  1150. * fixed ptr() with constants
  1151. Revision 1.36 1998/11/10 10:09:21 peter
  1152. * va_list -> array of const
  1153. Revision 1.35 1998/10/19 08:55:13 pierre
  1154. * wrong stabs info corrected once again !!
  1155. + variable vmt offset with vmt field only if required
  1156. implemented now !!!
  1157. Revision 1.34 1998/10/12 09:50:06 florian
  1158. + support of <procedure var type>:=<pointer> in delphi mode added
  1159. Revision 1.33 1998/10/06 20:43:30 peter
  1160. * fixed set of bugs. like set of false..true set of #1..#255 and
  1161. set of #1..true which was allowed
  1162. Revision 1.32 1998/10/05 21:33:35 peter
  1163. * fixed 161,165,166,167,168
  1164. Revision 1.31 1998/09/23 09:58:56 peter
  1165. * first working array of const things
  1166. Revision 1.30 1998/09/22 15:40:58 peter
  1167. * some extra ifdef GDB
  1168. Revision 1.29 1998/09/16 12:37:31 michael
  1169. Added FPC_ prefix to abstracterror
  1170. Revision 1.28 1998/09/09 16:44:23 florian
  1171. * I hope, the case bug is fixed now
  1172. Revision 1.27 1998/09/07 17:37:07 florian
  1173. * first fixes for published properties
  1174. Revision 1.26 1998/09/04 12:24:31 florian
  1175. * bug0159 fixed
  1176. Revision 1.25 1998/09/04 09:06:36 florian
  1177. * bug0132 fixed
  1178. Revision 1.24 1998/09/04 08:36:49 peter
  1179. * fixed boolean:=integer which is not explicit
  1180. Revision 1.23 1998/09/01 17:39:55 peter
  1181. + internal constant functions
  1182. Revision 1.22 1998/09/01 12:53:28 peter
  1183. + aktpackenum
  1184. Revision 1.21 1998/08/19 00:42:45 peter
  1185. + subrange types for enums
  1186. + checking for bounds type with ranges
  1187. Revision 1.20 1998/08/18 14:17:14 pierre
  1188. * bug about assigning the return value of a function to
  1189. a procvar fixed : warning
  1190. assigning a proc to a procvar need @ in FPC mode !!
  1191. * missing file/line info restored
  1192. Revision 1.19 1998/08/18 09:24:48 pierre
  1193. * small warning position bug fixed
  1194. * support_mmx switches splitting was missing
  1195. * rhide error and warning output corrected
  1196. Revision 1.18 1998/08/14 18:18:49 peter
  1197. + dynamic set contruction
  1198. * smallsets are now working (always longint size)
  1199. Revision 1.17 1998/08/05 16:00:17 florian
  1200. * some fixes for ansi strings
  1201. Revision 1.16 1998/07/20 23:35:50 michael
  1202. Const ansistrings are not copied.
  1203. Revision 1.15 1998/07/18 22:54:32 florian
  1204. * some ansi/wide/longstring support fixed:
  1205. o parameter passing
  1206. o returning as result from functions
  1207. Revision 1.14 1998/06/12 14:50:50 peter
  1208. * removed the tree dependency to types.pas
  1209. * long_fil.pas support (not fully tested yet)
  1210. Revision 1.13 1998/06/03 22:49:07 peter
  1211. + wordbool,longbool
  1212. * rename bis,von -> high,low
  1213. * moved some systemunit loading/creating to psystem.pas
  1214. Revision 1.12 1998/05/12 10:47:00 peter
  1215. * moved printstatus to verb_def
  1216. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1217. prefix like error: warning: and is included in V_Default
  1218. * fixed some messages
  1219. * first time parameter scan is only for -v and -T
  1220. - removed old style messages
  1221. Revision 1.11 1998/05/01 16:38:46 florian
  1222. * handling of private and protected fixed
  1223. + change_keywords_to_tp implemented to remove
  1224. keywords which aren't supported by tp
  1225. * break and continue are now symbols of the system unit
  1226. + widestring, longstring and ansistring type released
  1227. Revision 1.10 1998/04/29 10:34:08 pierre
  1228. + added some code for ansistring (not complete nor working yet)
  1229. * corrected operator overloading
  1230. * corrected nasm output
  1231. + started inline procedures
  1232. + added starstarn : use ** for exponentiation (^ gave problems)
  1233. + started UseTokenInfo cond to get accurate positions
  1234. Revision 1.9 1998/04/21 10:16:49 peter
  1235. * patches from strasbourg
  1236. * objects is not used anymore in the fpc compiled version
  1237. Revision 1.8 1998/04/12 22:39:44 florian
  1238. * problem with read access to properties solved
  1239. * correct handling of hidding methods via virtual (COM)
  1240. * correct result type of constructor calls (COM), the resulttype
  1241. depends now on the type of the class reference
  1242. Revision 1.7 1998/04/10 21:36:56 florian
  1243. + some stuff to support method pointers (procedure of object) added
  1244. (declaration, parameter handling)
  1245. Revision 1.6 1998/04/10 15:39:49 florian
  1246. * more fixes to get classes.pas compiled
  1247. Revision 1.5 1998/04/09 23:02:16 florian
  1248. * small problems solved to get remake3 work
  1249. Revision 1.4 1998/04/08 16:58:09 pierre
  1250. * several bugfixes
  1251. ADD ADC and AND are also sign extended
  1252. nasm output OK (program still crashes at end
  1253. and creates wrong assembler files !!)
  1254. procsym types sym in tdef removed !!
  1255. Revision 1.3 1998/04/08 11:34:22 peter
  1256. * nasm works (linux only tested)
  1257. }