types.pas 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338
  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,symtable;
  22. type
  23. tmmxtype = (mmxno,mmxu8bit,mmxs8bit,mmxu16bit,mmxs16bit,
  24. mmxu32bit,mmxs32bit,mmxfixed16,mmxsingle);
  25. const
  26. { true if we must never copy this parameter }
  27. never_copy_const_param : boolean = false;
  28. {*****************************************************************************
  29. Basic type functions
  30. *****************************************************************************}
  31. { returns true, if def defines an ordinal type }
  32. function is_ordinal(def : pdef) : boolean;
  33. { returns the min. value of the type }
  34. function get_min_value(def : pdef) : longint;
  35. { returns true, if def defines an ordinal type }
  36. function is_integer(def : pdef) : boolean;
  37. { true if p is a boolean }
  38. function is_boolean(def : pdef) : boolean;
  39. { true if p is a char }
  40. function is_char(def : pdef) : boolean;
  41. { true if p is a smallset def }
  42. function is_smallset(p : pdef) : boolean;
  43. { returns true, if def defines a signed data type (only for ordinal types) }
  44. function is_signed(def : pdef) : boolean;
  45. {*****************************************************************************
  46. Array helper functions
  47. *****************************************************************************}
  48. { true, if p points to a zero based (non special like open or
  49. dynamic array def, mainly this is used to see if the array
  50. is convertable to a pointer }
  51. function is_zero_based_array(p : pdef) : boolean;
  52. { true if p points to an open array def }
  53. function is_open_array(p : pdef) : boolean;
  54. { true, if p points to an array of const def }
  55. function is_array_constructor(p : pdef) : boolean;
  56. { true, if p points to a variant array }
  57. function is_variant_array(p : pdef) : boolean;
  58. { true, if p points to an array of const }
  59. function is_array_of_const(p : pdef) : boolean;
  60. { true, if p points any kind of special array }
  61. function is_special_array(p : pdef) : boolean;
  62. { true if p is a char array def }
  63. function is_chararray(p : pdef) : boolean;
  64. {*****************************************************************************
  65. String helper functions
  66. *****************************************************************************}
  67. { true if p points to an open string def }
  68. function is_open_string(p : pdef) : boolean;
  69. { true if p is an ansi string def }
  70. function is_ansistring(p : pdef) : boolean;
  71. { true if p is a long string def }
  72. function is_longstring(p : pdef) : boolean;
  73. { true if p is a wide string def }
  74. function is_widestring(p : pdef) : boolean;
  75. { true if p is a short string def }
  76. function is_shortstring(p : pdef) : boolean;
  77. { true if p is a pchar def }
  78. function is_pchar(p : pdef) : boolean;
  79. { returns true, if def uses FPU }
  80. function is_fpu(def : pdef) : boolean;
  81. { true if the return value is in EAX }
  82. function ret_in_acc(def : pdef) : boolean;
  83. { true if uses a parameter as return value }
  84. function ret_in_param(def : pdef) : boolean;
  85. { true, if def is a 64 bit int type }
  86. function is_64bitint(def : pdef) : boolean;
  87. function push_high_param(def : pdef) : boolean;
  88. { true if a parameter is too large to copy and only the address is pushed }
  89. function push_addr_param(def : pdef) : boolean;
  90. { true, if def1 and def2 are semantical the same }
  91. function is_equal(def1,def2 : pdef) : boolean;
  92. { checks for type compatibility (subgroups of type) }
  93. { used for case statements... probably missing stuff }
  94. { to use on other types }
  95. function is_subequal(def1, def2: pdef): boolean;
  96. { same as is_equal, but with error message if failed }
  97. function CheckTypes(def1,def2 : pdef) : boolean;
  98. { true, if two parameter lists are equal }
  99. { if value_equal_const is true, call by value }
  100. { and call by const parameter are assumed as }
  101. { equal }
  102. function equal_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
  103. { true if a type can be allowed for another one
  104. in a func var }
  105. function convertable_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
  106. { true if a function can be assigned to a procvar }
  107. function proc_to_procvar_equal(def1:pprocdef;def2:pprocvardef) : boolean;
  108. { if l isn't in the range of def a range check error is generated and
  109. the value is placed within the range }
  110. procedure testrange(def : pdef;var l : longint);
  111. { returns the range of def }
  112. procedure getrange(def : pdef;var l : longint;var h : longint);
  113. { some type helper routines for MMX support }
  114. function is_mmx_able_array(p : pdef) : boolean;
  115. { returns the mmx type }
  116. function mmx_type(p : pdef) : tmmxtype;
  117. { returns true, if sym needs an entry in the proplist of a class rtti }
  118. function needs_prop_entry(sym : psym) : boolean;
  119. implementation
  120. uses
  121. strings,globtype,globals,htypechk,
  122. tree,verbose,symconst;
  123. function needs_prop_entry(sym : psym) : boolean;
  124. begin
  125. needs_prop_entry:=(sp_published in psym(sym)^.symoptions) and
  126. (sym^.typ in [propertysym,varsym]);
  127. end;
  128. function equal_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
  129. begin
  130. while (assigned(def1)) and (assigned(def2)) do
  131. begin
  132. if value_equal_const then
  133. begin
  134. if not(is_equal(def1^.data,def2^.data)) or
  135. ((def1^.paratyp<>def2^.paratyp) and
  136. ((def1^.paratyp=vs_var) or
  137. (def1^.paratyp=vs_var)
  138. )
  139. ) then
  140. begin
  141. equal_paras:=false;
  142. exit;
  143. end;
  144. end
  145. else
  146. begin
  147. if not(is_equal(def1^.data,def2^.data)) or
  148. (def1^.paratyp<>def2^.paratyp) then
  149. begin
  150. equal_paras:=false;
  151. exit;
  152. end;
  153. end;
  154. def1:=def1^.next;
  155. def2:=def2^.next;
  156. end;
  157. if (def1=nil) and (def2=nil) then
  158. equal_paras:=true
  159. else
  160. equal_paras:=false;
  161. end;
  162. function convertable_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
  163. var doconv : tconverttype;
  164. begin
  165. while (assigned(def1)) and (assigned(def2)) do
  166. begin
  167. if value_equal_const then
  168. begin
  169. if (isconvertable(def1^.data,def2^.data,doconv,callparan,false)=0) or
  170. ((def1^.paratyp<>def2^.paratyp) and
  171. ((def1^.paratyp=vs_var) or
  172. (def1^.paratyp=vs_var)
  173. )
  174. ) then
  175. begin
  176. convertable_paras:=false;
  177. exit;
  178. end;
  179. end
  180. else
  181. begin
  182. if (isconvertable(def1^.data,def2^.data,doconv,callparan,false)=0) or
  183. (def1^.paratyp<>def2^.paratyp) then
  184. begin
  185. convertable_paras:=false;
  186. exit;
  187. end;
  188. end;
  189. def1:=def1^.next;
  190. def2:=def2^.next;
  191. end;
  192. if (def1=nil) and (def2=nil) then
  193. convertable_paras:=true
  194. else
  195. convertable_paras:=false;
  196. end;
  197. { true if a function can be assigned to a procvar }
  198. function proc_to_procvar_equal(def1:pprocdef;def2:pprocvardef) : boolean;
  199. const
  200. po_comp = po_compatibility_options-[po_methodpointer];
  201. var
  202. ismethod : boolean;
  203. begin
  204. proc_to_procvar_equal:=false;
  205. if not(assigned(def1)) or not(assigned(def2)) then
  206. exit;
  207. { check for method pointer }
  208. ismethod:=assigned(def1^.owner) and
  209. (def1^.owner^.symtabletype=objectsymtable);
  210. { I think methods of objects are also not compatible }
  211. { with procedure variables! (FK)
  212. and
  213. assigned(def1^.owner^.defowner) and
  214. (pobjectdef(def1^.owner^.defowner)^.is_class); }
  215. if (ismethod and not (po_methodpointer in def2^.procoptions)) or
  216. (not(ismethod) and (po_methodpointer in def2^.procoptions)) then
  217. begin
  218. Message(type_e_no_method_and_procedure_not_compatible);
  219. exit;
  220. end;
  221. { check return value and para's and options, methodpointer is already checked
  222. parameters may also be convertable }
  223. if is_equal(def1^.retdef,def2^.retdef) and
  224. (equal_paras(def1^.para1,def2^.para1,false) or
  225. convertable_paras(def1^.para1,def2^.para1,false)) and
  226. ((po_comp * def1^.procoptions)= (po_comp * def2^.procoptions)) then
  227. proc_to_procvar_equal:=true
  228. else
  229. proc_to_procvar_equal:=false;
  230. end;
  231. { returns true, if def uses FPU }
  232. function is_fpu(def : pdef) : boolean;
  233. begin
  234. is_fpu:=(def^.deftype=floatdef) and (pfloatdef(def)^.typ<>f32bit);
  235. end;
  236. { true if p is an ordinal }
  237. function is_ordinal(def : pdef) : boolean;
  238. var
  239. dt : tbasetype;
  240. begin
  241. case def^.deftype of
  242. orddef :
  243. begin
  244. dt:=porddef(def)^.typ;
  245. is_ordinal:=dt in [uchar,
  246. u8bit,u16bit,u32bit,u64bit,
  247. s8bit,s16bit,s32bit,s64bit,
  248. bool8bit,bool16bit,bool32bit];
  249. end;
  250. enumdef :
  251. is_ordinal:=true;
  252. else
  253. is_ordinal:=false;
  254. end;
  255. end;
  256. { returns the min. value of the type }
  257. function get_min_value(def : pdef) : longint;
  258. begin
  259. case def^.deftype of
  260. orddef:
  261. get_min_value:=porddef(def)^.low;
  262. enumdef:
  263. get_min_value:=penumdef(def)^.min;
  264. else
  265. get_min_value:=0;
  266. end;
  267. end;
  268. { true if p is an integer }
  269. function is_integer(def : pdef) : boolean;
  270. begin
  271. is_integer:=(def^.deftype=orddef) and
  272. (porddef(def)^.typ in [uauto,u8bit,u16bit,u32bit,u64bit,
  273. s8bit,s16bit,s32bit,s64bit]);
  274. end;
  275. { true if p is a boolean }
  276. function is_boolean(def : pdef) : boolean;
  277. begin
  278. is_boolean:=(def^.deftype=orddef) and
  279. (porddef(def)^.typ in [bool8bit,bool16bit,bool32bit]);
  280. end;
  281. { true if p is a char }
  282. function is_char(def : pdef) : boolean;
  283. begin
  284. is_char:=(def^.deftype=orddef) and
  285. (porddef(def)^.typ=uchar);
  286. end;
  287. { true if p is signed (integer) }
  288. function is_signed(def : pdef) : boolean;
  289. var
  290. dt : tbasetype;
  291. begin
  292. case def^.deftype of
  293. orddef :
  294. begin
  295. dt:=porddef(def)^.typ;
  296. is_signed:=(dt in [s8bit,s16bit,s32bit,s64bit]);
  297. end;
  298. enumdef :
  299. is_signed:=false;
  300. else
  301. is_signed:=false;
  302. end;
  303. end;
  304. { true, if p points to an open array def }
  305. function is_open_string(p : pdef) : boolean;
  306. begin
  307. is_open_string:=(p^.deftype=stringdef) and
  308. (pstringdef(p)^.string_typ=st_shortstring) and
  309. (pstringdef(p)^.len=0);
  310. end;
  311. { true, if p points to a zero based array def }
  312. function is_zero_based_array(p : pdef) : boolean;
  313. begin
  314. is_zero_based_array:=(p^.deftype=arraydef) and
  315. (parraydef(p)^.lowrange=0) and
  316. not(is_special_array(p));
  317. end;
  318. { true, if p points to an open array def }
  319. function is_open_array(p : pdef) : boolean;
  320. begin
  321. { check for s32bitdef is needed, because for u32bit the high
  322. range is also -1 ! (PFV) }
  323. is_open_array:=(p^.deftype=arraydef) and
  324. (parraydef(p)^.rangedef=pdef(s32bitdef)) and
  325. (parraydef(p)^.lowrange=0) and
  326. (parraydef(p)^.highrange=-1) and
  327. not(parraydef(p)^.IsConstructor) and
  328. not(parraydef(p)^.IsVariant) and
  329. not(parraydef(p)^.IsArrayOfConst);
  330. end;
  331. { true, if p points to an array of const def }
  332. function is_array_constructor(p : pdef) : boolean;
  333. begin
  334. is_array_constructor:=(p^.deftype=arraydef) and
  335. (parraydef(p)^.IsConstructor);
  336. end;
  337. { true, if p points to a variant array }
  338. function is_variant_array(p : pdef) : boolean;
  339. begin
  340. is_variant_array:=(p^.deftype=arraydef) and
  341. (parraydef(p)^.IsVariant);
  342. end;
  343. { true, if p points to an array of const }
  344. function is_array_of_const(p : pdef) : boolean;
  345. begin
  346. is_array_of_const:=(p^.deftype=arraydef) and
  347. (parraydef(p)^.IsArrayOfConst);
  348. end;
  349. { true, if p points to a special array }
  350. function is_special_array(p : pdef) : boolean;
  351. begin
  352. is_special_array:=(p^.deftype=arraydef) and
  353. ((parraydef(p)^.IsVariant) or
  354. (parraydef(p)^.IsArrayOfConst) or
  355. (parraydef(p)^.IsConstructor) or
  356. is_open_array(p)
  357. );
  358. end;
  359. { true if p is an ansi string def }
  360. function is_ansistring(p : pdef) : boolean;
  361. begin
  362. is_ansistring:=(p^.deftype=stringdef) and
  363. (pstringdef(p)^.string_typ=st_ansistring);
  364. end;
  365. { true if p is an long string def }
  366. function is_longstring(p : pdef) : boolean;
  367. begin
  368. is_longstring:=(p^.deftype=stringdef) and
  369. (pstringdef(p)^.string_typ=st_longstring);
  370. end;
  371. { true if p is an wide string def }
  372. function is_widestring(p : pdef) : boolean;
  373. begin
  374. is_widestring:=(p^.deftype=stringdef) and
  375. (pstringdef(p)^.string_typ=st_widestring);
  376. end;
  377. { true if p is an short string def }
  378. function is_shortstring(p : pdef) : boolean;
  379. begin
  380. is_shortstring:=(p^.deftype=stringdef) and
  381. (pstringdef(p)^.string_typ=st_shortstring);
  382. end;
  383. { true if p is a char array def }
  384. function is_chararray(p : pdef) : boolean;
  385. begin
  386. is_chararray:=(p^.deftype=arraydef) and
  387. is_equal(parraydef(p)^.definition,cchardef) and
  388. not(is_special_array(p));
  389. end;
  390. { true if p is a pchar def }
  391. function is_pchar(p : pdef) : boolean;
  392. begin
  393. is_pchar:=(p^.deftype=pointerdef) and
  394. is_equal(Ppointerdef(p)^.definition,cchardef);
  395. end;
  396. { true if p is a smallset def }
  397. function is_smallset(p : pdef) : boolean;
  398. begin
  399. is_smallset:=(p^.deftype=setdef) and
  400. (psetdef(p)^.settype=smallset);
  401. end;
  402. { true if the return value is in accumulator (EAX for i386), D0 for 68k }
  403. function ret_in_acc(def : pdef) : boolean;
  404. begin
  405. ret_in_acc:=(def^.deftype in [orddef,pointerdef,enumdef,classrefdef]) or
  406. ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_ansistring,st_widestring])) or
  407. ((def^.deftype=procvardef) and not(po_methodpointer in pprocvardef(def)^.procoptions)) or
  408. ((def^.deftype=objectdef) and pobjectdef(def)^.is_class) or
  409. ((def^.deftype=setdef) and (psetdef(def)^.settype=smallset)) or
  410. ((def^.deftype=floatdef) and (pfloatdef(def)^.typ=f32bit));
  411. end;
  412. { true, if def is a 64 bit int type }
  413. function is_64bitint(def : pdef) : boolean;
  414. begin
  415. is_64bitint:=(def^.deftype=orddef) and (porddef(def)^.typ in [u64bit,s64bit])
  416. end;
  417. { true if uses a parameter as return value }
  418. function ret_in_param(def : pdef) : boolean;
  419. begin
  420. ret_in_param:=(def^.deftype in [arraydef,recorddef]) or
  421. ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_shortstring,st_longstring])) or
  422. ((def^.deftype=procvardef) and (po_methodpointer in pprocvardef(def)^.procoptions)) or
  423. ((def^.deftype=objectdef) and not(pobjectdef(def)^.is_class)) or
  424. ((def^.deftype=setdef) and (psetdef(def)^.settype<>smallset));
  425. end;
  426. function push_high_param(def : pdef) : boolean;
  427. begin
  428. push_high_param:=is_open_array(def) or
  429. is_open_string(def) or
  430. is_array_of_const(def);
  431. end;
  432. { true if a parameter is too large to copy and only the address is pushed }
  433. function push_addr_param(def : pdef) : boolean;
  434. begin
  435. push_addr_param:=false;
  436. if never_copy_const_param then
  437. push_addr_param:=true
  438. else
  439. begin
  440. case def^.deftype of
  441. formaldef :
  442. push_addr_param:=true;
  443. recorddef :
  444. push_addr_param:=(def^.size>4);
  445. arraydef :
  446. push_addr_param:=((Parraydef(def)^.highrange>Parraydef(def)^.lowrange) and (def^.size>4)) or
  447. is_open_array(def) or
  448. is_array_of_const(def) or
  449. is_array_constructor(def);
  450. objectdef :
  451. push_addr_param:=not(pobjectdef(def)^.is_class);
  452. stringdef :
  453. push_addr_param:=pstringdef(def)^.string_typ in [st_shortstring,st_longstring];
  454. procvardef :
  455. push_addr_param:=(po_methodpointer in pprocvardef(def)^.procoptions);
  456. setdef :
  457. push_addr_param:=(psetdef(def)^.settype<>smallset);
  458. end;
  459. end;
  460. end;
  461. { test if l is in the range of def, outputs error if out of range }
  462. procedure testrange(def : pdef;var l : longint);
  463. var
  464. lv,hv: longint;
  465. begin
  466. { for 64 bit types we need only to check if it is less than }
  467. { zero, if def is a qword node }
  468. if is_64bitint(def) then
  469. begin
  470. if (l<0) and (porddef(def)^.typ=u64bit) then
  471. begin
  472. l:=0;
  473. if (cs_check_range in aktlocalswitches) then
  474. Message(parser_e_range_check_error)
  475. else
  476. Message(parser_w_range_check_error);
  477. end;
  478. end
  479. else
  480. begin
  481. getrange(def,lv,hv);
  482. if (def^.deftype=orddef) and
  483. (porddef(def)^.typ=u32bit) then
  484. begin
  485. if lv<=hv then
  486. begin
  487. if (l<lv) or (l>hv) then
  488. begin
  489. if (cs_check_range in aktlocalswitches) then
  490. Message(parser_e_range_check_error)
  491. else
  492. Message(parser_w_range_check_error);
  493. end;
  494. end
  495. else
  496. { this happens with the wrap around problem }
  497. { if lv is positive and hv is over $7ffffff }
  498. { so it seems negative }
  499. begin
  500. if ((l>=0) and (l<lv)) or
  501. ((l<0) and (l>hv)) then
  502. begin
  503. if (cs_check_range in aktlocalswitches) then
  504. Message(parser_e_range_check_error)
  505. else
  506. Message(parser_w_range_check_error);
  507. end;
  508. end;
  509. end
  510. else if (l<lv) or (l>hv) then
  511. begin
  512. if (def^.deftype=enumdef) or
  513. (cs_check_range in aktlocalswitches) then
  514. Message(parser_e_range_check_error)
  515. else
  516. Message(parser_w_range_check_error);
  517. { Fix the value to be in range }
  518. l:=lv+(l mod (hv-lv+1));
  519. end;
  520. end;
  521. end;
  522. { return the range from def in l and h }
  523. procedure getrange(def : pdef;var l : longint;var h : longint);
  524. begin
  525. case def^.deftype of
  526. orddef :
  527. begin
  528. l:=porddef(def)^.low;
  529. h:=porddef(def)^.high;
  530. end;
  531. enumdef :
  532. begin
  533. l:=penumdef(def)^.min;
  534. h:=penumdef(def)^.max;
  535. end;
  536. arraydef :
  537. begin
  538. l:=parraydef(def)^.lowrange;
  539. h:=parraydef(def)^.highrange;
  540. end;
  541. else
  542. internalerror(987);
  543. end;
  544. end;
  545. function mmx_type(p : pdef) : tmmxtype;
  546. begin
  547. mmx_type:=mmxno;
  548. if is_mmx_able_array(p) then
  549. begin
  550. if parraydef(p)^.definition^.deftype=floatdef then
  551. case pfloatdef(parraydef(p)^.definition)^.typ of
  552. s32real:
  553. mmx_type:=mmxsingle;
  554. f16bit:
  555. mmx_type:=mmxfixed16
  556. end
  557. else
  558. case porddef(parraydef(p)^.definition)^.typ of
  559. u8bit:
  560. mmx_type:=mmxu8bit;
  561. s8bit:
  562. mmx_type:=mmxs8bit;
  563. u16bit:
  564. mmx_type:=mmxu16bit;
  565. s16bit:
  566. mmx_type:=mmxs16bit;
  567. u32bit:
  568. mmx_type:=mmxu32bit;
  569. s32bit:
  570. mmx_type:=mmxs32bit;
  571. end;
  572. end;
  573. end;
  574. function is_mmx_able_array(p : pdef) : boolean;
  575. begin
  576. {$ifdef SUPPORT_MMX}
  577. if (cs_mmx_saturation in aktlocalswitches) then
  578. begin
  579. is_mmx_able_array:=(p^.deftype=arraydef) and
  580. not(is_special_array(p)) and
  581. (
  582. (
  583. (parraydef(p)^.definition^.deftype=orddef) and
  584. (
  585. (
  586. (parraydef(p)^.lowrange=0) and
  587. (parraydef(p)^.highrange=1) and
  588. (porddef(parraydef(p)^.definition)^.typ in [u32bit,s32bit])
  589. )
  590. or
  591. (
  592. (parraydef(p)^.lowrange=0) and
  593. (parraydef(p)^.highrange=3) and
  594. (porddef(parraydef(p)^.definition)^.typ in [u16bit,s16bit])
  595. )
  596. )
  597. )
  598. or
  599. (
  600. (
  601. (parraydef(p)^.definition^.deftype=floatdef) and
  602. (
  603. (parraydef(p)^.lowrange=0) and
  604. (parraydef(p)^.highrange=3) and
  605. (pfloatdef(parraydef(p)^.definition)^.typ=f16bit)
  606. ) or
  607. (
  608. (parraydef(p)^.lowrange=0) and
  609. (parraydef(p)^.highrange=1) and
  610. (pfloatdef(parraydef(p)^.definition)^.typ=s32real)
  611. )
  612. )
  613. )
  614. );
  615. end
  616. else
  617. begin
  618. is_mmx_able_array:=(p^.deftype=arraydef) and
  619. (
  620. (
  621. (parraydef(p)^.definition^.deftype=orddef) and
  622. (
  623. (
  624. (parraydef(p)^.lowrange=0) and
  625. (parraydef(p)^.highrange=1) and
  626. (porddef(parraydef(p)^.definition)^.typ in [u32bit,s32bit])
  627. )
  628. or
  629. (
  630. (parraydef(p)^.lowrange=0) and
  631. (parraydef(p)^.highrange=3) and
  632. (porddef(parraydef(p)^.definition)^.typ in [u16bit,s16bit])
  633. )
  634. or
  635. (
  636. (parraydef(p)^.lowrange=0) and
  637. (parraydef(p)^.highrange=7) and
  638. (porddef(parraydef(p)^.definition)^.typ in [u8bit,s8bit])
  639. )
  640. )
  641. )
  642. or
  643. (
  644. (parraydef(p)^.definition^.deftype=floatdef) and
  645. (
  646. (
  647. (parraydef(p)^.lowrange=0) and
  648. (parraydef(p)^.highrange=3) and
  649. (pfloatdef(parraydef(p)^.definition)^.typ=f32bit)
  650. )
  651. or
  652. (
  653. (parraydef(p)^.lowrange=0) and
  654. (parraydef(p)^.highrange=1) and
  655. (pfloatdef(parraydef(p)^.definition)^.typ=s32real)
  656. )
  657. )
  658. )
  659. );
  660. end;
  661. {$else SUPPORT_MMX}
  662. is_mmx_able_array:=false;
  663. {$endif SUPPORT_MMX}
  664. end;
  665. function is_equal(def1,def2 : pdef) : boolean;
  666. var
  667. b : boolean;
  668. hd : pdef;
  669. hp1,hp2 : pdefcoll;
  670. begin
  671. { both types must exists }
  672. if not (assigned(def1) and assigned(def2)) then
  673. begin
  674. is_equal:=false;
  675. exit;
  676. end;
  677. { be sure, that if there is a stringdef, that this is def1 }
  678. if def2^.deftype=stringdef then
  679. begin
  680. hd:=def1;
  681. def1:=def2;
  682. def2:=hd;
  683. end;
  684. b:=false;
  685. { both point to the same definition ? }
  686. if def1=def2 then
  687. b:=true
  688. else
  689. { pointer with an equal definition are equal }
  690. if (def1^.deftype=pointerdef) and (def2^.deftype=pointerdef) then
  691. begin
  692. { here a problem detected in tabsolutesym }
  693. { the types can be forward type !! }
  694. if assigned(def1^.sym) and (ppointerdef(def1)^.definition^.deftype=forwarddef) then
  695. b:=(def1^.sym=def2^.sym)
  696. else
  697. b:=ppointerdef(def1)^.definition=ppointerdef(def2)^.definition;
  698. end
  699. else
  700. { ordinals are equal only when the ordinal type is equal }
  701. if (def1^.deftype=orddef) and (def2^.deftype=orddef) then
  702. begin
  703. case porddef(def1)^.typ of
  704. u8bit,u16bit,u32bit,
  705. s8bit,s16bit,s32bit:
  706. b:=((porddef(def1)^.typ=porddef(def2)^.typ) and
  707. (porddef(def1)^.low=porddef(def2)^.low) and
  708. (porddef(def1)^.high=porddef(def2)^.high));
  709. uvoid,uchar,
  710. bool8bit,bool16bit,bool32bit:
  711. b:=(porddef(def1)^.typ=porddef(def2)^.typ);
  712. end;
  713. end
  714. else
  715. if (def1^.deftype=floatdef) and (def2^.deftype=floatdef) then
  716. b:=pfloatdef(def1)^.typ=pfloatdef(def2)^.typ
  717. else
  718. { strings with the same length are equal }
  719. if (def1^.deftype=stringdef) and (def2^.deftype=stringdef) and
  720. (pstringdef(def1)^.string_typ=pstringdef(def2)^.string_typ) then
  721. begin
  722. b:=not(is_shortstring(def1)) or
  723. (pstringdef(def1)^.len=pstringdef(def2)^.len);
  724. end
  725. else
  726. if (def1^.deftype=formaldef) and (def2^.deftype=formaldef) then
  727. b:=true
  728. { file types with the same file element type are equal }
  729. { this is a problem for assign !! }
  730. { changed to allow if one is untyped }
  731. { all typed files are equal to the special }
  732. { typed file that has voiddef as elemnt type }
  733. { but must NOT match for text file !!! }
  734. else
  735. if (def1^.deftype=filedef) and (def2^.deftype=filedef) then
  736. b:=(pfiledef(def1)^.filetype=pfiledef(def2)^.filetype) and
  737. ((
  738. ((pfiledef(def1)^.typed_as=nil) and
  739. (pfiledef(def2)^.typed_as=nil)) or
  740. (
  741. (pfiledef(def1)^.typed_as<>nil) and
  742. (pfiledef(def2)^.typed_as<>nil) and
  743. is_equal(pfiledef(def1)^.typed_as,pfiledef(def2)^.typed_as)
  744. ) or
  745. ( (pfiledef(def1)^.typed_as=pdef(voiddef)) or
  746. (pfiledef(def2)^.typed_as=pdef(voiddef))
  747. )))
  748. { sets with the same element type are equal }
  749. else
  750. if (def1^.deftype=setdef) and (def2^.deftype=setdef) then
  751. begin
  752. if assigned(psetdef(def1)^.setof) and
  753. assigned(psetdef(def2)^.setof) then
  754. b:=(psetdef(def1)^.setof^.deftype=psetdef(def2)^.setof^.deftype)
  755. else
  756. b:=true;
  757. end
  758. else
  759. if (def1^.deftype=procvardef) and (def2^.deftype=procvardef) then
  760. begin
  761. { poassembler isn't important for compatibility }
  762. { if a method is assigned to a methodpointer }
  763. { is checked before }
  764. b:=((pprocvardef(def1)^.procoptions * po_compatibility_options)=
  765. (pprocvardef(def2)^.procoptions * po_compatibility_options)) and
  766. is_equal(pprocvardef(def1)^.retdef,pprocvardef(def2)^.retdef);
  767. { now evalute the parameters }
  768. if b then
  769. begin
  770. hp1:=pprocvardef(def1)^.para1;
  771. hp2:=pprocvardef(def1)^.para1;
  772. while assigned(hp1) and assigned(hp2) do
  773. begin
  774. if not(is_equal(hp1^.data,hp2^.data)) or
  775. not(hp1^.paratyp=hp2^.paratyp) then
  776. begin
  777. b:=false;
  778. break;
  779. end;
  780. hp1:=hp1^.next;
  781. hp2:=hp2^.next;
  782. end;
  783. b:=(hp1=nil) and (hp2=nil);
  784. end;
  785. end
  786. else
  787. if (def1^.deftype=arraydef) and (def2^.deftype=arraydef) then
  788. begin
  789. if is_open_array(def1) or is_open_array(def2) or
  790. is_array_of_const(def1) or is_array_of_const(def2) then
  791. begin
  792. if parraydef(def1)^.IsArrayOfConst or parraydef(def2)^.IsArrayOfConst then
  793. b:=true
  794. else
  795. b:=is_equal(parraydef(def1)^.definition,parraydef(def2)^.definition);
  796. end
  797. else
  798. begin
  799. b:=not(m_tp in aktmodeswitches) and
  800. not(m_delphi in aktmodeswitches) and
  801. (parraydef(def1)^.lowrange=parraydef(def2)^.lowrange) and
  802. (parraydef(def1)^.highrange=parraydef(def2)^.highrange) and
  803. is_equal(parraydef(def1)^.definition,parraydef(def2)^.definition) and
  804. is_equal(parraydef(def1)^.rangedef,parraydef(def2)^.rangedef);
  805. end;
  806. end
  807. else
  808. if (def1^.deftype=classrefdef) and (def2^.deftype=classrefdef) then
  809. begin
  810. { similar to pointerdef: }
  811. if assigned(def1^.sym) and (pclassrefdef(def1)^.definition^.deftype=forwarddef) then
  812. b:=(def1^.sym=def2^.sym)
  813. else
  814. b:=is_equal(pclassrefdef(def1)^.definition,pclassrefdef(def2)^.definition);
  815. end;
  816. is_equal:=b;
  817. end;
  818. function is_subequal(def1, def2: pdef): boolean;
  819. Begin
  820. if assigned(def1) and assigned(def2) then
  821. Begin
  822. is_subequal := FALSE;
  823. if (def1^.deftype = orddef) and (def2^.deftype = orddef) then
  824. Begin
  825. { see p.47 of Turbo Pascal 7.01 manual for the separation of types }
  826. { range checking for case statements is done with testrange }
  827. case porddef(def1)^.typ of
  828. u8bit,u16bit,u32bit,
  829. s8bit,s16bit,s32bit :
  830. is_subequal:=(porddef(def2)^.typ in [s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]);
  831. bool8bit,bool16bit,bool32bit :
  832. is_subequal:=(porddef(def2)^.typ in [bool8bit,bool16bit,bool32bit]);
  833. uchar :
  834. is_subequal:=(porddef(def2)^.typ=uchar);
  835. end;
  836. end
  837. else
  838. Begin
  839. { I assume that both enumerations are equal when the first }
  840. { pointers are equal. }
  841. if (def1^.deftype = enumdef) and (def2^.deftype =enumdef) then
  842. Begin
  843. if penumdef(def1)^.firstenum = penumdef(def2)^.firstenum then
  844. is_subequal := TRUE;
  845. end;
  846. end;
  847. end; { endif assigned ... }
  848. end;
  849. function CheckTypes(def1,def2 : pdef) : boolean;
  850. var
  851. s1,s2 : string;
  852. begin
  853. if not is_equal(def1,def2) then
  854. begin
  855. { Crash prevention }
  856. if (not assigned(def1)) or (not assigned(def2)) then
  857. Message(type_e_mismatch)
  858. else
  859. begin
  860. s1:=def1^.typename;
  861. s2:=def2^.typename;
  862. if (s1<>'<unknown type>') and (s2<>'<unknown type>') then
  863. Message2(type_e_not_equal_types,def1^.typename,def2^.typename)
  864. else
  865. Message(type_e_mismatch);
  866. end;
  867. CheckTypes:=false;
  868. end
  869. else
  870. CheckTypes:=true;
  871. end;
  872. end.
  873. {
  874. $Log$
  875. Revision 1.88 1999-10-01 08:02:51 peter
  876. * forward type declaration rewritten
  877. Revision 1.87 1999/09/15 22:09:27 florian
  878. + rtti is now automatically generated for published classes, i.e.
  879. they are handled like an implicit property
  880. Revision 1.86 1999/09/11 09:08:35 florian
  881. * fixed bug 596
  882. * fixed some problems with procedure variables and procedures of object,
  883. especially in TP mode. Procedure of object doesn't apply only to classes,
  884. it is also allowed for objects !!
  885. Revision 1.85 1999/08/13 21:27:08 peter
  886. * more fixes for push_addr
  887. Revision 1.84 1999/08/13 15:38:23 peter
  888. * fixed push_addr_param for records < 4, the array high<low range check
  889. broke this code.
  890. Revision 1.83 1999/08/07 14:21:06 florian
  891. * some small problems fixed
  892. Revision 1.82 1999/08/07 13:36:56 daniel
  893. * Recommitted the arraydef overflow bugfix.
  894. Revision 1.80 1999/08/05 22:42:49 daniel
  895. * Fixed potential bug for open arrays (Their size is not known at
  896. compilation time).
  897. Revision 1.79 1999/08/03 22:03:41 peter
  898. * moved bitmask constants to sets
  899. * some other type/const renamings
  900. Revision 1.78 1999/07/30 12:26:42 peter
  901. * array is_equal disabled for tp,delphi mode
  902. Revision 1.77 1999/07/29 11:41:51 peter
  903. * array is_equal extended
  904. Revision 1.76 1999/07/27 23:39:15 peter
  905. * open array checks also for s32bitdef, because u32bit also has a
  906. high range of -1
  907. Revision 1.75 1999/07/06 21:48:29 florian
  908. * a lot bug fixes:
  909. - po_external isn't any longer necessary for procedure compatibility
  910. - m_tp_procvar is in -Sd now available
  911. - error messages of procedure variables improved
  912. - return values with init./finalization fixed
  913. - data types with init./finalization aren't any longer allowed in variant
  914. record
  915. Revision 1.74 1999/07/01 15:49:24 florian
  916. * int64/qword type release
  917. + lo/hi for int64/qword
  918. Revision 1.73 1999/06/28 22:29:22 florian
  919. * qword division fixed
  920. + code for qword/int64 type casting added:
  921. range checking isn't implemented yet
  922. Revision 1.72 1999/06/13 22:41:08 peter
  923. * merged from fixes
  924. Revision 1.71.2.1 1999/06/13 22:37:17 peter
  925. * convertable para's doesn't check for equal, added equal para's to
  926. proc2procvar check
  927. Revision 1.71 1999/06/03 09:34:13 peter
  928. * better methodpointer check for proc->procvar
  929. Revision 1.70 1999/06/02 22:25:55 pierre
  930. types.pas
  931. Revision 1.69 1999/06/02 10:11:55 florian
  932. * make cycle fixed i.e. compilation with 0.99.10
  933. * some fixes for qword
  934. * start of register calling conventions
  935. Revision 1.68 1999/06/01 19:27:58 peter
  936. * better checks for procvar and methodpointer
  937. Revision 1.67 1999/05/31 22:54:19 peter
  938. * when range check error is found then fix the value to be within the
  939. range
  940. Revision 1.66 1999/05/28 11:00:51 peter
  941. * removed ungettempoftype
  942. Revision 1.65 1999/05/23 18:42:23 florian
  943. * better error recovering in typed constants
  944. * some problems with arrays of const fixed, some problems
  945. due my previous
  946. - the location type of array constructor is now LOC_MEM
  947. - the pushing of high fixed
  948. - parameter copying fixed
  949. - zero temp. allocation removed
  950. * small problem in the assembler writers fixed:
  951. ref to nil wasn't written correctly
  952. Revision 1.64 1999/05/19 20:55:08 florian
  953. * fix of my previous commit
  954. Revision 1.63 1999/05/19 20:40:15 florian
  955. * fixed a couple of array related bugs:
  956. - var a : array[0..1] of char; p : pchar; p:=a+123; works now
  957. - open arrays with an odd size doesn't work: movsb wasn't generated
  958. - introduced some new array type helper routines (is_special_array) etc.
  959. - made the array type checking in isconvertable more strict, often
  960. open array can be used where is wasn't allowed etc...
  961. Revision 1.62 1999/05/19 16:48:29 florian
  962. * tdef.typename: returns a now a proper type name for the most types
  963. Revision 1.61 1999/05/19 10:31:56 florian
  964. * two bugs reported by Romio (bugs 13) are fixed:
  965. - empty array constructors are now handled correctly (e.g. for sysutils.format)
  966. - comparsion of ansistrings was sometimes coded wrong
  967. Revision 1.60 1999/05/18 14:16:01 peter
  968. * containsself fixes
  969. * checktypes()
  970. Revision 1.59 1999/05/18 09:52:24 peter
  971. * procedure of object and addrn fixes
  972. Revision 1.58 1999/04/19 09:29:51 pierre
  973. + ungettempoftype(pdef) boolean function
  974. returns true (can call ungetiftemp )
  975. unless the temp should be "unget" with temptoremove
  976. (currently ansistring or widestring !)
  977. Revision 1.57 1999/04/14 09:15:08 peter
  978. * first things to store the symbol/def number in the ppu
  979. Revision 1.56 1999/03/24 23:17:42 peter
  980. * fixed bugs 212,222,225,227,229,231,233
  981. Revision 1.55 1999/03/09 11:45:42 pierre
  982. * small arrays and records (size <=4) are copied directly
  983. Revision 1.54 1999/03/02 22:52:20 peter
  984. * fixed char array, which can start with all possible values
  985. Revision 1.53 1999/02/25 21:02:57 peter
  986. * ag386bin updates
  987. + coff writer
  988. Revision 1.52 1999/02/24 09:51:44 florian
  989. * wrong warning fixed, if a non-virtual method was hidden by a virtual
  990. method (repoerted by Matthias Koeppe)
  991. Revision 1.51 1999/02/22 23:33:31 florian
  992. + message directive for integers added
  993. Revision 1.50 1999/02/22 20:13:42 florian
  994. + first implementation of message keyword
  995. Revision 1.49 1999/02/16 00:45:30 peter
  996. * fixed crashes by forgotten strpnew() for init_symbol
  997. Revision 1.48 1999/02/09 23:03:08 florian
  998. * check for duplicate field names in inherited classes/objects
  999. * bug with self from the mailing list solved (the problem
  1000. was that classes were sometimes pushed wrong)
  1001. Revision 1.47 1999/01/27 00:14:01 florian
  1002. * "procedure of object"-stuff fixed
  1003. Revision 1.46 1999/01/21 22:10:54 peter
  1004. * fixed array of const
  1005. * generic platform independent high() support
  1006. Revision 1.45 1999/01/20 12:34:22 peter
  1007. * fixed typed file read/write
  1008. Revision 1.44 1999/01/15 11:33:03 pierre
  1009. * bug in mmx code removed
  1010. Revision 1.43 1998/12/30 13:41:20 peter
  1011. * released valuepara
  1012. Revision 1.42 1998/12/11 00:04:03 peter
  1013. + globtype,tokens,version unit splitted from globals
  1014. Revision 1.41 1998/12/10 09:47:33 florian
  1015. + basic operations with int64/qord (compiler with -dint64)
  1016. + rtti of enumerations extended: names are now written
  1017. Revision 1.40 1998/12/04 10:18:14 florian
  1018. * some stuff for procedures of object added
  1019. * bug with overridden virtual constructors fixed (reported by Italo Gomes)
  1020. Revision 1.39 1998/11/27 14:50:55 peter
  1021. + open strings, $P switch support
  1022. Revision 1.38 1998/11/18 15:44:24 peter
  1023. * VALUEPARA for tp7 compatible value parameters
  1024. Revision 1.37 1998/11/13 10:15:50 peter
  1025. * fixed ptr() with constants
  1026. Revision 1.36 1998/11/10 10:09:21 peter
  1027. * va_list -> array of const
  1028. Revision 1.35 1998/10/19 08:55:13 pierre
  1029. * wrong stabs info corrected once again !!
  1030. + variable vmt offset with vmt field only if required
  1031. implemented now !!!
  1032. Revision 1.34 1998/10/12 09:50:06 florian
  1033. + support of <procedure var type>:=<pointer> in delphi mode added
  1034. Revision 1.33 1998/10/06 20:43:30 peter
  1035. * fixed set of bugs. like set of false..true set of #1..#255 and
  1036. set of #1..true which was allowed
  1037. Revision 1.32 1998/10/05 21:33:35 peter
  1038. * fixed 161,165,166,167,168
  1039. Revision 1.31 1998/09/23 09:58:56 peter
  1040. * first working array of const things
  1041. Revision 1.30 1998/09/22 15:40:58 peter
  1042. * some extra ifdef GDB
  1043. Revision 1.29 1998/09/16 12:37:31 michael
  1044. Added FPC_ prefix to abstracterror
  1045. Revision 1.28 1998/09/09 16:44:23 florian
  1046. * I hope, the case bug is fixed now
  1047. Revision 1.27 1998/09/07 17:37:07 florian
  1048. * first fixes for published properties
  1049. Revision 1.26 1998/09/04 12:24:31 florian
  1050. * bug0159 fixed
  1051. Revision 1.25 1998/09/04 09:06:36 florian
  1052. * bug0132 fixed
  1053. Revision 1.24 1998/09/04 08:36:49 peter
  1054. * fixed boolean:=integer which is not explicit
  1055. Revision 1.23 1998/09/01 17:39:55 peter
  1056. + internal constant functions
  1057. Revision 1.22 1998/09/01 12:53:28 peter
  1058. + aktpackenum
  1059. Revision 1.21 1998/08/19 00:42:45 peter
  1060. + subrange types for enums
  1061. + checking for bounds type with ranges
  1062. Revision 1.20 1998/08/18 14:17:14 pierre
  1063. * bug about assigning the return value of a function to
  1064. a procvar fixed : warning
  1065. assigning a proc to a procvar need @ in FPC mode !!
  1066. * missing file/line info restored
  1067. Revision 1.19 1998/08/18 09:24:48 pierre
  1068. * small warning position bug fixed
  1069. * support_mmx switches splitting was missing
  1070. * rhide error and warning output corrected
  1071. Revision 1.18 1998/08/14 18:18:49 peter
  1072. + dynamic set contruction
  1073. * smallsets are now working (always longint size)
  1074. Revision 1.17 1998/08/05 16:00:17 florian
  1075. * some fixes for ansi strings
  1076. Revision 1.16 1998/07/20 23:35:50 michael
  1077. Const ansistrings are not copied.
  1078. Revision 1.15 1998/07/18 22:54:32 florian
  1079. * some ansi/wide/longstring support fixed:
  1080. o parameter passing
  1081. o returning as result from functions
  1082. Revision 1.14 1998/06/12 14:50:50 peter
  1083. * removed the tree dependency to types.pas
  1084. * long_fil.pas support (not fully tested yet)
  1085. Revision 1.13 1998/06/03 22:49:07 peter
  1086. + wordbool,longbool
  1087. * rename bis,von -> high,low
  1088. * moved some systemunit loading/creating to psystem.pas
  1089. Revision 1.12 1998/05/12 10:47:00 peter
  1090. * moved printstatus to verb_def
  1091. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1092. prefix like error: warning: and is included in V_Default
  1093. * fixed some messages
  1094. * first time parameter scan is only for -v and -T
  1095. - removed old style messages
  1096. Revision 1.11 1998/05/01 16:38:46 florian
  1097. * handling of private and protected fixed
  1098. + change_keywords_to_tp implemented to remove
  1099. keywords which aren't supported by tp
  1100. * break and continue are now symbols of the system unit
  1101. + widestring, longstring and ansistring type released
  1102. Revision 1.10 1998/04/29 10:34:08 pierre
  1103. + added some code for ansistring (not complete nor working yet)
  1104. * corrected operator overloading
  1105. * corrected nasm output
  1106. + started inline procedures
  1107. + added starstarn : use ** for exponentiation (^ gave problems)
  1108. + started UseTokenInfo cond to get accurate positions
  1109. Revision 1.9 1998/04/21 10:16:49 peter
  1110. * patches from strasbourg
  1111. * objects is not used anymore in the fpc compiled version
  1112. Revision 1.8 1998/04/12 22:39:44 florian
  1113. * problem with read access to properties solved
  1114. * correct handling of hidding methods via virtual (COM)
  1115. * correct result type of constructor calls (COM), the resulttype
  1116. depends now on the type of the class reference
  1117. Revision 1.7 1998/04/10 21:36:56 florian
  1118. + some stuff to support method pointers (procedure of object) added
  1119. (declaration, parameter handling)
  1120. Revision 1.6 1998/04/10 15:39:49 florian
  1121. * more fixes to get classes.pas compiled
  1122. Revision 1.5 1998/04/09 23:02:16 florian
  1123. * small problems solved to get remake3 work
  1124. Revision 1.4 1998/04/08 16:58:09 pierre
  1125. * several bugfixes
  1126. ADD ADC and AND are also sign extended
  1127. nasm output OK (program still crashes at end
  1128. and creates wrong assembler files !!)
  1129. procsym types sym in tdef removed !!
  1130. Revision 1.3 1998/04/08 11:34:22 peter
  1131. * nasm works (linux only tested)
  1132. }