parser.pas 27 KB

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