parser.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit does the parsing process
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit parser;
  19. {$i fpcdefs.inc}
  20. interface
  21. {$ifdef PREPROCWRITE}
  22. procedure preprocess(const filename:string);
  23. {$endif PREPROCWRITE}
  24. procedure compile(const filename:string);
  25. procedure initparser;
  26. procedure doneparser;
  27. implementation
  28. uses
  29. cutils,cclasses,
  30. globtype,version,tokens,systems,globals,verbose,
  31. symbase,symtable,symdef,symsym,
  32. finput,fmodule,fppu,
  33. aasmbase,aasmtai,
  34. cpubase,cgbase,
  35. script,gendef,
  36. {$ifdef BrowserLog}
  37. browlog,
  38. {$endif BrowserLog}
  39. {$ifdef UseExcept}
  40. tpexcept,
  41. {$endif UseExcept}
  42. {$ifdef GDB}
  43. gdb,
  44. {$endif GDB}
  45. comphook,
  46. scanner,scandir,
  47. pbase,ptype,psystem,pmodules,psub,cresstr,cpuinfo;
  48. procedure initparser;
  49. begin
  50. { ^M means a string or a char, because we don't parse a }
  51. { type declaration }
  52. ignore_equal:=false;
  53. { we didn't parse a object or class declaration }
  54. { and no function header }
  55. testcurobject:=0;
  56. { Current compiled module/proc }
  57. objectlibrary:=nil;
  58. current_module:=nil;
  59. compiled_module:=nil;
  60. current_procinfo:=nil;
  61. loaded_units:=TLinkedList.Create;
  62. usedunits:=TLinkedList.Create;
  63. { global switches }
  64. aktglobalswitches:=initglobalswitches;
  65. aktsourcecodepage:=initsourcecodepage;
  66. { initialize scanner }
  67. InitScanner;
  68. InitScannerDirectives;
  69. { scanner }
  70. c:=#0;
  71. pattern:='';
  72. orgpattern:='';
  73. current_scanner:=nil;
  74. { register all nodes and tais }
  75. registernodes;
  76. registertais;
  77. { memory sizes }
  78. if heapsize=0 then
  79. heapsize:=target_info.heapsize;
  80. if stacksize=0 then
  81. stacksize:=target_info.stacksize;
  82. { open assembler response }
  83. if cs_link_on_target in aktglobalswitches then
  84. GenerateAsmRes(outputexedir+inputfile+'_ppas')
  85. else
  86. GenerateAsmRes(outputexedir+'ppas');
  87. { open deffile }
  88. DefFile:=TDefFile.Create(outputexedir+inputfile+target_info.defext);
  89. { list of generated .o files, so the linker can remove them }
  90. SmartLinkOFiles:=TStringList.Create;
  91. { codegen }
  92. if paraprintnodetree<>0 then
  93. printnode_reset;
  94. end;
  95. procedure doneparser;
  96. begin
  97. { unload units }
  98. loaded_units.free;
  99. usedunits.free;
  100. { if there was an error in the scanner, the scanner is
  101. still assinged }
  102. if assigned(current_scanner) then
  103. begin
  104. current_scanner.free;
  105. current_scanner:=nil;
  106. end;
  107. { close scanner }
  108. DoneScanner;
  109. { close ppas,deffile }
  110. asmres.free;
  111. deffile.free;
  112. { free list of .o files }
  113. SmartLinkOFiles.Free;
  114. end;
  115. procedure default_macros;
  116. var
  117. hp : tstringlistitem;
  118. begin
  119. { commandline }
  120. hp:=tstringlistitem(initdefines.first);
  121. while assigned(hp) do
  122. begin
  123. current_scanner.def_macro(hp.str);
  124. hp:=tstringlistitem(hp.next);
  125. end;
  126. { set macros for version checking }
  127. current_scanner.set_macro('FPC_VERSION',version_nr);
  128. current_scanner.set_macro('FPC_RELEASE',release_nr);
  129. current_scanner.set_macro('FPC_PATCH',patch_nr);
  130. end;
  131. {$ifdef PREPROCWRITE}
  132. procedure preprocess(const filename:string);
  133. var
  134. i : longint;
  135. begin
  136. new(preprocfile,init('pre'));
  137. { default macros }
  138. current_scanner^.macros:=new(pdictionary,init);
  139. default_macros;
  140. { initialize a module }
  141. current_module:=new(pmodule,init(filename,false));
  142. main_module:=current_module;
  143. { startup scanner, and save in current_module }
  144. current_scanner:=new(pscannerfile,Init(filename));
  145. current_module.scanner:=current_scanner;
  146. { loop until EOF is found }
  147. repeat
  148. current_scanner^.readtoken;
  149. preprocfile^.AddSpace;
  150. case token of
  151. _ID :
  152. begin
  153. preprocfile^.Add(orgpattern);
  154. end;
  155. _REALNUMBER,
  156. _INTCONST :
  157. preprocfile^.Add(pattern);
  158. _CSTRING :
  159. begin
  160. i:=0;
  161. while (i<length(pattern)) do
  162. begin
  163. inc(i);
  164. if pattern[i]='''' then
  165. begin
  166. insert('''',pattern,i);
  167. inc(i);
  168. end;
  169. end;
  170. preprocfile^.Add(''''+pattern+'''');
  171. end;
  172. _CCHAR :
  173. begin
  174. case pattern[1] of
  175. #39 :
  176. pattern:='''''''';
  177. #0..#31,
  178. #128..#255 :
  179. begin
  180. str(ord(pattern[1]),pattern);
  181. pattern:='#'+pattern;
  182. end;
  183. else
  184. pattern:=''''+pattern[1]+'''';
  185. end;
  186. preprocfile^.Add(pattern);
  187. end;
  188. _EOF :
  189. break;
  190. else
  191. preprocfile^.Add(tokeninfo^[token].str)
  192. end;
  193. until false;
  194. { free scanner }
  195. dispose(current_scanner,done);
  196. current_scanner:=nil;
  197. { close }
  198. dispose(preprocfile,done);
  199. end;
  200. {$endif PREPROCWRITE}
  201. procedure compile(const filename:string);
  202. type
  203. polddata=^tolddata;
  204. tolddata=record
  205. { scanner }
  206. oldidtoken,
  207. oldtoken : ttoken;
  208. oldtokenpos : tfileposinfo;
  209. oldc : char;
  210. oldpattern,
  211. oldorgpattern : string;
  212. old_block_type : tblock_type;
  213. { symtable }
  214. oldrefsymtable,
  215. olddefaultsymtablestack,
  216. oldsymtablestack : tsymtable;
  217. oldaktprocsym : tprocsym;
  218. oldoverloaded_operators : toverloaded_operators;
  219. { cg }
  220. oldparse_only : boolean;
  221. { asmlists }
  222. oldimports,
  223. oldexports,
  224. oldresource,
  225. oldrttilist,
  226. oldresourcestringlist,
  227. oldbsssegment,
  228. olddatasegment,
  229. oldcodesegment,
  230. oldexprasmlist,
  231. olddebuglist,
  232. oldwithdebuglist,
  233. oldconsts : taasmoutput;
  234. oldobjectlibrary : tasmlibrarydata;
  235. { resourcestrings }
  236. OldResourceStrings : tResourceStrings;
  237. { akt.. things }
  238. oldaktlocalswitches : tlocalswitches;
  239. oldaktmoduleswitches : tmoduleswitches;
  240. oldaktfilepos : tfileposinfo;
  241. oldaktpackenum,oldaktmaxfpuregisters : longint;
  242. oldaktalignment : talignmentinfo;
  243. oldaktoutputformat : tasm;
  244. oldaktspecificoptprocessor,
  245. oldaktoptprocessor : tprocessors;
  246. oldaktfputype : tfputype;
  247. oldaktasmmode : tasmmode;
  248. oldaktinterfacetype: tinterfacetypes;
  249. oldaktmodeswitches : tmodeswitches;
  250. old_compiled_module : tmodule;
  251. oldcurrent_procinfo : tprocinfo;
  252. oldaktdefproccall : tproccalloption;
  253. oldsourcecodepage : tcodepagestring;
  254. {$ifdef GDB}
  255. store_dbx : plongint;
  256. {$endif GDB}
  257. end;
  258. var
  259. olddata : polddata;
  260. {$ifdef USEEXCEPT}
  261. {$ifndef Delphi}
  262. recoverpos : jmp_buf;
  263. oldrecoverpos : pjmp_buf;
  264. {$endif Delphi}
  265. {$endif useexcept}
  266. begin
  267. inc(compile_level);
  268. parser_current_file:=filename;
  269. { Uses heap memory instead of placing everything on the
  270. stack. This is needed because compile() can be called
  271. recursively }
  272. new(olddata);
  273. with olddata^ do
  274. begin
  275. old_compiled_module:=compiled_module;
  276. { save symtable state }
  277. oldsymtablestack:=symtablestack;
  278. olddefaultsymtablestack:=defaultsymtablestack;
  279. oldrefsymtable:=refsymtable;
  280. oldcurrent_procinfo:=current_procinfo;
  281. oldaktdefproccall:=aktdefproccall;
  282. move(overloaded_operators,oldoverloaded_operators,sizeof(toverloaded_operators));
  283. { save scanner state }
  284. oldc:=c;
  285. oldpattern:=pattern;
  286. oldorgpattern:=orgpattern;
  287. oldtoken:=token;
  288. oldidtoken:=idtoken;
  289. old_block_type:=block_type;
  290. oldtokenpos:=akttokenpos;
  291. oldsourcecodepage:=aktsourcecodepage;
  292. { save cg }
  293. oldparse_only:=parse_only;
  294. { save assembler lists }
  295. olddatasegment:=datasegment;
  296. oldbsssegment:=bsssegment;
  297. oldcodesegment:=codesegment;
  298. olddebuglist:=debuglist;
  299. oldwithdebuglist:=withdebuglist;
  300. oldconsts:=consts;
  301. oldrttilist:=rttilist;
  302. oldexprasmlist:=exprasmlist;
  303. oldimports:=importssection;
  304. oldexports:=exportssection;
  305. oldresource:=resourcesection;
  306. oldresourcestringlist:=resourcestringlist;
  307. oldobjectlibrary:=objectlibrary;
  308. OldResourceStrings:=ResourceStrings;
  309. { save akt... state }
  310. { handle the postponed case first }
  311. if localswitcheschanged then
  312. begin
  313. aktlocalswitches:=nextaktlocalswitches;
  314. localswitcheschanged:=false;
  315. end;
  316. oldaktlocalswitches:=aktlocalswitches;
  317. oldaktmoduleswitches:=aktmoduleswitches;
  318. oldaktalignment:=aktalignment;
  319. oldaktpackenum:=aktpackenum;
  320. oldaktfputype:=aktfputype;
  321. oldaktmaxfpuregisters:=aktmaxfpuregisters;
  322. oldaktoutputformat:=aktoutputformat;
  323. oldaktoptprocessor:=aktoptprocessor;
  324. oldaktspecificoptprocessor:=aktspecificoptprocessor;
  325. oldaktasmmode:=aktasmmode;
  326. oldaktinterfacetype:=aktinterfacetype;
  327. oldaktfilepos:=aktfilepos;
  328. oldaktmodeswitches:=aktmodeswitches;
  329. {$ifdef GDB}
  330. store_dbx:=dbx_counter;
  331. dbx_counter:=nil;
  332. {$endif GDB}
  333. end;
  334. { show info }
  335. Message1(parser_i_compiling,filename);
  336. { reset symtable }
  337. symtablestack:=nil;
  338. defaultsymtablestack:=nil;
  339. systemunit:=nil;
  340. refsymtable:=nil;
  341. aktdefproccall:=initdefproccall;
  342. registerdef:=true;
  343. aktexceptblock:=0;
  344. exceptblockcounter:=0;
  345. aktmaxfpuregisters:=-1;
  346. fillchar(overloaded_operators,sizeof(toverloaded_operators),0);
  347. { reset the unit or create a new program }
  348. if not assigned(current_module) then
  349. begin
  350. current_module:=tppumodule.create(nil,filename,'',false);
  351. main_module:=current_module;
  352. current_module.state:=ms_compile;
  353. end;
  354. if not(current_module.state in [ms_compile,ms_second_compile]) then
  355. internalerror(200212281);
  356. { a unit compiled at command line must be inside the loaded_unit list }
  357. if (compile_level=1) then
  358. loaded_units.insert(current_module);
  359. { Set the module to use for verbose }
  360. compiled_module:=current_module;
  361. SetCompileModule(current_module);
  362. Fillchar(aktfilepos,0,sizeof(aktfilepos));
  363. { Load current state from the init values }
  364. aktlocalswitches:=initlocalswitches;
  365. aktmoduleswitches:=initmoduleswitches;
  366. aktmodeswitches:=initmodeswitches;
  367. {$IFDEF Testvarsets}
  368. aktsetalloc:=initsetalloc;
  369. {$ENDIF}
  370. aktalignment:=initalignment;
  371. aktfputype:=initfputype;
  372. aktpackenum:=initpackenum;
  373. aktoutputformat:=initoutputformat;
  374. set_target_asm(aktoutputformat);
  375. aktoptprocessor:=initoptprocessor;
  376. aktspecificoptprocessor:=initspecificoptprocessor;
  377. aktasmmode:=initasmmode;
  378. aktinterfacetype:=initinterfacetype;
  379. { startup scanner and load the first file }
  380. current_scanner:=tscannerfile.Create(filename);
  381. current_scanner.firstfile;
  382. current_module.scanner:=current_scanner;
  383. { macros }
  384. default_macros;
  385. { read the first token }
  386. current_scanner.readtoken;
  387. { init code generator for a new module }
  388. codegen_newmodule;
  389. { If the compile level > 1 we get a nice "unit expected" error
  390. message if we are trying to use a program as unit.}
  391. {$ifdef USEEXCEPT}
  392. if setjmp(recoverpos)=0 then
  393. begin
  394. oldrecoverpos:=recoverpospointer;
  395. recoverpospointer:=@recoverpos;
  396. {$endif USEEXCEPT}
  397. if (token=_UNIT) or (compile_level>1) then
  398. begin
  399. current_module.is_unit:=true;
  400. proc_unit;
  401. end
  402. else
  403. proc_program(token=_LIBRARY);
  404. {$ifdef USEEXCEPT}
  405. recoverpospointer:=oldrecoverpos;
  406. end
  407. else
  408. begin
  409. recoverpospointer:=oldrecoverpos;
  410. longjump_used:=true;
  411. end;
  412. {$endif USEEXCEPT}
  413. { clear memory }
  414. {$ifdef Splitheap}
  415. if testsplit then
  416. begin
  417. { temp heap should be empty after that !!!}
  418. codegen_donemodule;
  419. Releasetempheap;
  420. end;
  421. {$endif Splitheap}
  422. { restore old state, close trees, > 0.99.5 has heapblocks, so
  423. it's the default to release the trees }
  424. codegen_donemodule;
  425. if assigned(current_module) then
  426. begin
  427. { free ppu }
  428. if assigned(tppumodule(current_module).ppufile) then
  429. begin
  430. tppumodule(current_module).ppufile.free;
  431. tppumodule(current_module).ppufile:=nil;
  432. end;
  433. { free scanner }
  434. if assigned(current_module.scanner) then
  435. begin
  436. if current_scanner=tscannerfile(current_module.scanner) then
  437. current_scanner:=nil;
  438. tscannerfile(current_module.scanner).free;
  439. current_module.scanner:=nil;
  440. end;
  441. end;
  442. if (compile_level>1) then
  443. begin
  444. with olddata^ do
  445. begin
  446. { restore scanner }
  447. c:=oldc;
  448. pattern:=oldpattern;
  449. orgpattern:=oldorgpattern;
  450. token:=oldtoken;
  451. idtoken:=oldidtoken;
  452. akttokenpos:=oldtokenpos;
  453. block_type:=old_block_type;
  454. { restore cg }
  455. parse_only:=oldparse_only;
  456. { restore asmlists }
  457. exprasmlist:=oldexprasmlist;
  458. datasegment:=olddatasegment;
  459. bsssegment:=oldbsssegment;
  460. codesegment:=oldcodesegment;
  461. consts:=oldconsts;
  462. debuglist:=olddebuglist;
  463. withdebuglist:=oldwithdebuglist;
  464. importssection:=oldimports;
  465. exportssection:=oldexports;
  466. resourcesection:=oldresource;
  467. rttilist:=oldrttilist;
  468. resourcestringlist:=oldresourcestringlist;
  469. { object data }
  470. ResourceStrings:=OldResourceStrings;
  471. objectlibrary:=oldobjectlibrary;
  472. { restore previous scanner }
  473. if assigned(old_compiled_module) then
  474. current_scanner:=tscannerfile(old_compiled_module.scanner)
  475. else
  476. current_scanner:=nil;
  477. if assigned(current_scanner) then
  478. parser_current_file:=current_scanner.inputfile.name^;
  479. { restore symtable state }
  480. refsymtable:=oldrefsymtable;
  481. symtablestack:=oldsymtablestack;
  482. defaultsymtablestack:=olddefaultsymtablestack;
  483. aktdefproccall:=oldaktdefproccall;
  484. current_procinfo:=oldcurrent_procinfo;
  485. move(oldoverloaded_operators,overloaded_operators,sizeof(toverloaded_operators));
  486. aktsourcecodepage:=oldsourcecodepage;
  487. aktlocalswitches:=oldaktlocalswitches;
  488. aktmoduleswitches:=oldaktmoduleswitches;
  489. aktalignment:=oldaktalignment;
  490. aktpackenum:=oldaktpackenum;
  491. aktmaxfpuregisters:=oldaktmaxfpuregisters;
  492. aktoutputformat:=oldaktoutputformat;
  493. set_target_asm(aktoutputformat);
  494. aktoptprocessor:=oldaktoptprocessor;
  495. aktspecificoptprocessor:=oldaktspecificoptprocessor;
  496. aktfputype:=oldaktfputype;
  497. aktasmmode:=oldaktasmmode;
  498. aktinterfacetype:=oldaktinterfacetype;
  499. aktfilepos:=oldaktfilepos;
  500. aktmodeswitches:=oldaktmodeswitches;
  501. aktexceptblock:=0;
  502. exceptblockcounter:=0;
  503. {$ifdef GDB}
  504. dbx_counter:=store_dbx;
  505. {$endif GDB}
  506. end;
  507. end
  508. else
  509. begin
  510. parser_current_file:='';
  511. { Shut down things when the last file is compiled }
  512. if (compile_level=1) then
  513. begin
  514. { Close script }
  515. if (not AsmRes.Empty) then
  516. begin
  517. Message1(exec_i_closing_script,AsmRes.Fn);
  518. AsmRes.WriteToDisk;
  519. end;
  520. {$ifdef USEEXCEPT}
  521. if not longjump_used then
  522. {$endif USEEXCEPT}
  523. begin
  524. { do not create browsers on errors !! }
  525. if status.errorcount=0 then
  526. begin
  527. {$ifdef BrowserLog}
  528. { Write Browser Log }
  529. if (cs_browser_log in aktglobalswitches) and
  530. (cs_browser in aktmoduleswitches) then
  531. begin
  532. if browserlog.elements_to_list.empty then
  533. begin
  534. Message1(parser_i_writing_browser_log,browserlog.Fname);
  535. WriteBrowserLog;
  536. end
  537. else
  538. browserlog.list_elements;
  539. end;
  540. {$endif BrowserLog}
  541. { Write Browser Collections }
  542. do_extractsymbolinfo{$ifdef FPC}(){$endif};
  543. end;
  544. end;
  545. {$ifdef dummy}
  546. if current_module.in_second_compile then
  547. begin
  548. current_module.in_second_compile:=false;
  549. current_module.in_compile:=true;
  550. end
  551. else
  552. current_module.in_compile:=false;
  553. {$endif dummy}
  554. end;
  555. end;
  556. dec(compile_level);
  557. compiled_module:=olddata^.old_compiled_module;
  558. dispose(olddata);
  559. {$ifdef USEEXCEPT}
  560. if longjump_used then
  561. longjmp(recoverpospointer^,1);
  562. {$endif USEEXCEPT}
  563. end;
  564. end.
  565. {
  566. $Log$
  567. Revision 1.56 2003-09-03 11:18:37 florian
  568. * fixed arm concatcopy
  569. + arm support in the common compiler sources added
  570. * moved some generic cg code around
  571. + tfputype added
  572. * ...
  573. Revision 1.55 2003/06/13 21:19:30 peter
  574. * current_procdef removed, use current_procinfo.procdef instead
  575. Revision 1.54 2003/06/12 16:41:51 peter
  576. * add inputfile prefix to ppas/link.res
  577. Revision 1.53 2003/05/15 18:58:53 peter
  578. * removed selfpointer_offset, vmtpointer_offset
  579. * tvarsym.adjusted_address
  580. * address in localsymtable is now in the real direction
  581. * removed some obsolete globals
  582. Revision 1.52 2003/04/27 11:21:33 peter
  583. * aktprocdef renamed to current_procinfo.procdef
  584. * procinfo renamed to current_procinfo
  585. * procinfo will now be stored in current_module so it can be
  586. cleaned up properly
  587. * gen_main_procsym changed to create_main_proc and release_main_proc
  588. to also generate a tprocinfo structure
  589. * fixed unit implicit initfinal
  590. Revision 1.51 2003/04/27 07:29:50 peter
  591. * current_procinfo.procdef cleanup, current_procdef is now always nil when parsing
  592. a new procdef declaration
  593. * aktprocsym removed
  594. * lexlevel removed, use symtable.symtablelevel instead
  595. * implicit init/final code uses the normal genentry/genexit
  596. * funcret state checking updated for new funcret handling
  597. Revision 1.50 2003/04/26 00:30:52 peter
  598. * reset aktfilepos when setting new module for compile
  599. Revision 1.49 2003/04/25 20:59:33 peter
  600. * removed funcretn,funcretsym, function result is now in varsym
  601. and aliases for result and function name are added using absolutesym
  602. * vs_hidden parameter for funcret passed in parameter
  603. * vs_hidden fixes
  604. * writenode changed to printnode and released from extdebug
  605. * -vp option added to generate a tree.log with the nodetree
  606. * nicer printnode for statements, callnode
  607. Revision 1.48 2002/12/29 14:57:50 peter
  608. * unit loading changed to first register units and load them
  609. afterwards. This is needed to support uses xxx in yyy correctly
  610. * unit dependency check fixed
  611. Revision 1.47 2002/12/24 23:32:19 peter
  612. * fixed crash when old_compiled_module was nil
  613. Revision 1.46 2002/11/20 12:36:24 mazen
  614. * $UNITPATH directive is now working
  615. Revision 1.45 2002/10/07 19:29:52 peter
  616. * Place old data in compile() in the heap to save stack
  617. Revision 1.44 2002/09/05 19:27:06 peter
  618. * fixed crash when current_module becomes nil
  619. Revision 1.43 2002/08/18 19:58:28 peter
  620. * more current_scanner fixes
  621. Revision 1.42 2002/08/16 15:31:08 peter
  622. * fixed possible crashes with current_scanner
  623. Revision 1.41 2002/08/15 19:10:35 peter
  624. * first things tai,tnode storing in ppu
  625. Revision 1.40 2002/08/12 16:46:04 peter
  626. * tscannerfile is now destroyed in tmodule.reset and current_scanner
  627. is updated accordingly. This removes all the loading and saving of
  628. the old scanner and the invalid flag marking
  629. Revision 1.39 2002/08/12 15:08:40 carl
  630. + stab register indexes for powerpc (moved from gdb to cpubase)
  631. + tprocessor enumeration moved to cpuinfo
  632. + linker in target_info is now a class
  633. * many many updates for m68k (will soon start to compile)
  634. - removed some ifdef or correct them for correct cpu
  635. Revision 1.38 2002/08/11 14:28:19 peter
  636. * TScannerFile.SetInvalid added that will also reset inputfile
  637. Revision 1.37 2002/08/11 13:24:12 peter
  638. * saving of asmsymbols in ppu supported
  639. * asmsymbollist global is removed and moved into a new class
  640. tasmlibrarydata that will hold the info of a .a file which
  641. corresponds with a single module. Added librarydata to tmodule
  642. to keep the library info stored for the module. In the future the
  643. objectfiles will also be stored to the tasmlibrarydata class
  644. * all getlabel/newasmsymbol and friends are moved to the new class
  645. Revision 1.36 2002/08/09 19:15:41 carl
  646. - removed newcg define
  647. Revision 1.35 2002/07/20 17:16:03 florian
  648. + source code page support
  649. Revision 1.34 2002/07/01 18:46:24 peter
  650. * internal linker
  651. * reorganized aasm layer
  652. Revision 1.33 2002/05/18 13:34:11 peter
  653. * readded missing revisions
  654. Revision 1.32 2002/05/16 19:46:42 carl
  655. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  656. + try to fix temp allocation (still in ifdef)
  657. + generic constructor calls
  658. + start of tassembler / tmodulebase class cleanup
  659. Revision 1.30 2002/04/21 18:57:23 peter
  660. * fixed memleaks when file can't be opened
  661. Revision 1.29 2002/04/20 21:32:24 carl
  662. + generic FPC_CHECKPOINTER
  663. + first parameter offset in stack now portable
  664. * rename some constants
  665. + move some cpu stuff to other units
  666. - remove unused constents
  667. * fix stacksize for some targets
  668. * fix generic size problems which depend now on EXTEND_SIZE constant
  669. Revision 1.28 2002/04/19 15:46:02 peter
  670. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  671. in most cases and not written to the ppu
  672. * add mangeledname_prefix() routine to generate the prefix of
  673. manglednames depending on the current procedure, object and module
  674. * removed static procprefix since the mangledname is now build only
  675. on demand from tprocdef.mangledname
  676. Revision 1.27 2002/01/29 19:43:11 peter
  677. * update target_asm according to outputformat
  678. }