parser.pas 25 KB

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