tree.pas 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. This units exports some routines to manage the parse tree
  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. {$ifdef tp}
  19. {$E+,N+}
  20. {$endif}
  21. unit tree;
  22. interface
  23. uses
  24. globtype,cobjects,symtable,aasm
  25. {$ifdef i386}
  26. ,i386
  27. {$endif}
  28. {$ifdef m68k}
  29. ,m68k
  30. {$endif}
  31. {$ifdef alpha}
  32. ,alpha
  33. {$endif}
  34. ;
  35. type
  36. pconstset = ^tconstset;
  37. tconstset = array[0..31] of byte;
  38. ttreetyp = (
  39. addn, {Represents the + operator.}
  40. muln, {Represents the * operator.}
  41. subn, {Represents the - operator.}
  42. divn, {Represents the div operator.}
  43. symdifn, {Represents the >< operator.}
  44. modn, {Represents the mod operator.}
  45. assignn, {Represents an assignment.}
  46. loadn, {Represents the use of a variabele.}
  47. rangen, {Represents a range (i.e. 0..9).}
  48. ltn, {Represents the < operator.}
  49. lten, {Represents the <= operator.}
  50. gtn, {Represents the > operator.}
  51. gten, {Represents the >= operator.}
  52. equaln, {Represents the = operator.}
  53. unequaln, {Represents the <> operator.}
  54. inn, {Represents the in operator.}
  55. orn, {Represents the or operator.}
  56. xorn, {Represents the xor operator.}
  57. shrn, {Represents the shr operator.}
  58. shln, {Represents the shl operator.}
  59. slashn, {Represents the / operator.}
  60. andn, {Represents the and operator.}
  61. subscriptn, {??? Field in a record/object?}
  62. derefn, {Dereferences a pointer.}
  63. addrn, {Represents the @ operator.}
  64. doubleaddrn, {Represents the @@ operator.}
  65. ordconstn, {Represents an ordinal value.}
  66. typeconvn, {Represents type-conversion/typecast.}
  67. calln, {Represents a call node.}
  68. callparan, {Represents a parameter.}
  69. realconstn, {Represents a real value.}
  70. fixconstn, {Represents a fixed value.}
  71. umminusn, {Represents a sign change (i.e. -2).}
  72. asmn, {Represents an assembler node }
  73. vecn, {Represents array indexing.}
  74. stringconstn, {Represents a string constant.}
  75. funcretn, {Represents the function result var.}
  76. selfn, {Represents the self parameter.}
  77. notn, {Represents the not operator.}
  78. inlinen, {Internal procedures (i.e. writeln).}
  79. niln, {Represents the nil pointer.}
  80. errorn, {This part of the tree could not be
  81. parsed because of a compiler error.}
  82. typen, {A type name. Used for i.e. typeof(obj).}
  83. hnewn, {The new operation, constructor call.}
  84. hdisposen, {The dispose operation with destructor call.}
  85. newn, {The new operation, constructor call.}
  86. simpledisposen, {The dispose operation.}
  87. setelementn, {A set element(s) (i.e. [a,b] and also [a..b]).}
  88. setconstn, {A set constant (i.e. [1,2]).}
  89. blockn, {A block of statements.}
  90. statementn, {One statement in a block of nodes.}
  91. loopn, { used in genloopnode, must be converted }
  92. ifn, {An if statement.}
  93. breakn, {A break statement.}
  94. continuen, {A continue statement.}
  95. repeatn, {A repeat until block.}
  96. whilen, {A while do statement.}
  97. forn, {A for loop.}
  98. exitn, {An exit statement.}
  99. withn, {A with statement.}
  100. casen, {A case statement.}
  101. labeln, {A label.}
  102. goton, {A goto statement.}
  103. simplenewn, {The new operation.}
  104. tryexceptn, {A try except block.}
  105. raisen, {A raise statement.}
  106. switchesn, {??? Currently unused...}
  107. tryfinallyn, {A try finally statement.}
  108. onn, { for an on statement in exception code }
  109. isn, {Represents the is operator.}
  110. asn, {Represents the as typecast.}
  111. caretn, {Represents the ^ operator.}
  112. failn, {Represents the fail statement.}
  113. starstarn, {Represents the ** operator exponentiation }
  114. procinlinen, {Procedures that can be inlined }
  115. arrayconstructn, {Construction node for [...] parsing}
  116. arrayconstructrangen, {Range element to allow sets in array construction tree}
  117. { added for optimizations where we cannot suppress }
  118. nothingn,
  119. loadvmtn
  120. );
  121. {$ifndef OLDCNV}
  122. tconverttype = (
  123. tc_equal,
  124. tc_not_possible,
  125. tc_string_2_string,
  126. tc_char_2_string,
  127. tc_pchar_2_string,
  128. tc_cchar_2_pchar,
  129. tc_cstring_2_pchar,
  130. tc_ansistring_2_pchar,
  131. tc_string_2_chararray,
  132. tc_chararray_2_string,
  133. tc_array_2_pointer,
  134. tc_pointer_2_array,
  135. tc_int_2_int,
  136. tc_bool_2_int,
  137. tc_int_2_bool,
  138. tc_real_2_real,
  139. tc_int_2_real,
  140. tc_int_2_fix,
  141. tc_real_2_fix,
  142. tc_fix_2_real,
  143. tc_proc_2_procvar,
  144. tc_arrayconstructor_2_set,
  145. tc_load_smallset
  146. );
  147. {$else}
  148. tconverttype = (tc_equal,tc_not_possible,tc_u8bit_2_s32bit,
  149. tc_only_rangechecks32bit,tc_s8bit_2_s32bit,
  150. tc_u16bit_2_s32bit,tc_s16bit_2_s32bit,
  151. tc_s32bit_2_s16bit,tc_s32bit_2_u8bit,
  152. tc_s32bit_2_u16bit,tc_string_2_string,
  153. tc_cstring_2_pchar,tc_string_2_chararray,
  154. tc_array_2_pointer,tc_pointer_2_array,
  155. tc_char_2_string,tc_u8bit_2_s16bit,
  156. tc_u8bit_2_u16bit,tc_s8bit_2_s16bit,
  157. tc_s16bit_2_s8bit,tc_s16bit_2_u8bit,
  158. tc_u16bit_2_s8bit,tc_u16bit_2_u8bit,
  159. tc_s8bit_2_u16bit,tc_s32bit_2_s8bit,
  160. tc_s32bit_2_u32bit,tc_s16bit_2_u32bit,
  161. tc_s8bit_2_u32bit,tc_u16bit_2_u32bit,
  162. tc_u8bit_2_u32bit,tc_u32bit_2_s32bit,
  163. tc_u32bit_2_s8bit,tc_u32bit_2_u8bit,
  164. tc_u32bit_2_s16bit,tc_u32bit_2_u16bit,
  165. tc_bool_2_int,tc_int_2_bool,
  166. tc_int_2_real,tc_real_2_fix,
  167. tc_fix_2_real,tc_int_2_fix,tc_real_2_real,
  168. tc_chararray_2_string,
  169. tc_proc_2_procvar,tc_cchar_2_pchar,tc_load_smallset,
  170. tc_ansistring_2_pchar,tc_pchar_2_string,
  171. tc_arrayconstructor_2_set);
  172. {$endif}
  173. { allows to determine which elementes are to be replaced }
  174. tdisposetyp = (dt_nothing,dt_leftright,dt_left,dt_leftrighthigh,
  175. dt_mbleft,dt_typeconv,dt_inlinen,
  176. dt_mbleft_and_method,dt_loop,dt_case,dt_with,dt_onn);
  177. { different assignment types }
  178. tassigntyp = (at_normal,at_plus,at_minus,at_star,at_slash);
  179. pcaserecord = ^tcaserecord;
  180. tcaserecord = record
  181. { range }
  182. _low,_high : longint;
  183. { only used by gentreejmp }
  184. _at : plabel;
  185. { label of instruction }
  186. statement : plabel;
  187. { is this the first of an case entry, needed to release statement
  188. label (PFV) }
  189. firstlabel : boolean;
  190. { left and right tree node }
  191. less,greater : pcaserecord;
  192. end;
  193. ptree = ^ttree;
  194. ttree = record
  195. error : boolean;
  196. disposetyp : tdisposetyp;
  197. { is true, if the right and left operand are swaped }
  198. swaped : boolean;
  199. { the location of the result of this node }
  200. location : tlocation;
  201. { the number of registers needed to evalute the node }
  202. registers32,registersfpu : longint; { must be longint !!!! }
  203. {$ifdef SUPPORT_MMX}
  204. registersmmx : longint;
  205. {$endif SUPPORT_MMX}
  206. left,right : ptree;
  207. resulttype : pdef;
  208. fileinfo : tfileposinfo;
  209. localswitches : tlocalswitches;
  210. {$ifdef extdebug}
  211. firstpasscount : longint;
  212. {$endif extdebug}
  213. case treetype : ttreetyp of
  214. addn : (use_strconcat : boolean;string_typ : tstringtype);
  215. callparan : (is_colon_para : boolean;exact_match_found : boolean;hightree:ptree);
  216. assignn : (assigntyp : tassigntyp;concat_string : boolean);
  217. loadn : (symtableentry : psym;symtable : psymtable;
  218. is_absolute,is_first : boolean);
  219. calln : (symtableprocentry : psym;
  220. symtableproc : psymtable;procdefinition : pprocdef;
  221. methodpointer : ptree;
  222. no_check,unit_specific,return_value_used : boolean);
  223. ordconstn : (value : longint);
  224. realconstn : (value_real : bestreal;lab_real : plabel;realtyp : tait);
  225. fixconstn : (value_fix: longint);
  226. funcretn : (funcretprocinfo : pointer;retdef : pdef);
  227. subscriptn : (vs : pvarsym);
  228. vecn : (memindex,memseg:boolean;callunique : boolean);
  229. stringconstn : (value_str : pchar;length : longint; lab_str : plabel;stringtype : tstringtype);
  230. typeconvn : (convtyp : tconverttype;explizit : boolean);
  231. typen : (typenodetype : pdef);
  232. inlinen : (inlinenumber : byte;inlineconst:boolean);
  233. procinlinen : (inlineprocdef : pprocdef;
  234. retoffset,para_offset,para_size : longint);
  235. setconstn : (value_set : pconstset;lab_set:plabel);
  236. loopn : (t1,t2 : ptree;backward : boolean);
  237. asmn : (p_asm : paasmoutput;object_preserved : boolean);
  238. casen : (nodes : pcaserecord;elseblock : ptree);
  239. labeln,goton : (labelnr : plabel);
  240. withn : (withsymtable : pwithsymtable;tablecount : longint;
  241. pref : preference);
  242. onn : (exceptsymtable : psymtable;excepttype : pobjectdef);
  243. arrayconstructn : (cargs,cargswap: boolean);
  244. end;
  245. function gennode(t : ttreetyp;l,r : ptree) : ptree;
  246. function genlabelnode(t : ttreetyp;nr : plabel) : ptree;
  247. function genloadnode(v : pvarsym;st : psymtable) : ptree;
  248. function genloadcallnode(v: pprocsym;st: psymtable): ptree;
  249. function gensinglenode(t : ttreetyp;l : ptree) : ptree;
  250. function gensubscriptnode(varsym : pvarsym;l : ptree) : ptree;
  251. function genordinalconstnode(v : longint;def : pdef) : ptree;
  252. function genfixconstnode(v : longint;def : pdef) : ptree;
  253. function gentypeconvnode(node : ptree;t : pdef) : ptree;
  254. function gentypenode(t : pdef) : ptree;
  255. function gencallparanode(expr,next : ptree) : ptree;
  256. function genrealconstnode(v : bestreal) : ptree;
  257. function gencallnode(v : pprocsym;st : psymtable) : ptree;
  258. function genmethodcallnode(v : pprocsym;st : psymtable;mp : ptree) : ptree;
  259. { allow pchar or string for defining a pchar node }
  260. function genstringconstnode(const s : string) : ptree;
  261. { length is required for ansistrings }
  262. function genpcharconstnode(s : pchar;length : longint) : ptree;
  263. { helper routine for conststring node }
  264. function getpcharcopy(p : ptree) : pchar;
  265. function genzeronode(t : ttreetyp) : ptree;
  266. function geninlinenode(number : byte;is_const:boolean;l : ptree) : ptree;
  267. function genprocinlinenode(callp,code : ptree) : ptree;
  268. function gentypedconstloadnode(sym : ptypedconstsym;st : psymtable) : ptree;
  269. function genenumnode(v : penumsym) : ptree;
  270. function genselfnode(_class : pdef) : ptree;
  271. function gensetconstnode(s : pconstset;settype : psetdef) : ptree;
  272. function genloopnode(t : ttreetyp;l,r,n1: ptree;back : boolean) : ptree;
  273. function genasmnode(p_asm : paasmoutput) : ptree;
  274. function gencasenode(l,r : ptree;nodes : pcaserecord) : ptree;
  275. function genwithnode(symtable : pwithsymtable;l,r : ptree;count : longint) : ptree;
  276. function getcopy(p : ptree) : ptree;
  277. function equal_trees(t1,t2 : ptree) : boolean;
  278. procedure swaptree(p:Ptree);
  279. procedure disposetree(p : ptree);
  280. procedure putnode(p : ptree);
  281. function getnode : ptree;
  282. procedure clear_location(var loc : tlocation);
  283. procedure set_location(var destloc,sourceloc : tlocation);
  284. procedure swap_location(var destloc,sourceloc : tlocation);
  285. procedure set_file_line(from,_to : ptree);
  286. procedure set_tree_filepos(p : ptree;const filepos : tfileposinfo);
  287. {$ifdef extdebug}
  288. procedure compare_trees(oldp,p : ptree);
  289. const
  290. maxfirstpasscount : longint = 0;
  291. {$endif extdebug}
  292. { sets the callunique flag, if the node is a vecn, }
  293. { takes care of type casts etc. }
  294. procedure set_unique(p : ptree);
  295. { gibt den ordinalen Werten der Node zurueck oder falls sie }
  296. { keinen ordinalen Wert hat, wird ein Fehler erzeugt }
  297. function get_ordinal_value(p : ptree) : longint;
  298. function is_constnode(p : ptree) : boolean;
  299. { true, if p is a pointer to a const int value }
  300. function is_constintnode(p : ptree) : boolean;
  301. function is_constboolnode(p : ptree) : boolean;
  302. function is_constrealnode(p : ptree) : boolean;
  303. function is_constcharnode(p : ptree) : boolean;
  304. function str_length(p : ptree) : longint;
  305. function is_emptyset(p : ptree):boolean;
  306. {$I innr.inc}
  307. implementation
  308. uses
  309. systems,
  310. globals,verbose,files,types;
  311. function getnode : ptree;
  312. var
  313. hp : ptree;
  314. begin
  315. new(hp);
  316. { makes error tracking easier }
  317. fillchar(hp^,sizeof(ttree),0);
  318. { reset }
  319. hp^.location.loc:=LOC_INVALID;
  320. { save local info }
  321. hp^.fileinfo:=aktfilepos;
  322. hp^.localswitches:=aktlocalswitches;
  323. getnode:=hp;
  324. end;
  325. procedure putnode(p : ptree);
  326. begin
  327. { clean up the contents of a node }
  328. case p^.treetype of
  329. asmn : if assigned(p^.p_asm) then
  330. dispose(p^.p_asm,done);
  331. stringconstn : begin
  332. ansistringdispose(p^.value_str,p^.length);
  333. end;
  334. setconstn : begin
  335. if assigned(p^.value_set) then
  336. dispose(p^.value_set);
  337. end;
  338. end;
  339. { reference info }
  340. if (p^.location.loc in [LOC_MEM,LOC_REFERENCE]) and
  341. assigned(p^.location.reference.symbol) then
  342. stringdispose(p^.location.reference.symbol);
  343. {$ifdef extdebug}
  344. if p^.firstpasscount>maxfirstpasscount then
  345. maxfirstpasscount:=p^.firstpasscount;
  346. {$endif extdebug}
  347. dispose(p);
  348. end;
  349. function getcopy(p : ptree) : ptree;
  350. var
  351. hp : ptree;
  352. begin
  353. hp:=getnode;
  354. hp^:=p^;
  355. if assigned(p^.location.reference.symbol) then
  356. hp^.location.reference.symbol:=stringdup(p^.location.reference.symbol^);
  357. case p^.disposetyp of
  358. dt_leftright :
  359. begin
  360. if assigned(p^.left) then
  361. hp^.left:=getcopy(p^.left);
  362. if assigned(p^.right) then
  363. hp^.right:=getcopy(p^.right);
  364. end;
  365. dt_leftrighthigh :
  366. begin
  367. if assigned(p^.left) then
  368. hp^.left:=getcopy(p^.left);
  369. if assigned(p^.right) then
  370. hp^.right:=getcopy(p^.right);
  371. if assigned(p^.hightree) then
  372. hp^.left:=getcopy(p^.hightree);
  373. end;
  374. dt_nothing : ;
  375. dt_left :
  376. if assigned(p^.left) then
  377. hp^.left:=getcopy(p^.left);
  378. dt_mbleft :
  379. if assigned(p^.left) then
  380. hp^.left:=getcopy(p^.left);
  381. dt_mbleft_and_method :
  382. begin
  383. if assigned(p^.left) then
  384. hp^.left:=getcopy(p^.left);
  385. hp^.methodpointer:=getcopy(p^.methodpointer);
  386. end;
  387. dt_loop :
  388. begin
  389. if assigned(p^.left) then
  390. hp^.left:=getcopy(p^.left);
  391. if assigned(p^.right) then
  392. hp^.right:=getcopy(p^.right);
  393. if assigned(p^.t1) then
  394. hp^.t1:=getcopy(p^.t1);
  395. if assigned(p^.t2) then
  396. hp^.t2:=getcopy(p^.t2);
  397. end;
  398. dt_typeconv : hp^.left:=getcopy(p^.left);
  399. dt_inlinen :
  400. if assigned(p^.left) then
  401. hp^.left:=getcopy(p^.left);
  402. else internalerror(11);
  403. end;
  404. { now check treetype }
  405. case p^.treetype of
  406. stringconstn : begin
  407. hp^.value_str:=getpcharcopy(p);
  408. hp^.length:=p^.length;
  409. end;
  410. setconstn : begin
  411. new(hp^.value_set);
  412. hp^.value_set:=p^.value_set;
  413. end;
  414. end;
  415. getcopy:=hp;
  416. end;
  417. procedure deletecaselabels(p : pcaserecord);
  418. begin
  419. if assigned(p^.greater) then
  420. deletecaselabels(p^.greater);
  421. if assigned(p^.less) then
  422. deletecaselabels(p^.less);
  423. freelabel(p^._at);
  424. if p^.firstlabel then
  425. freelabel(p^.statement);
  426. dispose(p);
  427. end;
  428. procedure swaptree(p:Ptree);
  429. var swapp:Ptree;
  430. begin
  431. swapp:=p^.right;
  432. p^.right:=p^.left;
  433. p^.left:=swapp;
  434. p^.swaped:=not(p^.swaped);
  435. end;
  436. procedure disposetree(p : ptree);
  437. var
  438. symt : pwithsymtable;
  439. i : longint;
  440. begin
  441. if not(assigned(p)) then
  442. exit;
  443. if not(p^.treetype in [addn..loadvmtn]) then
  444. internalerror(26219);
  445. case p^.disposetyp of
  446. dt_leftright :
  447. begin
  448. if assigned(p^.left) then
  449. disposetree(p^.left);
  450. if assigned(p^.right) then
  451. disposetree(p^.right);
  452. end;
  453. dt_leftrighthigh :
  454. begin
  455. if assigned(p^.left) then
  456. disposetree(p^.left);
  457. if assigned(p^.right) then
  458. disposetree(p^.right);
  459. if assigned(p^.hightree) then
  460. disposetree(p^.hightree);
  461. end;
  462. dt_case :
  463. begin
  464. if assigned(p^.left) then
  465. disposetree(p^.left);
  466. if assigned(p^.right) then
  467. disposetree(p^.right);
  468. if assigned(p^.nodes) then
  469. deletecaselabels(p^.nodes);
  470. if assigned(p^.elseblock) then
  471. disposetree(p^.elseblock);
  472. end;
  473. dt_nothing : ;
  474. dt_left :
  475. if assigned(p^.left) then
  476. disposetree(p^.left);
  477. dt_mbleft :
  478. if assigned(p^.left) then
  479. disposetree(p^.left);
  480. dt_mbleft_and_method :
  481. begin
  482. if assigned(p^.left) then disposetree(p^.left);
  483. disposetree(p^.methodpointer);
  484. end;
  485. dt_typeconv : disposetree(p^.left);
  486. dt_inlinen :
  487. if assigned(p^.left) then
  488. disposetree(p^.left);
  489. dt_loop :
  490. begin
  491. if assigned(p^.left) then
  492. disposetree(p^.left);
  493. if assigned(p^.right) then
  494. disposetree(p^.right);
  495. if assigned(p^.t1) then
  496. disposetree(p^.t1);
  497. if assigned(p^.t2) then
  498. disposetree(p^.t2);
  499. end;
  500. dt_onn:
  501. begin
  502. if assigned(p^.left) then
  503. disposetree(p^.left);
  504. if assigned(p^.right) then
  505. disposetree(p^.right);
  506. if assigned(p^.exceptsymtable) then
  507. dispose(p^.exceptsymtable,done);
  508. end;
  509. dt_with :
  510. begin
  511. if assigned(p^.left) then
  512. disposetree(p^.left);
  513. if assigned(p^.right) then
  514. disposetree(p^.right);
  515. symt:=p^.withsymtable;
  516. for i:=1 to p^.tablecount do
  517. begin
  518. if assigned(symt) then
  519. begin
  520. p^.withsymtable:=pwithsymtable(symt^.next);
  521. dispose(symt,done);
  522. end;
  523. symt:=p^.withsymtable;
  524. end;
  525. end;
  526. else internalerror(12);
  527. end;
  528. putnode(p);
  529. end;
  530. procedure set_file_line(from,_to : ptree);
  531. begin
  532. if assigned(from) then
  533. _to^.fileinfo:=from^.fileinfo;
  534. end;
  535. procedure set_tree_filepos(p : ptree;const filepos : tfileposinfo);
  536. begin
  537. p^.fileinfo:=filepos;
  538. end;
  539. function genwithnode(symtable : pwithsymtable;l,r : ptree;count : longint) : ptree;
  540. var
  541. p : ptree;
  542. begin
  543. p:=getnode;
  544. p^.disposetyp:=dt_with;
  545. p^.treetype:=withn;
  546. p^.left:=l;
  547. p^.right:=r;
  548. p^.registers32:=0;
  549. { p^.registers16:=0;
  550. p^.registers8:=0; }
  551. p^.registersfpu:=0;
  552. {$ifdef SUPPORT_MMX}
  553. p^.registersmmx:=0;
  554. {$endif SUPPORT_MMX}
  555. p^.resulttype:=nil;
  556. p^.withsymtable:=symtable;
  557. p^.tablecount:=count;
  558. p^.pref:=nil;
  559. set_file_line(l,p);
  560. genwithnode:=p;
  561. end;
  562. function genfixconstnode(v : longint;def : pdef) : ptree;
  563. var
  564. p : ptree;
  565. begin
  566. p:=getnode;
  567. p^.disposetyp:=dt_nothing;
  568. p^.treetype:=fixconstn;
  569. p^.registers32:=0;
  570. { p^.registers16:=0;
  571. p^.registers8:=0; }
  572. p^.registersfpu:=0;
  573. {$ifdef SUPPORT_MMX}
  574. p^.registersmmx:=0;
  575. {$endif SUPPORT_MMX}
  576. p^.resulttype:=def;
  577. p^.value:=v;
  578. genfixconstnode:=p;
  579. end;
  580. function gencallparanode(expr,next : ptree) : ptree;
  581. var
  582. p : ptree;
  583. begin
  584. p:=getnode;
  585. p^.disposetyp:=dt_leftrighthigh;
  586. p^.treetype:=callparan;
  587. p^.left:=expr;
  588. p^.right:=next;
  589. p^.registers32:=0;
  590. { p^.registers16:=0;
  591. p^.registers8:=0; }
  592. {$ifdef SUPPORT_MMX}
  593. p^.registersmmx:=0;
  594. {$endif SUPPORT_MMX}
  595. p^.registersfpu:=0;
  596. p^.resulttype:=nil;
  597. p^.exact_match_found:=false;
  598. p^.is_colon_para:=false;
  599. p^.hightree:=nil;
  600. set_file_line(expr,p);
  601. gencallparanode:=p;
  602. end;
  603. function gennode(t : ttreetyp;l,r : ptree) : ptree;
  604. var
  605. p : ptree;
  606. begin
  607. p:=getnode;
  608. p^.disposetyp:=dt_leftright;
  609. p^.treetype:=t;
  610. p^.left:=l;
  611. p^.right:=r;
  612. p^.registers32:=0;
  613. { p^.registers16:=0;
  614. p^.registers8:=0; }
  615. p^.registersfpu:=0;
  616. {$ifdef SUPPORT_MMX}
  617. p^.registersmmx:=0;
  618. {$endif SUPPORT_MMX}
  619. p^.resulttype:=nil;
  620. gennode:=p;
  621. end;
  622. function gencasenode(l,r : ptree;nodes : pcaserecord) : ptree;
  623. var
  624. p : ptree;
  625. begin
  626. p:=getnode;
  627. p^.disposetyp:=dt_case;
  628. p^.treetype:=casen;
  629. p^.left:=l;
  630. p^.right:=r;
  631. p^.nodes:=nodes;
  632. p^.registers32:=0;
  633. p^.registersfpu:=0;
  634. {$ifdef SUPPORT_MMX}
  635. p^.registersmmx:=0;
  636. {$endif SUPPORT_MMX}
  637. p^.resulttype:=nil;
  638. set_file_line(l,p);
  639. gencasenode:=p;
  640. end;
  641. function genloopnode(t : ttreetyp;l,r,n1 : ptree;back : boolean) : ptree;
  642. var
  643. p : ptree;
  644. begin
  645. p:=getnode;
  646. p^.disposetyp:=dt_loop;
  647. p^.treetype:=t;
  648. p^.left:=l;
  649. p^.right:=r;
  650. p^.t1:=n1;
  651. p^.t2:=nil;
  652. p^.registers32:=0;
  653. p^.backward:=back;
  654. { p^.registers16:=0;
  655. p^.registers8:=0; }
  656. p^.registersfpu:=0;
  657. {$ifdef SUPPORT_MMX}
  658. p^.registersmmx:=0;
  659. {$endif SUPPORT_MMX}
  660. p^.resulttype:=nil;
  661. set_file_line(l,p);
  662. genloopnode:=p;
  663. end;
  664. function genordinalconstnode(v : longint;def : pdef) : ptree;
  665. var
  666. p : ptree;
  667. begin
  668. p:=getnode;
  669. p^.disposetyp:=dt_nothing;
  670. p^.treetype:=ordconstn;
  671. p^.registers32:=0;
  672. { p^.registers16:=0;
  673. p^.registers8:=0; }
  674. p^.registersfpu:=0;
  675. {$ifdef SUPPORT_MMX}
  676. p^.registersmmx:=0;
  677. {$endif SUPPORT_MMX}
  678. p^.resulttype:=def;
  679. p^.value:=v;
  680. if p^.resulttype^.deftype=orddef then
  681. testrange(p^.resulttype,p^.value);
  682. genordinalconstnode:=p;
  683. end;
  684. function genenumnode(v : penumsym) : ptree;
  685. var
  686. p : ptree;
  687. begin
  688. p:=getnode;
  689. p^.disposetyp:=dt_nothing;
  690. p^.treetype:=ordconstn;
  691. p^.registers32:=0;
  692. { p^.registers16:=0;
  693. p^.registers8:=0; }
  694. p^.registersfpu:=0;
  695. {$ifdef SUPPORT_MMX}
  696. p^.registersmmx:=0;
  697. {$endif SUPPORT_MMX}
  698. p^.resulttype:=v^.definition;
  699. p^.value:=v^.value;
  700. testrange(p^.resulttype,p^.value);
  701. genenumnode:=p;
  702. end;
  703. function genrealconstnode(v : bestreal) : ptree;
  704. var
  705. p : ptree;
  706. begin
  707. p:=getnode;
  708. p^.disposetyp:=dt_nothing;
  709. p^.treetype:=realconstn;
  710. p^.registers32:=0;
  711. { p^.registers16:=0;
  712. p^.registers8:=0; }
  713. p^.registersfpu:=0;
  714. {$ifdef SUPPORT_MMX}
  715. p^.registersmmx:=0;
  716. {$endif SUPPORT_MMX}
  717. {$ifdef i386}
  718. p^.resulttype:=c64floatdef;
  719. p^.value_real:=v;
  720. { default value is double }
  721. p^.realtyp:=ait_real_64bit;
  722. {$endif}
  723. {$ifdef m68k}
  724. p^.resulttype:=new(pfloatdef,init(s32real));
  725. p^.value_real:=v;
  726. { default value is double }
  727. p^.realtyp:=ait_real_32bit;
  728. {$endif}
  729. p^.lab_real:=nil;
  730. genrealconstnode:=p;
  731. end;
  732. function genstringconstnode(const s : string) : ptree;
  733. var
  734. p : ptree;
  735. l : longint;
  736. begin
  737. p:=getnode;
  738. p^.disposetyp:=dt_nothing;
  739. p^.treetype:=stringconstn;
  740. p^.registers32:=0;
  741. { p^.registers16:=0;
  742. p^.registers8:=0; }
  743. p^.registersfpu:=0;
  744. {$ifdef SUPPORT_MMX}
  745. p^.registersmmx:=0;
  746. {$endif SUPPORT_MMX}
  747. l:=length(s);
  748. p^.length:=l;
  749. { stringdup write even past a #0 }
  750. getmem(p^.value_str,l+1);
  751. move(s[1],p^.value_str^,l);
  752. p^.value_str[l]:=#0;
  753. p^.lab_str:=nil;
  754. if cs_ansistrings in aktlocalswitches then
  755. begin
  756. p^.stringtype:=st_ansistring;
  757. p^.resulttype:=cansistringdef;
  758. end
  759. else
  760. begin
  761. p^.stringtype:=st_shortstring;
  762. p^.resulttype:=cshortstringdef;
  763. end;
  764. genstringconstnode:=p;
  765. end;
  766. function getpcharcopy(p : ptree) : pchar;
  767. var
  768. pc : pchar;
  769. begin
  770. pc:=nil;
  771. getmem(pc,p^.length+1);
  772. if pc=nil then
  773. Message(general_f_no_memory_left);
  774. move(p^.value_str^,pc^,p^.length+1);
  775. getpcharcopy:=pc;
  776. end;
  777. function genpcharconstnode(s : pchar;length : longint) : ptree;
  778. var
  779. p : ptree;
  780. begin
  781. p:=getnode;
  782. p^.disposetyp:=dt_nothing;
  783. p^.treetype:=stringconstn;
  784. p^.registers32:=0;
  785. { p^.registers16:=0;
  786. p^.registers8:=0; }
  787. p^.registersfpu:=0;
  788. {$ifdef SUPPORT_MMX}
  789. p^.registersmmx:=0;
  790. {$endif SUPPORT_MMX}
  791. p^.resulttype:=cshortstringdef;
  792. p^.length:=length;
  793. p^.value_str:=s;
  794. p^.lab_str:=nil;
  795. genpcharconstnode:=p;
  796. end;
  797. function gensinglenode(t : ttreetyp;l : ptree) : ptree;
  798. var
  799. p : ptree;
  800. begin
  801. p:=getnode;
  802. p^.disposetyp:=dt_left;
  803. p^.treetype:=t;
  804. p^.left:=l;
  805. p^.registers32:=0;
  806. { p^.registers16:=0;
  807. p^.registers8:=0; }
  808. p^.registersfpu:=0;
  809. {$ifdef SUPPORT_MMX}
  810. p^.registersmmx:=0;
  811. {$endif SUPPORT_MMX}
  812. p^.resulttype:=nil;
  813. gensinglenode:=p;
  814. end;
  815. function genasmnode(p_asm : paasmoutput) : ptree;
  816. var
  817. p : ptree;
  818. begin
  819. p:=getnode;
  820. p^.disposetyp:=dt_nothing;
  821. p^.treetype:=asmn;
  822. p^.registers32:=4;
  823. p^.p_asm:=p_asm;
  824. p^.object_preserved:=false;
  825. { p^.registers16:=0;
  826. p^.registers8:=0; }
  827. p^.registersfpu:=8;
  828. {$ifdef SUPPORT_MMX}
  829. p^.registersmmx:=8;
  830. {$endif SUPPORT_MMX}
  831. p^.resulttype:=nil;
  832. genasmnode:=p;
  833. end;
  834. function genloadnode(v : pvarsym;st : psymtable) : ptree;
  835. var
  836. p : ptree;
  837. begin
  838. p:=getnode;
  839. p^.registers32:=0;
  840. { p^.registers16:=0;
  841. p^.registers8:=0; }
  842. p^.registersfpu:=0;
  843. {$ifdef SUPPORT_MMX}
  844. p^.registersmmx:=0;
  845. {$endif SUPPORT_MMX}
  846. p^.treetype:=loadn;
  847. p^.resulttype:=v^.definition;
  848. p^.symtableentry:=v;
  849. p^.symtable:=st;
  850. p^.is_first := False;
  851. { method pointer load nodes can use the left subtree }
  852. p^.disposetyp:=dt_left;
  853. p^.left:=nil;
  854. genloadnode:=p;
  855. end;
  856. function genloadcallnode(v: pprocsym;st: psymtable): ptree;
  857. var
  858. p : ptree;
  859. begin
  860. p:=getnode;
  861. p^.registers32:=0;
  862. { p^.registers16:=0;
  863. p^.registers8:=0; }
  864. p^.registersfpu:=0;
  865. {$ifdef SUPPORT_MMX}
  866. p^.registersmmx:=0;
  867. {$endif SUPPORT_MMX}
  868. p^.treetype:=loadn;
  869. p^.left:=nil;
  870. p^.resulttype:=v^.definition;
  871. p^.symtableentry:=v;
  872. p^.symtable:=st;
  873. p^.is_first := False;
  874. p^.disposetyp:=dt_nothing;
  875. genloadcallnode:=p;
  876. end;
  877. function gentypedconstloadnode(sym : ptypedconstsym;st : psymtable) : ptree;
  878. var
  879. p : ptree;
  880. begin
  881. p:=getnode;
  882. p^.registers32:=0;
  883. { p^.registers16:=0;
  884. p^.registers8:=0; }
  885. p^.registersfpu:=0;
  886. {$ifdef SUPPORT_MMX}
  887. p^.registersmmx:=0;
  888. {$endif SUPPORT_MMX}
  889. p^.treetype:=loadn;
  890. p^.left:=nil;
  891. p^.resulttype:=sym^.definition;
  892. p^.symtableentry:=pvarsym(sym);
  893. p^.symtable:=st;
  894. p^.disposetyp:=dt_nothing;
  895. gentypedconstloadnode:=p;
  896. end;
  897. function gentypeconvnode(node : ptree;t : pdef) : ptree;
  898. var
  899. p : ptree;
  900. begin
  901. p:=getnode;
  902. p^.disposetyp:=dt_typeconv;
  903. p^.treetype:=typeconvn;
  904. p^.left:=node;
  905. p^.registers32:=0;
  906. { p^.registers16:=0;
  907. p^.registers8:=0; }
  908. p^.convtyp:=tc_equal;
  909. p^.registersfpu:=0;
  910. {$ifdef SUPPORT_MMX}
  911. p^.registersmmx:=0;
  912. {$endif SUPPORT_MMX}
  913. p^.resulttype:=t;
  914. p^.explizit:=false;
  915. set_file_line(node,p);
  916. gentypeconvnode:=p;
  917. end;
  918. function gentypenode(t : pdef) : ptree;
  919. var
  920. p : ptree;
  921. begin
  922. p:=getnode;
  923. p^.disposetyp:=dt_nothing;
  924. p^.treetype:=typen;
  925. p^.registers32:=0;
  926. { p^.registers16:=0;
  927. p^.registers8:=0; }
  928. p^.registersfpu:=0;
  929. {$ifdef SUPPORT_MMX}
  930. p^.registersmmx:=0;
  931. {$endif SUPPORT_MMX}
  932. p^.resulttype:=generrordef;
  933. p^.typenodetype:=t;
  934. gentypenode:=p;
  935. end;
  936. function gencallnode(v : pprocsym;st : psymtable) : ptree;
  937. var
  938. p : ptree;
  939. begin
  940. p:=getnode;
  941. p^.registers32:=0;
  942. { p^.registers16:=0;
  943. p^.registers8:=0; }
  944. p^.registersfpu:=0;
  945. {$ifdef SUPPORT_MMX}
  946. p^.registersmmx:=0;
  947. {$endif SUPPORT_MMX}
  948. p^.treetype:=calln;
  949. p^.symtableprocentry:=v;
  950. p^.symtableproc:=st;
  951. p^.unit_specific:=false;
  952. p^.no_check:=false;
  953. p^.return_value_used:=true;
  954. p^.disposetyp := dt_leftright;
  955. p^.methodpointer:=nil;
  956. p^.left:=nil;
  957. p^.right:=nil;
  958. p^.procdefinition:=nil;
  959. gencallnode:=p;
  960. end;
  961. function genmethodcallnode(v : pprocsym;st : psymtable;mp : ptree) : ptree;
  962. var
  963. p : ptree;
  964. begin
  965. p:=getnode;
  966. p^.registers32:=0;
  967. { p^.registers16:=0;
  968. p^.registers8:=0; }
  969. p^.registersfpu:=0;
  970. {$ifdef SUPPORT_MMX}
  971. p^.registersmmx:=0;
  972. {$endif SUPPORT_MMX}
  973. p^.treetype:=calln;
  974. p^.return_value_used:=true;
  975. p^.symtableprocentry:=v;
  976. p^.symtableproc:=st;
  977. p^.disposetyp:=dt_mbleft_and_method;
  978. p^.left:=nil;
  979. p^.right:=nil;
  980. p^.methodpointer:=mp;
  981. p^.procdefinition:=nil;
  982. genmethodcallnode:=p;
  983. end;
  984. function gensubscriptnode(varsym : pvarsym;l : ptree) : ptree;
  985. var
  986. p : ptree;
  987. begin
  988. p:=getnode;
  989. p^.disposetyp:=dt_left;
  990. p^.treetype:=subscriptn;
  991. p^.left:=l;
  992. p^.registers32:=0;
  993. p^.vs:=varsym;
  994. { p^.registers16:=0;
  995. p^.registers8:=0; }
  996. p^.registersfpu:=0;
  997. {$ifdef SUPPORT_MMX}
  998. p^.registersmmx:=0;
  999. {$endif SUPPORT_MMX}
  1000. p^.resulttype:=nil;
  1001. gensubscriptnode:=p;
  1002. end;
  1003. function genzeronode(t : ttreetyp) : ptree;
  1004. var
  1005. p : ptree;
  1006. begin
  1007. p:=getnode;
  1008. p^.disposetyp:=dt_nothing;
  1009. p^.treetype:=t;
  1010. p^.registers32:=0;
  1011. { p^.registers16:=0;
  1012. p^.registers8:=0; }
  1013. p^.registersfpu:=0;
  1014. {$ifdef SUPPORT_MMX}
  1015. p^.registersmmx:=0;
  1016. {$endif SUPPORT_MMX}
  1017. p^.resulttype:=nil;
  1018. genzeronode:=p;
  1019. end;
  1020. function genlabelnode(t : ttreetyp;nr : plabel) : ptree;
  1021. var
  1022. p : ptree;
  1023. begin
  1024. p:=getnode;
  1025. p^.disposetyp:=dt_nothing;
  1026. p^.treetype:=t;
  1027. p^.registers32:=0;
  1028. { p^.registers16:=0;
  1029. p^.registers8:=0; }
  1030. p^.registersfpu:=0;
  1031. {$ifdef SUPPORT_MMX}
  1032. p^.registersmmx:=0;
  1033. {$endif SUPPORT_MMX}
  1034. p^.resulttype:=nil;
  1035. { for security }
  1036. { nr^.is_used:=true;}
  1037. p^.labelnr:=nr;
  1038. genlabelnode:=p;
  1039. end;
  1040. function genselfnode(_class : pdef) : ptree;
  1041. var
  1042. p : ptree;
  1043. begin
  1044. p:=getnode;
  1045. p^.disposetyp:=dt_nothing;
  1046. p^.treetype:=selfn;
  1047. p^.registers32:=0;
  1048. { p^.registers16:=0;
  1049. p^.registers8:=0; }
  1050. p^.registersfpu:=0;
  1051. {$ifdef SUPPORT_MMX}
  1052. p^.registersmmx:=0;
  1053. {$endif SUPPORT_MMX}
  1054. p^.resulttype:=_class;
  1055. genselfnode:=p;
  1056. end;
  1057. function geninlinenode(number : byte;is_const:boolean;l : ptree) : ptree;
  1058. var
  1059. p : ptree;
  1060. begin
  1061. p:=getnode;
  1062. p^.disposetyp:=dt_inlinen;
  1063. p^.treetype:=inlinen;
  1064. p^.left:=l;
  1065. p^.inlinenumber:=number;
  1066. p^.inlineconst:=is_const;
  1067. p^.registers32:=0;
  1068. { p^.registers16:=0;
  1069. p^.registers8:=0; }
  1070. p^.registersfpu:=0;
  1071. {$ifdef SUPPORT_MMX}
  1072. p^.registersmmx:=0;
  1073. {$endif SUPPORT_MMX}
  1074. p^.resulttype:=nil;
  1075. geninlinenode:=p;
  1076. end;
  1077. { uses the callnode to create the new procinline node }
  1078. function genprocinlinenode(callp,code : ptree) : ptree;
  1079. var
  1080. p : ptree;
  1081. begin
  1082. p:=getnode;
  1083. p^.disposetyp:=dt_left;
  1084. p^.treetype:=procinlinen;
  1085. p^.inlineprocdef:=callp^.procdefinition;
  1086. p^.retoffset:=-4; { less dangerous as zero (PM) }
  1087. p^.para_offset:=0;
  1088. p^.para_size:=p^.inlineprocdef^.para_size;
  1089. if ret_in_param(p^.inlineprocdef^.retdef) then
  1090. p^.para_size:=p^.para_size+target_os.size_of_pointer;
  1091. { copy args }
  1092. p^.left:=getcopy(code);
  1093. p^.registers32:=code^.registers32;
  1094. p^.registersfpu:=code^.registersfpu;
  1095. {$ifdef SUPPORT_MMX}
  1096. p^.registersmmx:=0;
  1097. {$endif SUPPORT_MMX}
  1098. p^.resulttype:=p^.inlineprocdef^.retdef;
  1099. genprocinlinenode:=p;
  1100. end;
  1101. function gensetconstnode(s : pconstset;settype : psetdef) : ptree;
  1102. var
  1103. p : ptree;
  1104. begin
  1105. p:=getnode;
  1106. p^.disposetyp:=dt_nothing;
  1107. p^.treetype:=setconstn;
  1108. p^.registers32:=0;
  1109. p^.registersfpu:=0;
  1110. {$ifdef SUPPORT_MMX}
  1111. p^.registersmmx:=0;
  1112. {$endif SUPPORT_MMX}
  1113. p^.resulttype:=settype;
  1114. p^.left:=nil;
  1115. new(p^.value_set);
  1116. p^.value_set^:=s^;
  1117. gensetconstnode:=p;
  1118. end;
  1119. {$ifdef extdebug}
  1120. procedure compare_trees(oldp,p : ptree);
  1121. var
  1122. error_found : boolean;
  1123. begin
  1124. if oldp^.resulttype<>p^.resulttype then
  1125. begin
  1126. error_found:=true;
  1127. if is_equal(oldp^.resulttype,p^.resulttype) then
  1128. comment(v_debug,'resulttype fields are different but equal')
  1129. else
  1130. comment(v_warning,'resulttype fields are really different');
  1131. end;
  1132. if oldp^.treetype<>p^.treetype then
  1133. begin
  1134. comment(v_warning,'treetype field different');
  1135. error_found:=true;
  1136. end
  1137. else
  1138. comment(v_debug,' treetype '+tostr(longint(oldp^.treetype)));
  1139. if oldp^.error<>p^.error then
  1140. begin
  1141. comment(v_warning,'error field different');
  1142. error_found:=true;
  1143. end;
  1144. if oldp^.disposetyp<>p^.disposetyp then
  1145. begin
  1146. comment(v_warning,'disposetyp field different');
  1147. error_found:=true;
  1148. end;
  1149. { is true, if the right and left operand are swaped }
  1150. if oldp^.swaped<>p^.swaped then
  1151. begin
  1152. comment(v_warning,'swaped field different');
  1153. error_found:=true;
  1154. end;
  1155. { the location of the result of this node }
  1156. if oldp^.location.loc<>p^.location.loc then
  1157. begin
  1158. comment(v_warning,'location.loc field different');
  1159. error_found:=true;
  1160. end;
  1161. { the number of registers needed to evalute the node }
  1162. if oldp^.registers32<>p^.registers32 then
  1163. begin
  1164. comment(v_warning,'registers32 field different');
  1165. comment(v_warning,' old '+tostr(oldp^.registers32)+'<> new '+tostr(p^.registers32));
  1166. error_found:=true;
  1167. end;
  1168. if oldp^.registersfpu<>p^.registersfpu then
  1169. begin
  1170. comment(v_warning,'registersfpu field different');
  1171. error_found:=true;
  1172. end;
  1173. {$ifdef SUPPORT_MMX}
  1174. if oldp^.registersmmx<>p^.registersmmx then
  1175. begin
  1176. comment(v_warning,'registersmmx field different');
  1177. error_found:=true;
  1178. end;
  1179. {$endif SUPPORT_MMX}
  1180. if oldp^.left<>p^.left then
  1181. begin
  1182. comment(v_warning,'left field different');
  1183. error_found:=true;
  1184. end;
  1185. if oldp^.right<>p^.right then
  1186. begin
  1187. comment(v_warning,'right field different');
  1188. error_found:=true;
  1189. end;
  1190. if oldp^.fileinfo.line<>p^.fileinfo.line then
  1191. begin
  1192. comment(v_warning,'fileinfo.line field different');
  1193. error_found:=true;
  1194. end;
  1195. if oldp^.fileinfo.column<>p^.fileinfo.column then
  1196. begin
  1197. comment(v_warning,'fileinfo.column field different');
  1198. error_found:=true;
  1199. end;
  1200. if oldp^.fileinfo.fileindex<>p^.fileinfo.fileindex then
  1201. begin
  1202. comment(v_warning,'fileinfo.fileindex field different');
  1203. error_found:=true;
  1204. end;
  1205. if oldp^.localswitches<>p^.localswitches then
  1206. begin
  1207. comment(v_warning,'localswitches field different');
  1208. error_found:=true;
  1209. end;
  1210. {$ifdef extdebug}
  1211. if oldp^.firstpasscount<>p^.firstpasscount then
  1212. begin
  1213. comment(v_warning,'firstpasscount field different');
  1214. error_found:=true;
  1215. end;
  1216. {$endif extdebug}
  1217. if oldp^.treetype=p^.treetype then
  1218. case oldp^.treetype of
  1219. addn :
  1220. begin
  1221. if oldp^.use_strconcat<>p^.use_strconcat then
  1222. begin
  1223. comment(v_warning,'use_strconcat field different');
  1224. error_found:=true;
  1225. end;
  1226. if oldp^.string_typ<>p^.string_typ then
  1227. begin
  1228. comment(v_warning,'stringtyp field different');
  1229. error_found:=true;
  1230. end;
  1231. end;
  1232. callparan :
  1233. {(is_colon_para : boolean;exact_match_found : boolean);}
  1234. begin
  1235. if oldp^.is_colon_para<>p^.is_colon_para then
  1236. begin
  1237. comment(v_warning,'use_strconcat field different');
  1238. error_found:=true;
  1239. end;
  1240. if oldp^.exact_match_found<>p^.exact_match_found then
  1241. begin
  1242. comment(v_warning,'exact_match_found field different');
  1243. error_found:=true;
  1244. end;
  1245. end;
  1246. assignn :
  1247. {(assigntyp : tassigntyp;concat_string : boolean);}
  1248. begin
  1249. if oldp^.assigntyp<>p^.assigntyp then
  1250. begin
  1251. comment(v_warning,'assigntyp field different');
  1252. error_found:=true;
  1253. end;
  1254. if oldp^.concat_string<>p^.concat_string then
  1255. begin
  1256. comment(v_warning,'concat_string field different');
  1257. error_found:=true;
  1258. end;
  1259. end;
  1260. loadn :
  1261. {(symtableentry : psym;symtable : psymtable;
  1262. is_absolute,is_first : boolean);}
  1263. begin
  1264. if oldp^.symtableentry<>p^.symtableentry then
  1265. begin
  1266. comment(v_warning,'symtableentry field different');
  1267. error_found:=true;
  1268. end;
  1269. if oldp^.symtable<>p^.symtable then
  1270. begin
  1271. comment(v_warning,'symtable field different');
  1272. error_found:=true;
  1273. end;
  1274. if oldp^.is_absolute<>p^.is_absolute then
  1275. begin
  1276. comment(v_warning,'is_absolute field different');
  1277. error_found:=true;
  1278. end;
  1279. if oldp^.is_first<>p^.is_first then
  1280. begin
  1281. comment(v_warning,'is_first field different');
  1282. error_found:=true;
  1283. end;
  1284. end;
  1285. calln :
  1286. {(symtableprocentry : pprocsym;
  1287. symtableproc : psymtable;procdefinition : pprocdef;
  1288. methodpointer : ptree;
  1289. no_check,unit_specific : boolean);}
  1290. begin
  1291. if oldp^.symtableprocentry<>p^.symtableprocentry then
  1292. begin
  1293. comment(v_warning,'symtableprocentry field different');
  1294. error_found:=true;
  1295. end;
  1296. if oldp^.symtableproc<>p^.symtableproc then
  1297. begin
  1298. comment(v_warning,'symtableproc field different');
  1299. error_found:=true;
  1300. end;
  1301. if oldp^.procdefinition<>p^.procdefinition then
  1302. begin
  1303. comment(v_warning,'procdefinition field different');
  1304. error_found:=true;
  1305. end;
  1306. if oldp^.methodpointer<>p^.methodpointer then
  1307. begin
  1308. comment(v_warning,'methodpointer field different');
  1309. error_found:=true;
  1310. end;
  1311. if oldp^.no_check<>p^.no_check then
  1312. begin
  1313. comment(v_warning,'no_check field different');
  1314. error_found:=true;
  1315. end;
  1316. if oldp^.unit_specific<>p^.unit_specific then
  1317. begin
  1318. error_found:=true;
  1319. comment(v_warning,'unit_specific field different');
  1320. end;
  1321. end;
  1322. ordconstn :
  1323. begin
  1324. if oldp^.value<>p^.value then
  1325. begin
  1326. comment(v_warning,'value field different');
  1327. error_found:=true;
  1328. end;
  1329. end;
  1330. realconstn :
  1331. begin
  1332. if oldp^.value_real<>p^.value_real then
  1333. begin
  1334. comment(v_warning,'valued field different');
  1335. error_found:=true;
  1336. end;
  1337. if oldp^.lab_real<>p^.lab_real then
  1338. begin
  1339. comment(v_warning,'labnumber field different');
  1340. error_found:=true;
  1341. end;
  1342. if oldp^.realtyp<>p^.realtyp then
  1343. begin
  1344. comment(v_warning,'realtyp field different');
  1345. error_found:=true;
  1346. end;
  1347. end;
  1348. end;
  1349. if not error_found then
  1350. comment(v_warning,'did not find difference in trees');
  1351. end;
  1352. {$endif extdebug}
  1353. function equal_trees(t1,t2 : ptree) : boolean;
  1354. begin
  1355. if t1^.treetype=t2^.treetype then
  1356. begin
  1357. case t1^.treetype of
  1358. addn,
  1359. muln,
  1360. equaln,
  1361. orn,
  1362. xorn,
  1363. andn,
  1364. unequaln:
  1365. begin
  1366. equal_trees:=(equal_trees(t1^.left,t2^.left) and
  1367. equal_trees(t1^.right,t2^.right)) or
  1368. (equal_trees(t1^.right,t2^.left) and
  1369. equal_trees(t1^.left,t2^.right));
  1370. end;
  1371. subn,
  1372. divn,
  1373. modn,
  1374. assignn,
  1375. ltn,
  1376. lten,
  1377. gtn,
  1378. gten,
  1379. inn,
  1380. shrn,
  1381. shln,
  1382. slashn,
  1383. rangen:
  1384. begin
  1385. equal_trees:=(equal_trees(t1^.left,t2^.left) and
  1386. equal_trees(t1^.right,t2^.right));
  1387. end;
  1388. umminusn,
  1389. notn,
  1390. derefn,
  1391. addrn:
  1392. begin
  1393. equal_trees:=(equal_trees(t1^.left,t2^.left));
  1394. end;
  1395. loadn:
  1396. begin
  1397. equal_trees:=(t1^.symtableentry=t2^.symtableentry)
  1398. { not necessary
  1399. and (t1^.symtable=t2^.symtable)};
  1400. end;
  1401. {
  1402. subscriptn,
  1403. ordconstn,typeconvn,calln,callparan,
  1404. realconstn,asmn,vecn,
  1405. stringconstn,funcretn,selfn,
  1406. inlinen,niln,errorn,
  1407. typen,hnewn,hdisposen,newn,
  1408. disposen,setelen,setconstrn
  1409. }
  1410. else equal_trees:=false;
  1411. end;
  1412. end
  1413. else
  1414. equal_trees:=false;
  1415. end;
  1416. procedure set_unique(p : ptree);
  1417. begin
  1418. if assigned(p) then
  1419. begin
  1420. case p^.treetype of
  1421. vecn:
  1422. p^.callunique:=true;
  1423. typeconvn:
  1424. set_unique(p^.left);
  1425. end;
  1426. end;
  1427. end;
  1428. procedure clear_location(var loc : tlocation);
  1429. begin
  1430. if ((loc.loc=LOC_MEM) or (loc.loc=LOC_REFERENCE)) and
  1431. assigned(loc.reference.symbol) then
  1432. stringdispose(loc.reference.symbol);
  1433. loc.loc:=LOC_INVALID;
  1434. end;
  1435. {This is needed if you want to be able to delete the string with the nodes !!}
  1436. procedure set_location(var destloc,sourceloc : tlocation);
  1437. begin
  1438. if assigned(destloc.reference.symbol) then
  1439. stringdispose(destloc.reference.symbol);
  1440. destloc:= sourceloc;
  1441. if sourceloc.loc in [LOC_MEM,LOC_REFERENCE] then
  1442. begin
  1443. if assigned(sourceloc.reference.symbol) then
  1444. destloc.reference.symbol:=
  1445. stringdup(sourceloc.reference.symbol^);
  1446. end
  1447. else
  1448. destloc.reference.symbol:=nil;
  1449. end;
  1450. procedure swap_location(var destloc,sourceloc : tlocation);
  1451. var
  1452. swapl : tlocation;
  1453. begin
  1454. swapl := destloc;
  1455. destloc := sourceloc;
  1456. sourceloc := swapl;
  1457. end;
  1458. function get_ordinal_value(p : ptree) : longint;
  1459. begin
  1460. if p^.treetype=ordconstn then
  1461. get_ordinal_value:=p^.value
  1462. else
  1463. Message(type_e_ordinal_expr_expected);
  1464. end;
  1465. function is_constnode(p : ptree) : boolean;
  1466. begin
  1467. is_constnode:=(p^.treetype in [ordconstn,realconstn,stringconstn,fixconstn,setconstn]);
  1468. end;
  1469. function is_constintnode(p : ptree) : boolean;
  1470. begin
  1471. is_constintnode:=(p^.treetype=ordconstn) and is_integer(p^.resulttype);
  1472. end;
  1473. function is_constcharnode(p : ptree) : boolean;
  1474. begin
  1475. is_constcharnode:=((p^.treetype=ordconstn) and
  1476. (p^.resulttype^.deftype=orddef) and
  1477. (porddef(p^.resulttype)^.typ=uchar));
  1478. end;
  1479. function is_constrealnode(p : ptree) : boolean;
  1480. begin
  1481. is_constrealnode:=(p^.treetype=realconstn);
  1482. end;
  1483. function is_constboolnode(p : ptree) : boolean;
  1484. begin
  1485. is_constboolnode:=((p^.treetype=ordconstn) and
  1486. (p^.resulttype^.deftype=orddef) and
  1487. (porddef(p^.resulttype)^.typ in [bool8bit,bool16bit,bool32bit]));
  1488. end;
  1489. function str_length(p : ptree) : longint;
  1490. begin
  1491. str_length:=p^.length;
  1492. end;
  1493. function is_emptyset(p : ptree):boolean;
  1494. {
  1495. return true if set s is empty
  1496. }
  1497. var
  1498. i : longint;
  1499. begin
  1500. i:=0;
  1501. if p^.treetype=setconstn then
  1502. begin
  1503. while (i<32) and (p^.value_set^[i]=0) do
  1504. inc(i);
  1505. end;
  1506. is_emptyset:=(i=32);
  1507. end;
  1508. end.
  1509. {
  1510. $Log$
  1511. Revision 1.64 1999-01-27 12:57:22 pierre
  1512. * memory leaks with hightree solved by adding a new disposetyp
  1513. dt_leftrighthigh
  1514. Revision 1.63 1999/01/27 00:14:00 florian
  1515. * "procedure of object"-stuff fixed
  1516. Revision 1.62 1999/01/21 22:10:52 peter
  1517. * fixed array of const
  1518. * generic platform independent high() support
  1519. Revision 1.61 1999/01/21 16:41:09 pierre
  1520. * fix for constructor inside with statements
  1521. Revision 1.60 1998/12/15 11:52:19 peter
  1522. * fixed dup release of statement label in case
  1523. Revision 1.59 1998/12/15 10:23:32 peter
  1524. + -iSO, -iSP, -iTO, -iTP
  1525. Revision 1.58 1998/12/11 00:04:02 peter
  1526. + globtype,tokens,version unit splitted from globals
  1527. Revision 1.57 1998/12/04 10:18:13 florian
  1528. * some stuff for procedures of object added
  1529. * bug with overridden virtual constructors fixed (reported by Italo Gomes)
  1530. Revision 1.56 1998/12/02 16:23:32 jonas
  1531. * changed "if longintvar in set" to case or "if () or () .." statements
  1532. * tree.pas: changed inlinenumber (and associated constructor/vars) to a byte
  1533. Revision 1.55 1998/11/29 12:40:20 peter
  1534. * newcnv -> not oldcnv
  1535. Revision 1.54 1998/11/26 13:10:44 peter
  1536. * new int - int conversion -dNEWCNV
  1537. * some function renamings
  1538. Revision 1.53 1998/11/24 12:52:42 peter
  1539. * sets are not written twice anymore
  1540. * optimize for emptyset+single element which uses a new routine from
  1541. set.inc FPC_SET_CREATE_ELEMENT
  1542. Revision 1.52 1998/11/23 17:51:58 pierre
  1543. * added checking before dispose of reference string
  1544. Revision 1.51 1998/11/13 10:15:53 peter
  1545. * fixed ptr() with constants
  1546. Revision 1.50 1998/11/10 10:09:20 peter
  1547. * va_list -> array of const
  1548. Revision 1.49 1998/11/05 12:03:07 peter
  1549. * released useansistring
  1550. * removed -Sv, its now available in fpc modes
  1551. Revision 1.48 1998/10/21 15:12:59 pierre
  1552. * bug fix for IOCHECK inside a procedure with iocheck modifier
  1553. * removed the GPF for unexistant overloading
  1554. (firstcall was called with procedinition=nil !)
  1555. * changed typen to what Florian proposed
  1556. gentypenode(p : pdef) sets the typenodetype field
  1557. and resulttype is only set if inside bt_type block !
  1558. Revision 1.47 1998/10/20 08:07:07 pierre
  1559. * several memory corruptions due to double freemem solved
  1560. => never use p^.loc.location:=p^.left^.loc.location;
  1561. + finally I added now by default
  1562. that ra386dir translates global and unit symbols
  1563. + added a first field in tsymtable and
  1564. a nextsym field in tsym
  1565. (this allows to obtain ordered type info for
  1566. records and objects in gdb !)
  1567. Revision 1.46 1998/10/08 17:17:37 pierre
  1568. * current_module old scanner tagged as invalid if unit is recompiled
  1569. + added ppheap for better info on tracegetmem of heaptrc
  1570. (adds line column and file index)
  1571. * several memory leaks removed ith help of heaptrc !!
  1572. Revision 1.45 1998/10/05 21:33:33 peter
  1573. * fixed 161,165,166,167,168
  1574. Revision 1.44 1998/09/28 16:57:28 pierre
  1575. * changed all length(p^.value_str^) into str_length(p)
  1576. to get it work with and without ansistrings
  1577. * changed sourcefiles field of tmodule to a pointer
  1578. Revision 1.43 1998/09/27 10:16:28 florian
  1579. * type casts pchar<->ansistring fixed
  1580. * ansistring[..] calls does now an unique call
  1581. Revision 1.42 1998/09/23 12:03:59 peter
  1582. * overloading fix for array of const
  1583. Revision 1.41 1998/09/23 09:58:55 peter
  1584. * first working array of const things
  1585. Revision 1.40 1998/09/22 15:34:07 peter
  1586. + pchar -> string conversion
  1587. Revision 1.39 1998/09/21 08:45:27 pierre
  1588. + added vmt_offset in tobjectdef.write for fututre use
  1589. (first steps to have objects without vmt if no virtual !!)
  1590. + added fpu_used field for tabstractprocdef :
  1591. sets this level to 2 if the functions return with value in FPU
  1592. (is then set to correct value at parsing of implementation)
  1593. THIS MIGHT refuse some code with FPU expression too complex
  1594. that were accepted before and even in some cases
  1595. that don't overflow in fact
  1596. ( like if f : float; is a forward that finally in implementation
  1597. only uses one fpu register !!)
  1598. Nevertheless I think that it will improve security on
  1599. FPU operations !!
  1600. * most other changes only for UseBrowser code
  1601. (added symtable references for record and objects)
  1602. local switch for refs to args and local of each function
  1603. (static symtable still missing)
  1604. UseBrowser still not stable and probably broken by
  1605. the definition hash array !!
  1606. Revision 1.38 1998/09/16 01:06:47 carl
  1607. * crash bugfix in firstaddr
  1608. Revision 1.37 1998/09/08 10:38:04 pierre
  1609. * some variable fields inside conditionnal were not updated
  1610. Revision 1.36 1998/09/07 18:46:17 peter
  1611. * update smartlinking, uses getdatalabel
  1612. * renamed ptree.value vars to value_str,value_real,value_set
  1613. Revision 1.35 1998/09/04 08:42:11 peter
  1614. * updated some error messages
  1615. Revision 1.34 1998/09/01 17:39:54 peter
  1616. + internal constant functions
  1617. Revision 1.33 1998/08/28 12:51:44 florian
  1618. + ansistring to pchar type cast fixed
  1619. Revision 1.32 1998/08/28 10:54:25 peter
  1620. * fixed smallset generation from elements, it has never worked before!
  1621. Revision 1.31 1998/08/21 14:08:58 pierre
  1622. + TEST_FUNCRET now default (old code removed)
  1623. works also for m68k (at least compiles)
  1624. Revision 1.30 1998/08/18 09:24:47 pierre
  1625. * small warning position bug fixed
  1626. * support_mmx switches splitting was missing
  1627. * rhide error and warning output corrected
  1628. Revision 1.29 1998/08/14 18:18:48 peter
  1629. + dynamic set contruction
  1630. * smallsets are now working (always longint size)
  1631. Revision 1.28 1998/08/13 11:00:13 peter
  1632. * fixed procedure<>procedure construct
  1633. Revision 1.27 1998/08/10 14:50:35 peter
  1634. + localswitches, moduleswitches, globalswitches splitting
  1635. Revision 1.26 1998/08/10 09:57:19 peter
  1636. - Remove InitTree which was empty and obsolete
  1637. Revision 1.25 1998/08/02 16:42:02 florian
  1638. * on o : tobject do should also work now, the exceptsymtable shouldn't be
  1639. disposed by dellexlevel
  1640. Revision 1.24 1998/07/30 11:18:23 florian
  1641. + first implementation of try ... except on .. do end;
  1642. * limitiation of 65535 bytes parameters for cdecl removed
  1643. Revision 1.23 1998/07/24 22:17:01 florian
  1644. * internal error 10 together with array access fixed. I hope
  1645. that's the final fix.
  1646. Revision 1.22 1998/07/20 10:23:05 florian
  1647. * better ansi string assignement
  1648. Revision 1.21 1998/07/14 21:46:56 peter
  1649. * updated messages file
  1650. Revision 1.20 1998/07/14 14:47:11 peter
  1651. * released NEWINPUT
  1652. Revision 1.19 1998/07/08 14:56:53 daniel
  1653. * Fixed $ifdef TP.
  1654. Revision 1.18 1998/07/07 11:20:18 peter
  1655. + NEWINPUT for a better inputfile and scanner object
  1656. Revision 1.17 1998/06/22 08:59:03 daniel
  1657. - Removed pool of nodes.
  1658. Revision 1.16 1998/06/12 14:50:49 peter
  1659. * removed the tree dependency to types.pas
  1660. * long_fil.pas support (not fully tested yet)
  1661. Revision 1.15 1998/06/06 08:39:07 peter
  1662. * it needs types
  1663. Revision 1.14 1998/06/05 14:37:40 pierre
  1664. * fixes for inline for operators
  1665. * inline procedure more correctly restricted
  1666. Revision 1.13 1998/06/04 09:55:49 pierre
  1667. * demangled name of procsym reworked to become independant of the mangling scheme
  1668. Revision 1.12 1998/06/03 22:49:06 peter
  1669. + wordbool,longbool
  1670. * rename bis,von -> high,low
  1671. * moved some systemunit loading/creating to psystem.pas
  1672. Revision 1.10 1998/05/20 09:42:38 pierre
  1673. + UseTokenInfo now default
  1674. * unit in interface uses and implementation uses gives error now
  1675. * only one error for unknown symbol (uses lastsymknown boolean)
  1676. the problem came from the label code !
  1677. + first inlined procedures and function work
  1678. (warning there might be allowed cases were the result is still wrong !!)
  1679. * UseBrower updated gives a global list of all position of all used symbols
  1680. with switch -gb
  1681. Revision 1.9 1998/05/12 10:47:00 peter
  1682. * moved printstatus to verb_def
  1683. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1684. prefix like error: warning: and is included in V_Default
  1685. * fixed some messages
  1686. * first time parameter scan is only for -v and -T
  1687. - removed old style messages
  1688. Revision 1.8 1998/05/07 00:17:01 peter
  1689. * smartlinking for sets
  1690. + consts labels are now concated/generated in hcodegen
  1691. * moved some cpu code to cga and some none cpu depended code from cga
  1692. to tree and hcodegen and cleanup of hcodegen
  1693. * assembling .. output reduced for smartlinking ;)
  1694. Revision 1.7 1998/05/06 15:04:21 pierre
  1695. + when trying to find source files of a ppufile
  1696. check the includepathlist for included files
  1697. the main file must still be in the same directory
  1698. Revision 1.6 1998/05/06 08:38:52 pierre
  1699. * better position info with UseTokenInfo
  1700. UseTokenInfo greatly simplified
  1701. + added check for changed tree after first time firstpass
  1702. (if we could remove all the cases were it happen
  1703. we could skip all firstpass if firstpasscount > 1)
  1704. Only with ExtDebug
  1705. Revision 1.5 1998/04/30 15:59:43 pierre
  1706. * GDB works again better :
  1707. correct type info in one pass
  1708. + UseTokenInfo for better source position
  1709. * fixed one remaining bug in scanner for line counts
  1710. * several little fixes
  1711. Revision 1.4 1998/04/29 10:34:08 pierre
  1712. + added some code for ansistring (not complete nor working yet)
  1713. * corrected operator overloading
  1714. * corrected nasm output
  1715. + started inline procedures
  1716. + added starstarn : use ** for exponentiation (^ gave problems)
  1717. + started UseTokenInfo cond to get accurate positions
  1718. Revision 1.3 1998/04/21 10:16:49 peter
  1719. * patches from strasbourg
  1720. * objects is not used anymore in the fpc compiled version
  1721. Revision 1.2 1998/04/07 22:45:05 florian
  1722. * bug0092, bug0115 and bug0121 fixed
  1723. + packed object/class/array
  1724. }