fppu.pas 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit implements the first loading and searching of the modules
  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 fppu;
  19. {$i fpcdefs.inc}
  20. { close ppufiles on system that are
  21. short on file handles like DOS system PM }
  22. {$ifdef GO32V2}
  23. {$define SHORT_ON_FILE_HANDLES}
  24. {$endif GO32V2}
  25. interface
  26. uses
  27. cutils,cclasses,
  28. globtype,globals,finput,fmodule,
  29. symbase,symppu,ppu;
  30. type
  31. tppumodule = class(tmodule)
  32. ppufile : tcompilerppufile; { the PPU file }
  33. {$ifdef Test_Double_checksum}
  34. crc_array : pointer;
  35. crc_size : longint;
  36. crc_array2 : pointer;
  37. crc_size2 : longint;
  38. {$endif def Test_Double_checksum}
  39. constructor create(const s:string;const fn:string;_is_unit:boolean);
  40. destructor destroy;override;
  41. procedure reset;override;
  42. function openppu:boolean;
  43. function search_unit(const n : string;const fn:string;onlysource:boolean):boolean;
  44. procedure getppucrc;
  45. procedure writeppu;
  46. procedure loadppu;
  47. private
  48. procedure load_interface;
  49. procedure load_implementation;
  50. procedure load_symtable_refs;
  51. procedure load_usedunits;
  52. procedure writeusedmacro(p:TNamedIndexItem;arg:pointer);
  53. procedure writeusedmacros;
  54. procedure writesourcefiles;
  55. procedure writeusedunit;
  56. procedure writelinkcontainer(var p:tlinkcontainer;id:byte;strippath:boolean);
  57. procedure putasmsymbol_in_idx(s:tnamedindexitem;arg:pointer);
  58. procedure writeasmsymbols;
  59. procedure readusedmacros;
  60. procedure readsourcefiles;
  61. procedure readloadunit;
  62. procedure readlinkcontainer(var p:tlinkcontainer);
  63. procedure readasmsymbols;
  64. end;
  65. function loadunit(const s : stringid;const fn:string) : tmodule;
  66. implementation
  67. uses
  68. verbose,systems,version,
  69. symtable,
  70. scanner,
  71. aasmbase,
  72. parser;
  73. {****************************************************************************
  74. TPPUMODULE
  75. ****************************************************************************}
  76. constructor tppumodule.create(const s:string;const fn:string;_is_unit:boolean);
  77. begin
  78. inherited create(s,_is_unit);
  79. ppufile:=nil;
  80. { search the PPU file if it is an unit }
  81. if is_unit then
  82. begin
  83. { use the realmodulename so we can also find a case sensitive
  84. source filename }
  85. search_unit(realmodulename^,fn,false);
  86. { it the sources_available is changed then we know that
  87. the sources aren't available }
  88. if not sources_avail then
  89. sources_checked:=true;
  90. end;
  91. end;
  92. destructor tppumodule.Destroy;
  93. begin
  94. if assigned(ppufile) then
  95. ppufile.free;
  96. ppufile:=nil;
  97. inherited Destroy;
  98. end;
  99. procedure tppumodule.reset;
  100. begin
  101. if assigned(ppufile) then
  102. begin
  103. ppufile.free;
  104. ppufile:=nil;
  105. end;
  106. inherited reset;
  107. end;
  108. function tppumodule.openppu:boolean;
  109. var
  110. ppufiletime : longint;
  111. begin
  112. openppu:=false;
  113. Message1(unit_t_ppu_loading,ppufilename^);
  114. { Get ppufile time (also check if the file exists) }
  115. ppufiletime:=getnamedfiletime(ppufilename^);
  116. if ppufiletime=-1 then
  117. exit;
  118. { Open the ppufile }
  119. Message1(unit_u_ppu_name,ppufilename^);
  120. ppufile:=tcompilerppufile.create(ppufilename^);
  121. if not ppufile.openfile then
  122. begin
  123. ppufile.free;
  124. ppufile:=nil;
  125. Message(unit_u_ppu_file_too_short);
  126. exit;
  127. end;
  128. { check for a valid PPU file }
  129. if not ppufile.CheckPPUId then
  130. begin
  131. ppufile.free;
  132. ppufile:=nil;
  133. Message(unit_u_ppu_invalid_header);
  134. exit;
  135. end;
  136. { check for allowed PPU versions }
  137. if not (ppufile.GetPPUVersion = CurrentPPUVersion) then
  138. begin
  139. Message1(unit_u_ppu_invalid_version,tostr(ppufile.GetPPUVersion));
  140. ppufile.free;
  141. ppufile:=nil;
  142. exit;
  143. end;
  144. { check the target processor }
  145. if tsystemcpu(ppufile.header.cpu)<>target_cpu then
  146. begin
  147. ppufile.free;
  148. ppufile:=nil;
  149. Message(unit_u_ppu_invalid_processor);
  150. exit;
  151. end;
  152. { check target }
  153. if tsystem(ppufile.header.target)<>target_info.system then
  154. begin
  155. ppufile.free;
  156. ppufile:=nil;
  157. Message(unit_u_ppu_invalid_target);
  158. exit;
  159. end;
  160. { check if floating point emulation is on?}
  161. if ((ppufile.header.flags and uf_fpu_emulation)<>0) and
  162. (cs_fp_emulation in aktmoduleswitches) then
  163. begin
  164. ppufile.free;
  165. ppufile:=nil;
  166. Message(unit_u_ppu_invalid_fpumode);
  167. exit;
  168. end;
  169. { Load values to be access easier }
  170. flags:=ppufile.header.flags;
  171. crc:=ppufile.header.checksum;
  172. interface_crc:=ppufile.header.interface_checksum;
  173. { Show Debug info }
  174. Message1(unit_u_ppu_time,filetimestring(ppufiletime));
  175. Message1(unit_u_ppu_flags,tostr(flags));
  176. Message1(unit_u_ppu_crc,hexstr(ppufile.header.checksum,8));
  177. Message1(unit_u_ppu_crc,hexstr(ppufile.header.interface_checksum,8)+' (intfc)');
  178. do_compile:=false;
  179. openppu:=true;
  180. end;
  181. function tppumodule.search_unit(const n : string;const fn:string;onlysource:boolean):boolean;
  182. var
  183. singlepathstring,
  184. filename : string;
  185. Function UnitExists(const ext:string;var foundfile:string):boolean;
  186. begin
  187. Message1(unit_t_unitsearch,Singlepathstring+filename+ext);
  188. UnitExists:=FindFile(FileName+ext,Singlepathstring,foundfile);
  189. end;
  190. Function PPUSearchPath(const s:string):boolean;
  191. var
  192. found : boolean;
  193. hs : string;
  194. begin
  195. Found:=false;
  196. singlepathstring:=FixPath(s,false);
  197. { Check for PPU file }
  198. Found:=UnitExists(target_info.unitext,hs);
  199. if Found then
  200. Begin
  201. SetFileName(hs,false);
  202. Found:=OpenPPU;
  203. End;
  204. PPUSearchPath:=Found;
  205. end;
  206. Function SourceSearchPath(const s:string):boolean;
  207. var
  208. found : boolean;
  209. hs : string;
  210. begin
  211. Found:=false;
  212. singlepathstring:=FixPath(s,false);
  213. { Check for Sources }
  214. ppufile:=nil;
  215. do_compile:=true;
  216. recompile_reason:=rr_noppu;
  217. {Check for .pp file}
  218. Found:=UnitExists(target_info.sourceext,hs);
  219. if not Found then
  220. begin
  221. { Check for .pas }
  222. Found:=UnitExists(target_info.pasext,hs);
  223. end;
  224. stringdispose(mainsource);
  225. if Found then
  226. begin
  227. sources_avail:=true;
  228. { Load Filenames when found }
  229. mainsource:=StringDup(hs);
  230. SetFileName(hs,false);
  231. end
  232. else
  233. sources_avail:=false;
  234. SourceSearchPath:=Found;
  235. end;
  236. Function SearchPath(const s:string):boolean;
  237. var
  238. found : boolean;
  239. begin
  240. { First check for a ppu, then for the source }
  241. found:=false;
  242. if not onlysource then
  243. found:=PPUSearchPath(s);
  244. if not found then
  245. found:=SourceSearchPath(s);
  246. SearchPath:=found;
  247. end;
  248. Function SearchPathList(list:TSearchPathList):boolean;
  249. var
  250. hp : TStringListItem;
  251. found : boolean;
  252. begin
  253. found:=false;
  254. hp:=TStringListItem(list.First);
  255. while assigned(hp) do
  256. begin
  257. found:=SearchPath(hp.Str);
  258. if found then
  259. break;
  260. hp:=TStringListItem(hp.next);
  261. end;
  262. SearchPathList:=found;
  263. end;
  264. var
  265. fnd : boolean;
  266. hs : string;
  267. begin
  268. filename:=FixFileName(n);
  269. { try to find unit
  270. 1. look for ppu in cwd
  271. 2. look for ppu in outputpath if set, this is tp7 compatible (PFV)
  272. 3. look for the specified source file (from the uses line)
  273. 4. look for source in cwd
  274. 5. local unit pathlist
  275. 6. global unit pathlist }
  276. fnd:=false;
  277. if not onlysource then
  278. begin
  279. fnd:=PPUSearchPath('.');
  280. if (not fnd) and (outputpath^<>'') then
  281. fnd:=PPUSearchPath(outputpath^);
  282. end;
  283. if (not fnd) and (fn<>'') then
  284. begin
  285. { the full filename is specified so we can't use here the
  286. searchpath (PFV) }
  287. Message1(unit_t_unitsearch,AddExtension(fn,target_info.sourceext));
  288. fnd:=FindFile(AddExtension(fn,target_info.sourceext),'',hs);
  289. if not fnd then
  290. begin
  291. Message1(unit_t_unitsearch,AddExtension(fn,target_info.pasext));
  292. fnd:=FindFile(AddExtension(fn,target_info.pasext),'',hs);
  293. end;
  294. if fnd then
  295. begin
  296. sources_avail:=true;
  297. do_compile:=true;
  298. recompile_reason:=rr_noppu;
  299. stringdispose(mainsource);
  300. mainsource:=StringDup(hs);
  301. SetFileName(hs,false);
  302. end;
  303. end;
  304. if (not fnd) then
  305. fnd:=SourceSearchPath('.');
  306. if (not fnd) then
  307. fnd:=SearchPathList(LocalUnitSearchPath);
  308. if (not fnd) then
  309. fnd:=SearchPathList(UnitSearchPath);
  310. { try to find a file with the first 8 chars of the modulename, like
  311. dos }
  312. if (not fnd) and (length(filename)>8) then
  313. begin
  314. filename:=copy(filename,1,8);
  315. fnd:=SearchPath('.');
  316. if (not fnd) then
  317. fnd:=SearchPathList(LocalUnitSearchPath);
  318. if not fnd then
  319. fnd:=SearchPathList(UnitSearchPath);
  320. end;
  321. search_unit:=fnd;
  322. end;
  323. {**********************************
  324. PPU Reading/Writing Helpers
  325. ***********************************}
  326. procedure tppumodule.writeusedmacro(p:TNamedIndexItem;arg:pointer);
  327. begin
  328. if tmacro(p).is_used or tmacro(p).defined_at_startup then
  329. begin
  330. ppufile.putstring(p.name);
  331. ppufile.putbyte(byte(tmacro(p).defined_at_startup));
  332. ppufile.putbyte(byte(tmacro(p).is_used));
  333. end;
  334. end;
  335. procedure tppumodule.writeusedmacros;
  336. begin
  337. ppufile.do_crc:=false;
  338. tscannerfile(scanner).macros.foreach({$ifdef FPCPROCVAR}@{$endif}writeusedmacro,nil);
  339. ppufile.writeentry(ibusedmacros);
  340. ppufile.do_crc:=true;
  341. end;
  342. procedure tppumodule.writesourcefiles;
  343. var
  344. hp : tinputfile;
  345. i,j : longint;
  346. begin
  347. { second write the used source files }
  348. ppufile.do_crc:=false;
  349. hp:=sourcefiles.files;
  350. { write source files directly in good order }
  351. j:=0;
  352. while assigned(hp) do
  353. begin
  354. inc(j);
  355. hp:=hp.ref_next;
  356. end;
  357. while j>0 do
  358. begin
  359. hp:=sourcefiles.files;
  360. for i:=1 to j-1 do
  361. hp:=hp.ref_next;
  362. ppufile.putstring(hp.name^);
  363. dec(j);
  364. end;
  365. ppufile.writeentry(ibsourcefiles);
  366. ppufile.do_crc:=true;
  367. end;
  368. procedure tppumodule.writeusedunit;
  369. var
  370. hp : tused_unit;
  371. begin
  372. { renumber the units for derefence writing }
  373. numberunits;
  374. { write a reference for each used unit }
  375. hp:=tused_unit(used_units.first);
  376. while assigned(hp) do
  377. begin
  378. { implementation units should not change
  379. the CRC PM }
  380. ppufile.do_crc:=hp.in_interface;
  381. ppufile.putstring(hp.realname^);
  382. { the checksum should not affect the crc of this unit ! (PFV) }
  383. ppufile.do_crc:=false;
  384. ppufile.putlongint(longint(hp.checksum));
  385. ppufile.putlongint(longint(hp.interface_checksum));
  386. ppufile.putbyte(byte(hp.in_interface));
  387. ppufile.do_crc:=true;
  388. hp:=tused_unit(hp.next);
  389. end;
  390. ppufile.do_interface_crc:=true;
  391. ppufile.writeentry(ibloadunit);
  392. end;
  393. procedure tppumodule.writelinkcontainer(var p:tlinkcontainer;id:byte;strippath:boolean);
  394. var
  395. hcontainer : tlinkcontainer;
  396. s : string;
  397. mask : cardinal;
  398. begin
  399. hcontainer:=TLinkContainer.Create;
  400. while not p.empty do
  401. begin
  402. s:=p.get(mask);
  403. if strippath then
  404. ppufile.putstring(SplitFileName(s))
  405. else
  406. ppufile.putstring(s);
  407. ppufile.putlongint(mask);
  408. hcontainer.add(s,mask);
  409. end;
  410. ppufile.writeentry(id);
  411. p.Free;
  412. p:=hcontainer;
  413. end;
  414. procedure tppumodule.putasmsymbol_in_idx(s:tnamedindexitem;arg:pointer);
  415. begin
  416. if tasmsymbol(s).ppuidx<>-1 then
  417. librarydata.asmsymbolidx^[tasmsymbol(s).ppuidx-1]:=tasmsymbol(s);
  418. end;
  419. procedure tppumodule.writeasmsymbols;
  420. var
  421. s : tasmsymbol;
  422. i : longint;
  423. asmsymtype : byte;
  424. begin
  425. { get an ordered list of all symbols to put in the ppu }
  426. getmem(librarydata.asmsymbolidx,librarydata.asmsymbolppuidx*sizeof(pointer));
  427. fillchar(librarydata.asmsymbolidx^,librarydata.asmsymbolppuidx*sizeof(pointer),0);
  428. librarydata.symbolsearch.foreach({$ifdef FPCPROCVAR}@{$endif}putasmsymbol_in_idx,nil);
  429. { write the number of symbols }
  430. ppufile.putlongint(librarydata.asmsymbolppuidx);
  431. { write the symbols from the indexed list to the ppu }
  432. for i:=1 to librarydata.asmsymbolppuidx do
  433. begin
  434. s:=librarydata.asmsymbolidx^[i-1];
  435. if not assigned(s) then
  436. internalerror(200208071);
  437. asmsymtype:=1;
  438. if s.Classtype=tasmlabel then
  439. begin
  440. if tasmlabel(s).is_addr then
  441. asmsymtype:=4
  442. else if tasmlabel(s).typ=AT_DATA then
  443. asmsymtype:=3
  444. else
  445. asmsymtype:=2;
  446. end;
  447. ppufile.putbyte(asmsymtype);
  448. case asmsymtype of
  449. 1 :
  450. ppufile.putstring(s.name);
  451. 2 :
  452. ppufile.putlongint(tasmlabel(s).labelnr);
  453. end;
  454. ppufile.putbyte(byte(s.defbind));
  455. ppufile.putbyte(byte(s.typ));
  456. end;
  457. ppufile.writeentry(ibasmsymbols);
  458. end;
  459. procedure tppumodule.readusedmacros;
  460. var
  461. hs : string;
  462. mac : tmacro;
  463. was_defined_at_startup,
  464. was_used : boolean;
  465. begin
  466. { only possible when we've a scanner of the current file }
  467. if not assigned(current_scanner) then
  468. exit;
  469. while not ppufile.endofentry do
  470. begin
  471. hs:=ppufile.getstring;
  472. was_defined_at_startup:=boolean(ppufile.getbyte);
  473. was_used:=boolean(ppufile.getbyte);
  474. mac:=tmacro(tscannerfile(current_scanner).macros.search(hs));
  475. if assigned(mac) then
  476. begin
  477. {$ifndef EXTDEBUG}
  478. { if we don't have the sources why tell }
  479. if sources_avail then
  480. {$endif ndef EXTDEBUG}
  481. if (not was_defined_at_startup) and
  482. was_used and
  483. mac.defined_at_startup then
  484. Message2(unit_h_cond_not_set_in_last_compile,hs,mainsource^);
  485. end
  486. else { not assigned }
  487. if was_defined_at_startup and
  488. was_used then
  489. Message2(unit_h_cond_not_set_in_last_compile,hs,mainsource^);
  490. end;
  491. end;
  492. procedure tppumodule.readsourcefiles;
  493. var
  494. temp,hs : string;
  495. temp_dir : string;
  496. main_dir : string;
  497. incfile_found,
  498. main_found,
  499. is_main : boolean;
  500. ppufiletime,
  501. source_time : longint;
  502. hp : tinputfile;
  503. begin
  504. ppufiletime:=getnamedfiletime(ppufilename^);
  505. sources_avail:=true;
  506. is_main:=true;
  507. main_dir:='';
  508. while not ppufile.endofentry do
  509. begin
  510. hs:=ppufile.getstring;
  511. temp_dir:='';
  512. if (flags and uf_in_library)<>0 then
  513. begin
  514. sources_avail:=false;
  515. temp:=' library';
  516. end
  517. else if pos('Macro ',hs)=1 then
  518. begin
  519. { we don't want to find this file }
  520. { but there is a problem with file indexing !! }
  521. temp:='';
  522. end
  523. else
  524. begin
  525. { check the date of the source files }
  526. Source_Time:=GetNamedFileTime(path^+hs);
  527. incfile_found:=false;
  528. main_found:=false;
  529. if Source_Time<>-1 then
  530. hs:=path^+hs
  531. else
  532. if not(is_main) then
  533. begin
  534. Source_Time:=GetNamedFileTime(main_dir+hs);
  535. if Source_Time<>-1 then
  536. hs:=main_dir+hs;
  537. end;
  538. if (Source_Time=-1) then
  539. begin
  540. if is_main then
  541. main_found:=unitsearchpath.FindFile(hs,temp_dir)
  542. else
  543. incfile_found:=includesearchpath.FindFile(hs,temp_dir);
  544. if incfile_found or main_found then
  545. begin
  546. Source_Time:=GetNamedFileTime(temp_dir);
  547. if Source_Time<>-1 then
  548. hs:=temp_dir;
  549. end;
  550. end;
  551. if Source_Time=-1 then
  552. begin
  553. sources_avail:=false;
  554. temp:=' not found';
  555. end
  556. else
  557. begin
  558. if main_found then
  559. main_dir:=temp_dir;
  560. { time newer? But only allow if the file is not searched
  561. in the include path (PFV), else you've problems with
  562. units which use the same includefile names }
  563. if incfile_found then
  564. temp:=' found'
  565. else
  566. begin
  567. temp:=' time '+filetimestring(source_time);
  568. if (source_time>ppufiletime) then
  569. begin
  570. if {is_main or} ((flags and uf_release)=0) then
  571. begin
  572. do_compile:=true;
  573. recompile_reason:=rr_sourcenewer;
  574. end
  575. else
  576. Message2(unit_h_source_modified,hs,ppufilename^);
  577. temp:=temp+' *';
  578. end;
  579. end;
  580. end;
  581. hp:=tinputfile.create(hs);
  582. { the indexing is wrong here PM }
  583. sourcefiles.register_file(hp);
  584. end;
  585. if is_main then
  586. begin
  587. stringdispose(mainsource);
  588. mainsource:=stringdup(hs);
  589. end;
  590. Message1(unit_u_ppu_source,hs+temp);
  591. is_main:=false;
  592. end;
  593. { check if we want to rebuild every unit, only if the sources are
  594. available }
  595. if do_build and sources_avail and
  596. ((flags and uf_release)=0) then
  597. begin
  598. do_compile:=true;
  599. recompile_reason:=rr_build;
  600. end;
  601. end;
  602. procedure tppumodule.readloadunit;
  603. var
  604. hs : string;
  605. intfchecksum,
  606. checksum : cardinal;
  607. in_interface : boolean;
  608. begin
  609. while not ppufile.endofentry do
  610. begin
  611. hs:=ppufile.getstring;
  612. checksum:=cardinal(ppufile.getlongint);
  613. intfchecksum:=cardinal(ppufile.getlongint);
  614. in_interface:=(ppufile.getbyte<>0);
  615. used_units.concat(tused_unit.create_to_load(hs,checksum,intfchecksum,in_interface));
  616. end;
  617. end;
  618. procedure tppumodule.readlinkcontainer(var p:tlinkcontainer);
  619. var
  620. s : string;
  621. m : longint;
  622. begin
  623. while not ppufile.endofentry do
  624. begin
  625. s:=ppufile.getstring;
  626. m:=ppufile.getlongint;
  627. p.add(s,m);
  628. end;
  629. end;
  630. procedure tppumodule.readasmsymbols;
  631. var
  632. labelnr,
  633. i : longint;
  634. name : string;
  635. bind : TAsmSymBind;
  636. typ : TAsmSymType;
  637. asmsymtype : byte;
  638. begin
  639. librarydata.asmsymbolppuidx:=ppufile.getlongint;
  640. if librarydata.asmsymbolppuidx>0 then
  641. begin
  642. getmem(librarydata.asmsymbolidx,librarydata.asmsymbolppuidx*sizeof(pointer));
  643. fillchar(librarydata.asmsymbolidx^,librarydata.asmsymbolppuidx*sizeof(pointer),0);
  644. for i:=1 to librarydata.asmsymbolppuidx do
  645. begin
  646. asmsymtype:=ppufile.getbyte;
  647. case asmsymtype of
  648. 1 :
  649. name:=ppufile.getstring;
  650. 2..4 :
  651. labelnr:=ppufile.getlongint;
  652. else
  653. internalerror(200208192);
  654. end;
  655. bind:=tasmsymbind(ppufile.getbyte);
  656. typ:=tasmsymtype(ppufile.getbyte);
  657. case asmsymtype of
  658. 1 :
  659. librarydata.asmsymbolidx^[i-1]:=librarydata.newasmsymboltype(name,bind,typ);
  660. 2 :
  661. librarydata.asmsymbolidx^[i-1]:=librarydata.newasmlabel(labelnr,false,false);
  662. 3 :
  663. librarydata.asmsymbolidx^[i-1]:=librarydata.newasmlabel(labelnr,true,false);
  664. 4 :
  665. librarydata.asmsymbolidx^[i-1]:=librarydata.newasmlabel(labelnr,false,true);
  666. end;
  667. end;
  668. end;
  669. end;
  670. procedure tppumodule.load_interface;
  671. var
  672. b : byte;
  673. newmodulename : string;
  674. begin
  675. { read interface part }
  676. repeat
  677. b:=ppufile.readentry;
  678. case b of
  679. ibmodulename :
  680. begin
  681. newmodulename:=ppufile.getstring;
  682. if (cs_check_unit_name in aktglobalswitches) and
  683. (upper(newmodulename)<>modulename^) then
  684. Message2(unit_f_unit_name_error,realmodulename^,newmodulename);
  685. stringdispose(modulename);
  686. stringdispose(realmodulename);
  687. modulename:=stringdup(upper(newmodulename));
  688. realmodulename:=stringdup(newmodulename);
  689. end;
  690. ibsourcefiles :
  691. readsourcefiles;
  692. ibusedmacros :
  693. readusedmacros;
  694. ibloadunit :
  695. readloadunit;
  696. iblinkunitofiles :
  697. readlinkcontainer(LinkUnitOFiles);
  698. iblinkunitstaticlibs :
  699. readlinkcontainer(LinkUnitStaticLibs);
  700. iblinkunitsharedlibs :
  701. readlinkcontainer(LinkUnitSharedLibs);
  702. iblinkotherofiles :
  703. readlinkcontainer(LinkotherOFiles);
  704. iblinkotherstaticlibs :
  705. readlinkcontainer(LinkotherStaticLibs);
  706. iblinkothersharedlibs :
  707. readlinkcontainer(LinkotherSharedLibs);
  708. ibendinterface :
  709. break;
  710. else
  711. Message1(unit_f_ppu_invalid_entry,tostr(b));
  712. end;
  713. until false;
  714. end;
  715. procedure tppumodule.load_implementation;
  716. var
  717. b : byte;
  718. oldobjectlibrary : tasmlibrarydata;
  719. begin
  720. { read implementation part }
  721. repeat
  722. b:=ppufile.readentry;
  723. case b of
  724. ibasmsymbols :
  725. readasmsymbols;
  726. ibendimplementation :
  727. break;
  728. else
  729. Message1(unit_f_ppu_invalid_entry,tostr(b));
  730. end;
  731. until false;
  732. { we can now derefence all pointers to the implementation parts }
  733. oldobjectlibrary:=objectlibrary;
  734. objectlibrary:=librarydata;
  735. tstoredsymtable(globalsymtable).derefimpl;
  736. if assigned(localsymtable) then
  737. tstoredsymtable(localsymtable).derefimpl;
  738. objectlibrary:=oldobjectlibrary;
  739. end;
  740. procedure tppumodule.load_symtable_refs;
  741. var
  742. b : byte;
  743. unitindex : word;
  744. begin
  745. { load local symtable first }
  746. if ((flags and uf_local_browser)<>0) then
  747. begin
  748. localsymtable:=tstaticsymtable.create(modulename^);
  749. tstaticsymtable(localsymtable).ppuload(ppufile);
  750. end;
  751. { load browser }
  752. if (flags and uf_has_browser)<>0 then
  753. begin
  754. tstoredsymtable(globalsymtable).load_references(ppufile,true);
  755. unitindex:=1;
  756. while assigned(map^[unitindex]) do
  757. begin
  758. { each unit wrote one browser entry }
  759. tstoredsymtable(globalsymtable).load_references(ppufile,false);
  760. inc(unitindex);
  761. end;
  762. b:=ppufile.readentry;
  763. if b<>ibendbrowser then
  764. Message1(unit_f_ppu_invalid_entry,tostr(b));
  765. end;
  766. if ((flags and uf_local_browser)<>0) then
  767. tstaticsymtable(localsymtable).load_references(ppufile,true);
  768. end;
  769. procedure tppumodule.writeppu;
  770. var
  771. pu : tused_unit;
  772. begin
  773. Message1(unit_u_ppu_write,realmodulename^);
  774. { create unit flags }
  775. {$ifdef GDB}
  776. if cs_gdb_dbx in aktglobalswitches then
  777. flags:=flags or uf_has_dbx;
  778. {$endif GDB}
  779. if cs_browser in aktmoduleswitches then
  780. flags:=flags or uf_has_browser;
  781. if cs_local_browser in aktmoduleswitches then
  782. flags:=flags or uf_local_browser;
  783. if do_release then
  784. flags:=flags or uf_release;
  785. if (cs_fp_emulation in aktmoduleswitches) then
  786. flags:=flags or uf_fpu_emulation;
  787. {$ifdef Test_Double_checksum_write}
  788. Assign(CRCFile,s+'.IMP');
  789. Rewrite(CRCFile);
  790. {$endif def Test_Double_checksum_write}
  791. { create new ppufile }
  792. ppufile:=tcompilerppufile.create(ppufilename^);
  793. if not ppufile.createfile then
  794. Message(unit_f_ppu_cannot_write);
  795. { first the unitname }
  796. ppufile.putstring(realmodulename^);
  797. ppufile.writeentry(ibmodulename);
  798. writesourcefiles;
  799. writeusedmacros;
  800. writeusedunit;
  801. { write the objectfiles and libraries that come for this unit,
  802. preserve the containers becuase they are still needed to load
  803. the link.res. All doesn't depend on the crc! It doesn't matter
  804. if a unit is in a .o or .a file }
  805. ppufile.do_crc:=false;
  806. writelinkcontainer(linkunitofiles,iblinkunitofiles,true);
  807. writelinkcontainer(linkunitstaticlibs,iblinkunitstaticlibs,true);
  808. writelinkcontainer(linkunitsharedlibs,iblinkunitsharedlibs,true);
  809. writelinkcontainer(linkotherofiles,iblinkotherofiles,false);
  810. writelinkcontainer(linkotherstaticlibs,iblinkotherstaticlibs,true);
  811. writelinkcontainer(linkothersharedlibs,iblinkothersharedlibs,true);
  812. ppufile.do_crc:=true;
  813. ppufile.writeentry(ibendinterface);
  814. { write the symtable entries }
  815. tstoredsymtable(globalsymtable).ppuwrite(ppufile);
  816. { everything after this doesn't affect the crc }
  817. ppufile.do_crc:=false;
  818. { write asmsymbols }
  819. writeasmsymbols;
  820. { end of implementation }
  821. ppufile.writeentry(ibendimplementation);
  822. { write static symtable
  823. needed for local debugging of unit functions }
  824. if ((flags and uf_local_browser)<>0) and
  825. assigned(localsymtable) then
  826. tstoredsymtable(localsymtable).ppuwrite(ppufile);
  827. { write all browser section }
  828. if (flags and uf_has_browser)<>0 then
  829. begin
  830. tstoredsymtable(globalsymtable).write_references(ppufile,true);
  831. pu:=tused_unit(used_units.first);
  832. while assigned(pu) do
  833. begin
  834. tstoredsymtable(pu.u.globalsymtable).write_references(ppufile,false);
  835. pu:=tused_unit(pu.next);
  836. end;
  837. ppufile.writeentry(ibendbrowser);
  838. end;
  839. if ((flags and uf_local_browser)<>0) and
  840. assigned(localsymtable) then
  841. tstaticsymtable(localsymtable).write_references(ppufile,true);
  842. { the last entry ibend is written automaticly }
  843. { flush to be sure }
  844. ppufile.flush;
  845. { create and write header }
  846. ppufile.header.size:=ppufile.size;
  847. ppufile.header.checksum:=ppufile.crc;
  848. ppufile.header.interface_checksum:=ppufile.interface_crc;
  849. ppufile.header.compiler:=wordversion;
  850. ppufile.header.cpu:=word(target_cpu);
  851. ppufile.header.target:=word(target_info.system);
  852. ppufile.header.flags:=flags;
  853. ppufile.writeheader;
  854. { save crc in current module also }
  855. crc:=ppufile.crc;
  856. interface_crc:=ppufile.interface_crc;
  857. {$ifdef Test_Double_checksum_write}
  858. close(CRCFile);
  859. {$endif Test_Double_checksum_write}
  860. ppufile.closefile;
  861. ppufile.free;
  862. ppufile:=nil;
  863. end;
  864. procedure tppumodule.getppucrc;
  865. begin
  866. {$ifdef Test_Double_checksum_write}
  867. Assign(CRCFile,s+'.INT')
  868. Rewrite(CRCFile);
  869. {$endif def Test_Double_checksum_write}
  870. { create new ppufile }
  871. ppufile:=tcompilerppufile.create(ppufilename^);
  872. ppufile.crc_only:=true;
  873. if not ppufile.createfile then
  874. Message(unit_f_ppu_cannot_write);
  875. { first the unitname }
  876. ppufile.putstring(realmodulename^);
  877. ppufile.writeentry(ibmodulename);
  878. { the interface units affect the crc }
  879. writeusedunit;
  880. ppufile.writeentry(ibendinterface);
  881. { write the symtable entries }
  882. tstoredsymtable(globalsymtable).ppuwrite(ppufile);
  883. { save crc }
  884. crc:=ppufile.crc;
  885. interface_crc:=ppufile.interface_crc;
  886. {$ifdef Test_Double_checksum}
  887. crc_array:=ppufile.crc_test;
  888. ppufile.crc_test:=nil;
  889. crc_size:=ppufile.crc_index2;
  890. crc_array2:=ppufile.crc_test2;
  891. ppufile.crc_test2:=nil;
  892. crc_size2:=ppufile.crc_index2;
  893. {$endif Test_Double_checksum}
  894. {$ifdef Test_Double_checksum_write}
  895. close(CRCFile);
  896. {$endif Test_Double_checksum_write}
  897. ppufile.closefile;
  898. ppufile.free;
  899. ppufile:=nil;
  900. end;
  901. procedure tppumodule.load_usedunits;
  902. var
  903. pu : tused_unit;
  904. loaded_unit : tmodule;
  905. load_refs : boolean;
  906. nextmapentry : longint;
  907. begin
  908. load_refs:=true;
  909. { init the map }
  910. new(map);
  911. fillchar(map^,sizeof(tunitmap),#0);
  912. {$ifdef NEWMAP}
  913. map^[0]:=current_module;
  914. {$endif NEWMAP}
  915. nextmapentry:=1;
  916. { load the used units from interface }
  917. in_implementation:=false;
  918. pu:=tused_unit(used_units.first);
  919. while assigned(pu) do
  920. begin
  921. if (not pu.loaded) and (pu.in_interface) then
  922. begin
  923. loaded_unit:=loadunit(pu.realname^,'');
  924. if compiled then
  925. exit;
  926. { register unit in used units }
  927. pu.u:=loaded_unit;
  928. pu.loaded:=true;
  929. { doubles are not important for that list PM }
  930. pu.u.dependent_units.concat(tdependent_unit.create(self));
  931. { need to recompile the current unit ? }
  932. if loaded_unit.crc<>pu.checksum then
  933. begin
  934. Message2(unit_u_recompile_crc_change,realmodulename^,pu.realname^);
  935. recompile_reason:=rr_crcchanged;
  936. do_compile:=true;
  937. dispose(map);
  938. map:=nil;
  939. exit;
  940. end;
  941. { setup the map entry for deref }
  942. {$ifndef NEWMAP}
  943. map^[nextmapentry]:=loaded_unit.globalsymtable;
  944. {$else NEWMAP}
  945. map^[nextmapentry]:=loaded_unit;
  946. {$endif NEWMAP}
  947. inc(nextmapentry);
  948. if nextmapentry>maxunits then
  949. Message(unit_f_too_much_units);
  950. end;
  951. pu:=tused_unit(pu.next);
  952. end;
  953. { ok, now load the interface of this unit }
  954. if current_module<>self then
  955. internalerror(200208187);
  956. // current_module:=self;
  957. // SetCompileModule(current_module);
  958. globalsymtable:=tglobalsymtable.create(modulename^);
  959. tstoredsymtable(globalsymtable).ppuload(ppufile);
  960. { now only read the implementation uses }
  961. in_implementation:=true;
  962. pu:=tused_unit(used_units.first);
  963. while assigned(pu) do
  964. begin
  965. if (not pu.loaded) and (not pu.in_interface) then
  966. begin
  967. loaded_unit:=loadunit(pu.realname^,'');
  968. if compiled then
  969. exit;
  970. { register unit in used units }
  971. pu.u:=loaded_unit;
  972. pu.loaded:=true;
  973. { need to recompile the current unit ? }
  974. if (loaded_unit.interface_crc<>pu.interface_checksum) {and
  975. not(current_module.in_second_compile) } then
  976. begin
  977. Message2(unit_u_recompile_crc_change,realmodulename^,pu.realname^+' {impl}');
  978. recompile_reason:=rr_crcchanged;
  979. do_compile:=true;
  980. dispose(map);
  981. map:=nil;
  982. exit;
  983. end;
  984. { setup the map entry for deref }
  985. {$ifndef NEWMAP}
  986. map^[nextmapentry]:=loaded_unit.globalsymtable;
  987. {$else NEWMAP}
  988. map^[nextmapentry]:=loaded_unit;
  989. {$endif NEWMAP}
  990. inc(nextmapentry);
  991. if nextmapentry>maxunits then
  992. Message(unit_f_too_much_units);
  993. end;
  994. pu:=tused_unit(pu.next);
  995. end;
  996. { read the implementation/objectdata part }
  997. load_implementation;
  998. { load browser info if stored }
  999. if ((flags and uf_has_browser)<>0) and load_refs then
  1000. begin
  1001. if current_module<>self then
  1002. internalerror(200208188);
  1003. // current_module:=self;
  1004. load_symtable_refs;
  1005. end;
  1006. { remove the map, it's not needed anymore }
  1007. dispose(map);
  1008. map:=nil;
  1009. end;
  1010. procedure tppumodule.loadppu;
  1011. var
  1012. name : string;
  1013. begin
  1014. { load interface section }
  1015. if not do_compile then
  1016. load_interface;
  1017. { only load units when we don't recompile }
  1018. if not do_compile then
  1019. load_usedunits;
  1020. { recompile if set }
  1021. if do_compile then
  1022. begin
  1023. { we don't need the ppufile anymore }
  1024. if assigned(ppufile) then
  1025. begin
  1026. ppufile.free;
  1027. ppufile:=nil;
  1028. end;
  1029. { recompile the unit or give a fatal error if sources not available }
  1030. if not(sources_avail) and
  1031. not(sources_checked) then
  1032. if (not search_unit(modulename^,'',true))
  1033. and (length(modulename^)>8) then
  1034. search_unit(copy(modulename^,1,8),'',true);
  1035. if not(sources_avail) then
  1036. begin
  1037. if recompile_reason=rr_noppu then
  1038. Message1(unit_f_cant_find_ppu,modulename^)
  1039. else
  1040. Message1(unit_f_cant_compile_unit,modulename^);
  1041. end
  1042. else
  1043. begin
  1044. if in_compile then
  1045. begin
  1046. in_second_compile:=true;
  1047. Message1(parser_d_compiling_second_time,modulename^);
  1048. end;
  1049. name:=mainsource^;
  1050. { compile this module }
  1051. compile(name);
  1052. in_second_compile:=false;
  1053. end;
  1054. end;
  1055. if assigned(ppufile) then
  1056. begin
  1057. ppufile.closefile;
  1058. ppufile.free;
  1059. ppufile:=nil;
  1060. end;
  1061. end;
  1062. {*****************************************************************************
  1063. LoadUnit
  1064. *****************************************************************************}
  1065. function loadunit(const s : stringid;const fn:string) : tmodule;
  1066. const
  1067. ImplIntf : array[boolean] of string[15]=('interface','implementation');
  1068. var
  1069. st : tglobalsymtable;
  1070. second_time : boolean;
  1071. old_current_module,hp2 : tmodule;
  1072. hp : tppumodule;
  1073. scanner : tscannerfile;
  1074. dummy : tmodule;
  1075. ups : stringid;
  1076. begin
  1077. old_current_module:=current_module;
  1078. { we are loading a new module, save the state of the scanner
  1079. and reset scanner+module }
  1080. if assigned(current_scanner) then
  1081. current_scanner.tempcloseinputfile;
  1082. current_scanner:=nil;
  1083. current_module:=nil;
  1084. { Info }
  1085. Message3(unit_u_load_unit,old_current_module.modulename^,ImplIntf[old_current_module.in_implementation],s);
  1086. ups:=upper(s);
  1087. { unit not found }
  1088. st:=nil;
  1089. dummy:=nil;
  1090. { search all loaded units }
  1091. hp:=tppumodule(loaded_units.first);
  1092. while assigned(hp) do
  1093. begin
  1094. if hp.modulename^=ups then
  1095. begin
  1096. { forced to reload ? }
  1097. if hp.do_reload then
  1098. begin
  1099. hp.do_reload:=false;
  1100. break;
  1101. end;
  1102. { only check for units. The main program is also
  1103. as a unit in the loaded_units list. We simply need
  1104. to ignore this entry (PFV) }
  1105. if hp.is_unit then
  1106. begin
  1107. { the unit is already registered }
  1108. { and this means that the unit }
  1109. { is already compiled }
  1110. { else there is a cyclic unit use }
  1111. if assigned(hp.globalsymtable) then
  1112. st:=tglobalsymtable(hp.globalsymtable)
  1113. else
  1114. begin
  1115. { both units in interface ? }
  1116. if (not old_current_module.in_implementation) and
  1117. (not hp.in_implementation) then
  1118. begin
  1119. { check for a cycle }
  1120. hp2:=old_current_module.loaded_from;
  1121. while assigned(hp2) and (hp2<>hp) do
  1122. begin
  1123. if hp2.in_implementation then
  1124. hp2:=nil
  1125. else
  1126. hp2:=hp2.loaded_from;
  1127. end;
  1128. if assigned(hp2) then
  1129. Message2(unit_f_circular_unit_reference,old_current_module.modulename^,hp.modulename^);
  1130. end;
  1131. end;
  1132. break;
  1133. end;
  1134. end
  1135. else if copy(hp.modulename^,1,8)=ups then
  1136. dummy:=hp;
  1137. { the next unit }
  1138. hp:=tppumodule(hp.next);
  1139. end;
  1140. if assigned(dummy) and not assigned(hp) then
  1141. Message2(unit_w_unit_name_error,s,dummy.modulename^);
  1142. { the unit is not in the loaded units, we must load it first }
  1143. if (not assigned(st)) then
  1144. begin
  1145. if assigned(hp) then
  1146. begin
  1147. current_module:=hp;
  1148. { try to load the unit a second time first }
  1149. Message1(unit_u_second_load_unit,current_module.modulename^);
  1150. second_time:=true;
  1151. current_module.in_second_load:=true;
  1152. { remove the old unit }
  1153. loaded_units.remove(current_module);
  1154. current_module.reset;
  1155. { try to reopen ppu }
  1156. tppumodule(current_module).search_unit(s,fn,false);
  1157. end
  1158. else
  1159. { generates a new unit info record }
  1160. begin
  1161. current_module:=tppumodule.create(s,fn,true);
  1162. second_time:=false;
  1163. end;
  1164. { close old_current_ppu on system that are
  1165. short on file handles like DOS PM }
  1166. {$ifdef SHORT_ON_FILE_HANDLES}
  1167. if old_current_module.is_unit and
  1168. assigned(tppumodule(old_current_module).ppufile) then
  1169. tppumodule(old_current_module).ppufile.tempclose;
  1170. {$endif SHORT_ON_FILE_HANDLES}
  1171. { now we can register the unit }
  1172. current_module.loaded_from:=old_current_module;
  1173. loaded_units.insert(current_module);
  1174. { now realy load the ppu }
  1175. tppumodule(current_module).loadppu;
  1176. { set compiled flag }
  1177. current_module.compiled:=true;
  1178. { load return pointer }
  1179. hp:=tppumodule(current_module);
  1180. { for a second_time recompile reload all dependent units,
  1181. for a first time compile register the unit _once_ }
  1182. if second_time then
  1183. begin
  1184. { now reload all dependent units }
  1185. hp2:=tmodule(loaded_units.first);
  1186. while assigned(hp2) do
  1187. begin
  1188. if hp2.do_reload then
  1189. dummy:=loadunit(hp2.modulename^,'');
  1190. hp2:=tmodule(hp2.next);
  1191. end;
  1192. end
  1193. else
  1194. usedunits.concat(tused_unit.create(current_module,true));
  1195. end;
  1196. { set the old module }
  1197. {$ifdef SHORT_ON_FILE_HANDLES}
  1198. if old_current_module.is_unit and
  1199. assigned(tppumodule(old_current_module).ppufile) then
  1200. tppumodule(old_current_module).ppufile.tempopen;
  1201. {$endif SHORT_ON_FILE_HANDLES}
  1202. { we are back, restore current_module and current_scanner }
  1203. current_module:=old_current_module;
  1204. current_scanner:=tscannerfile(current_module.scanner);
  1205. if assigned(current_scanner) then
  1206. current_scanner.tempopeninputfile;
  1207. SetCompileModule(current_module);
  1208. loadunit:=hp;
  1209. end;
  1210. end.
  1211. {
  1212. $Log$
  1213. Revision 1.24 2002-10-04 20:13:10 peter
  1214. * set in_second_load flag before resetting the module, this is
  1215. required to skip some checkings
  1216. Revision 1.23 2002/08/19 19:36:42 peter
  1217. * More fixes for cross unit inlining, all tnodes are now implemented
  1218. * Moved pocall_internconst to po_internconst because it is not a
  1219. calling type at all and it conflicted when inlining of these small
  1220. functions was requested
  1221. Revision 1.22 2002/08/18 19:58:28 peter
  1222. * more current_scanner fixes
  1223. Revision 1.21 2002/08/15 15:09:41 carl
  1224. + fpu emulation helpers (ppu checking also)
  1225. Revision 1.20 2002/08/12 16:46:04 peter
  1226. * tscannerfile is now destroyed in tmodule.reset and current_scanner
  1227. is updated accordingly. This removes all the loading and saving of
  1228. the old scanner and the invalid flag marking
  1229. Revision 1.19 2002/08/11 14:28:19 peter
  1230. * TScannerFile.SetInvalid added that will also reset inputfile
  1231. Revision 1.18 2002/08/11 13:24:11 peter
  1232. * saving of asmsymbols in ppu supported
  1233. * asmsymbollist global is removed and moved into a new class
  1234. tasmlibrarydata that will hold the info of a .a file which
  1235. corresponds with a single module. Added librarydata to tmodule
  1236. to keep the library info stored for the module. In the future the
  1237. objectfiles will also be stored to the tasmlibrarydata class
  1238. * all getlabel/newasmsymbol and friends are moved to the new class
  1239. Revision 1.17 2002/07/26 21:15:37 florian
  1240. * rewrote the system handling
  1241. Revision 1.16 2002/05/16 19:46:36 carl
  1242. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1243. + try to fix temp allocation (still in ifdef)
  1244. + generic constructor calls
  1245. + start of tassembler / tmodulebase class cleanup
  1246. Revision 1.15 2002/05/14 19:34:41 peter
  1247. * removed old logs and updated copyright year
  1248. Revision 1.14 2002/05/12 16:53:05 peter
  1249. * moved entry and exitcode to ncgutil and cgobj
  1250. * foreach gets extra argument for passing local data to the
  1251. iterator function
  1252. * -CR checks also class typecasts at runtime by changing them
  1253. into as
  1254. * fixed compiler to cycle with the -CR option
  1255. * fixed stabs with elf writer, finally the global variables can
  1256. be watched
  1257. * removed a lot of routines from cga unit and replaced them by
  1258. calls to cgobj
  1259. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  1260. u32bit then the other is typecasted also to u32bit without giving
  1261. a rangecheck warning/error.
  1262. * fixed pascal calling method with reversing also the high tree in
  1263. the parast, detected by tcalcst3 test
  1264. Revision 1.13 2002/04/04 19:05:56 peter
  1265. * removed unused units
  1266. * use tlocation.size in cg.a_*loc*() routines
  1267. Revision 1.12 2002/03/28 20:46:44 carl
  1268. - remove go32v1 support
  1269. Revision 1.11 2002/01/19 14:20:13 peter
  1270. * check for -Un when loading ppu with wrong name
  1271. }