tree.pas 62 KB

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