fppu.pas 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408
  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. ppufile.putlongint(hp.getfiletime);
  364. dec(j);
  365. end;
  366. ppufile.writeentry(ibsourcefiles);
  367. ppufile.do_crc:=true;
  368. end;
  369. procedure tppumodule.writeusedunit;
  370. var
  371. hp : tused_unit;
  372. begin
  373. { renumber the units for derefence writing }
  374. numberunits;
  375. { write a reference for each used unit }
  376. hp:=tused_unit(used_units.first);
  377. while assigned(hp) do
  378. begin
  379. { implementation units should not change
  380. the CRC PM }
  381. ppufile.do_crc:=hp.in_interface;
  382. ppufile.putstring(hp.realname^);
  383. { the checksum should not affect the crc of this unit ! (PFV) }
  384. ppufile.do_crc:=false;
  385. ppufile.putlongint(longint(hp.checksum));
  386. ppufile.putlongint(longint(hp.interface_checksum));
  387. ppufile.putbyte(byte(hp.in_interface));
  388. ppufile.do_crc:=true;
  389. hp:=tused_unit(hp.next);
  390. end;
  391. ppufile.do_interface_crc:=true;
  392. ppufile.writeentry(ibloadunit);
  393. end;
  394. procedure tppumodule.writelinkcontainer(var p:tlinkcontainer;id:byte;strippath:boolean);
  395. var
  396. hcontainer : tlinkcontainer;
  397. s : string;
  398. mask : cardinal;
  399. begin
  400. hcontainer:=TLinkContainer.Create;
  401. while not p.empty do
  402. begin
  403. s:=p.get(mask);
  404. if strippath then
  405. ppufile.putstring(SplitFileName(s))
  406. else
  407. ppufile.putstring(s);
  408. ppufile.putlongint(mask);
  409. hcontainer.add(s,mask);
  410. end;
  411. ppufile.writeentry(id);
  412. p.Free;
  413. p:=hcontainer;
  414. end;
  415. procedure tppumodule.putasmsymbol_in_idx(s:tnamedindexitem;arg:pointer);
  416. begin
  417. if tasmsymbol(s).ppuidx<>-1 then
  418. librarydata.asmsymbolidx^[tasmsymbol(s).ppuidx-1]:=tasmsymbol(s);
  419. end;
  420. procedure tppumodule.writeasmsymbols;
  421. var
  422. s : tasmsymbol;
  423. i : longint;
  424. asmsymtype : byte;
  425. begin
  426. { get an ordered list of all symbols to put in the ppu }
  427. getmem(librarydata.asmsymbolidx,librarydata.asmsymbolppuidx*sizeof(pointer));
  428. fillchar(librarydata.asmsymbolidx^,librarydata.asmsymbolppuidx*sizeof(pointer),0);
  429. librarydata.symbolsearch.foreach({$ifdef FPCPROCVAR}@{$endif}putasmsymbol_in_idx,nil);
  430. { write the number of symbols }
  431. ppufile.putlongint(librarydata.asmsymbolppuidx);
  432. { write the symbols from the indexed list to the ppu }
  433. for i:=1 to librarydata.asmsymbolppuidx do
  434. begin
  435. s:=librarydata.asmsymbolidx^[i-1];
  436. if not assigned(s) then
  437. internalerror(200208071);
  438. asmsymtype:=1;
  439. if s.Classtype=tasmlabel then
  440. begin
  441. if tasmlabel(s).is_addr then
  442. asmsymtype:=4
  443. else if tasmlabel(s).typ=AT_DATA then
  444. asmsymtype:=3
  445. else
  446. asmsymtype:=2;
  447. end;
  448. ppufile.putbyte(asmsymtype);
  449. case asmsymtype of
  450. 1 :
  451. ppufile.putstring(s.name);
  452. 2 :
  453. ppufile.putlongint(tasmlabel(s).labelnr);
  454. end;
  455. ppufile.putbyte(byte(s.defbind));
  456. ppufile.putbyte(byte(s.typ));
  457. end;
  458. ppufile.writeentry(ibasmsymbols);
  459. end;
  460. procedure tppumodule.readusedmacros;
  461. var
  462. hs : string;
  463. mac : tmacro;
  464. was_defined_at_startup,
  465. was_used : boolean;
  466. begin
  467. { only possible when we've a scanner of the current file }
  468. if not assigned(current_scanner) then
  469. exit;
  470. while not ppufile.endofentry do
  471. begin
  472. hs:=ppufile.getstring;
  473. was_defined_at_startup:=boolean(ppufile.getbyte);
  474. was_used:=boolean(ppufile.getbyte);
  475. mac:=tmacro(tscannerfile(current_scanner).macros.search(hs));
  476. if assigned(mac) then
  477. begin
  478. {$ifndef EXTDEBUG}
  479. { if we don't have the sources why tell }
  480. if sources_avail then
  481. {$endif ndef EXTDEBUG}
  482. if (not was_defined_at_startup) and
  483. was_used and
  484. mac.defined_at_startup then
  485. Message2(unit_h_cond_not_set_in_last_compile,hs,mainsource^);
  486. end
  487. else { not assigned }
  488. if was_defined_at_startup and
  489. was_used then
  490. Message2(unit_h_cond_set_in_last_compile,hs,mainsource^);
  491. end;
  492. end;
  493. procedure tppumodule.readsourcefiles;
  494. var
  495. temp,hs : string;
  496. temp_dir : string;
  497. main_dir : string;
  498. incfile_found,
  499. main_found,
  500. is_main : boolean;
  501. orgfiletime,
  502. source_time : longint;
  503. hp : tinputfile;
  504. begin
  505. sources_avail:=true;
  506. is_main:=true;
  507. main_dir:='';
  508. while not ppufile.endofentry do
  509. begin
  510. hs:=ppufile.getstring;
  511. orgfiletime:=ppufile.getlongint;
  512. temp_dir:='';
  513. if (flags and uf_in_library)<>0 then
  514. begin
  515. sources_avail:=false;
  516. temp:=' library';
  517. end
  518. else if pos('Macro ',hs)=1 then
  519. begin
  520. { we don't want to find this file }
  521. { but there is a problem with file indexing !! }
  522. temp:='';
  523. end
  524. else
  525. begin
  526. { check the date of the source files }
  527. Source_Time:=GetNamedFileTime(path^+hs);
  528. incfile_found:=false;
  529. main_found:=false;
  530. if Source_Time<>-1 then
  531. hs:=path^+hs
  532. else
  533. if not(is_main) then
  534. begin
  535. Source_Time:=GetNamedFileTime(main_dir+hs);
  536. if Source_Time<>-1 then
  537. hs:=main_dir+hs;
  538. end;
  539. if (Source_Time=-1) then
  540. begin
  541. if is_main then
  542. main_found:=unitsearchpath.FindFile(hs,temp_dir)
  543. else
  544. incfile_found:=includesearchpath.FindFile(hs,temp_dir);
  545. if incfile_found or main_found then
  546. begin
  547. Source_Time:=GetNamedFileTime(temp_dir);
  548. if Source_Time<>-1 then
  549. hs:=temp_dir;
  550. end;
  551. end;
  552. if Source_Time=-1 then
  553. begin
  554. sources_avail:=false;
  555. temp:=' not found';
  556. end
  557. else
  558. begin
  559. if main_found then
  560. main_dir:=temp_dir;
  561. { time newer? But only allow if the file is not searched
  562. in the include path (PFV), else you've problems with
  563. units which use the same includefile names }
  564. if incfile_found then
  565. temp:=' found'
  566. else
  567. begin
  568. temp:=' time '+filetimestring(source_time);
  569. if (orgfiletime<>-1) and
  570. (source_time<>orgfiletime) then
  571. begin
  572. if ((flags and uf_release)=0) then
  573. begin
  574. do_compile:=true;
  575. recompile_reason:=rr_sourcenewer;
  576. end
  577. else
  578. Message2(unit_h_source_modified,hs,ppufilename^);
  579. temp:=temp+' *';
  580. end;
  581. end;
  582. end;
  583. hp:=tinputfile.create(hs);
  584. { the indexing is wrong here PM }
  585. sourcefiles.register_file(hp);
  586. end;
  587. if is_main then
  588. begin
  589. stringdispose(mainsource);
  590. mainsource:=stringdup(hs);
  591. end;
  592. Message1(unit_u_ppu_source,hs+temp);
  593. is_main:=false;
  594. end;
  595. { check if we want to rebuild every unit, only if the sources are
  596. available }
  597. if do_build and sources_avail and
  598. ((flags and uf_release)=0) then
  599. begin
  600. do_compile:=true;
  601. recompile_reason:=rr_build;
  602. end;
  603. end;
  604. procedure tppumodule.readloadunit;
  605. var
  606. hs : string;
  607. intfchecksum,
  608. checksum : cardinal;
  609. in_interface : boolean;
  610. begin
  611. while not ppufile.endofentry do
  612. begin
  613. hs:=ppufile.getstring;
  614. checksum:=cardinal(ppufile.getlongint);
  615. intfchecksum:=cardinal(ppufile.getlongint);
  616. in_interface:=(ppufile.getbyte<>0);
  617. used_units.concat(tused_unit.create_to_load(hs,checksum,intfchecksum,in_interface));
  618. end;
  619. end;
  620. procedure tppumodule.readlinkcontainer(var p:tlinkcontainer);
  621. var
  622. s : string;
  623. m : longint;
  624. begin
  625. while not ppufile.endofentry do
  626. begin
  627. s:=ppufile.getstring;
  628. m:=ppufile.getlongint;
  629. p.add(s,m);
  630. end;
  631. end;
  632. procedure tppumodule.readasmsymbols;
  633. var
  634. labelnr,
  635. i : longint;
  636. name : string;
  637. bind : TAsmSymBind;
  638. typ : TAsmSymType;
  639. asmsymtype : byte;
  640. begin
  641. librarydata.asmsymbolppuidx:=ppufile.getlongint;
  642. if librarydata.asmsymbolppuidx>0 then
  643. begin
  644. getmem(librarydata.asmsymbolidx,librarydata.asmsymbolppuidx*sizeof(pointer));
  645. fillchar(librarydata.asmsymbolidx^,librarydata.asmsymbolppuidx*sizeof(pointer),0);
  646. for i:=1 to librarydata.asmsymbolppuidx do
  647. begin
  648. asmsymtype:=ppufile.getbyte;
  649. case asmsymtype of
  650. 1 :
  651. name:=ppufile.getstring;
  652. 2..4 :
  653. labelnr:=ppufile.getlongint;
  654. else
  655. internalerror(200208192);
  656. end;
  657. bind:=tasmsymbind(ppufile.getbyte);
  658. typ:=tasmsymtype(ppufile.getbyte);
  659. case asmsymtype of
  660. 1 :
  661. librarydata.asmsymbolidx^[i-1]:=librarydata.newasmsymboltype(name,bind,typ);
  662. 2 :
  663. librarydata.asmsymbolidx^[i-1]:=librarydata.newasmlabel(labelnr,false,false);
  664. 3 :
  665. librarydata.asmsymbolidx^[i-1]:=librarydata.newasmlabel(labelnr,true,false);
  666. 4 :
  667. librarydata.asmsymbolidx^[i-1]:=librarydata.newasmlabel(labelnr,false,true);
  668. end;
  669. end;
  670. end;
  671. end;
  672. procedure tppumodule.load_interface;
  673. var
  674. b : byte;
  675. newmodulename : string;
  676. begin
  677. { read interface part }
  678. repeat
  679. b:=ppufile.readentry;
  680. case b of
  681. ibmodulename :
  682. begin
  683. newmodulename:=ppufile.getstring;
  684. if (cs_check_unit_name in aktglobalswitches) and
  685. (upper(newmodulename)<>modulename^) then
  686. Message2(unit_f_unit_name_error,realmodulename^,newmodulename);
  687. stringdispose(modulename);
  688. stringdispose(realmodulename);
  689. modulename:=stringdup(upper(newmodulename));
  690. realmodulename:=stringdup(newmodulename);
  691. end;
  692. ibsourcefiles :
  693. readsourcefiles;
  694. ibusedmacros :
  695. readusedmacros;
  696. ibloadunit :
  697. readloadunit;
  698. iblinkunitofiles :
  699. readlinkcontainer(LinkUnitOFiles);
  700. iblinkunitstaticlibs :
  701. readlinkcontainer(LinkUnitStaticLibs);
  702. iblinkunitsharedlibs :
  703. readlinkcontainer(LinkUnitSharedLibs);
  704. iblinkotherofiles :
  705. readlinkcontainer(LinkotherOFiles);
  706. iblinkotherstaticlibs :
  707. readlinkcontainer(LinkotherStaticLibs);
  708. iblinkothersharedlibs :
  709. readlinkcontainer(LinkotherSharedLibs);
  710. ibendinterface :
  711. break;
  712. else
  713. Message1(unit_f_ppu_invalid_entry,tostr(b));
  714. end;
  715. until false;
  716. end;
  717. procedure tppumodule.load_implementation;
  718. var
  719. b : byte;
  720. oldobjectlibrary : tasmlibrarydata;
  721. begin
  722. { read implementation part }
  723. repeat
  724. b:=ppufile.readentry;
  725. case b of
  726. ibasmsymbols :
  727. readasmsymbols;
  728. ibendimplementation :
  729. break;
  730. else
  731. Message1(unit_f_ppu_invalid_entry,tostr(b));
  732. end;
  733. until false;
  734. { we can now derefence all pointers to the implementation parts }
  735. oldobjectlibrary:=objectlibrary;
  736. objectlibrary:=librarydata;
  737. tstoredsymtable(globalsymtable).derefimpl;
  738. if assigned(localsymtable) then
  739. tstoredsymtable(localsymtable).derefimpl;
  740. objectlibrary:=oldobjectlibrary;
  741. end;
  742. procedure tppumodule.load_symtable_refs;
  743. var
  744. b : byte;
  745. unitindex : word;
  746. begin
  747. { load local symtable first }
  748. if ((flags and uf_local_browser)<>0) then
  749. begin
  750. localsymtable:=tstaticsymtable.create(modulename^);
  751. tstaticsymtable(localsymtable).ppuload(ppufile);
  752. end;
  753. { load browser }
  754. if (flags and uf_has_browser)<>0 then
  755. begin
  756. tstoredsymtable(globalsymtable).load_references(ppufile,true);
  757. unitindex:=1;
  758. while assigned(map^[unitindex]) do
  759. begin
  760. { each unit wrote one browser entry }
  761. tstoredsymtable(globalsymtable).load_references(ppufile,false);
  762. inc(unitindex);
  763. end;
  764. b:=ppufile.readentry;
  765. if b<>ibendbrowser then
  766. Message1(unit_f_ppu_invalid_entry,tostr(b));
  767. end;
  768. if ((flags and uf_local_browser)<>0) then
  769. tstaticsymtable(localsymtable).load_references(ppufile,true);
  770. end;
  771. procedure tppumodule.writeppu;
  772. var
  773. pu : tused_unit;
  774. begin
  775. Message1(unit_u_ppu_write,realmodulename^);
  776. { create unit flags }
  777. {$ifdef GDB}
  778. if cs_gdb_dbx in aktglobalswitches then
  779. flags:=flags or uf_has_dbx;
  780. {$endif GDB}
  781. if cs_browser in aktmoduleswitches then
  782. flags:=flags or uf_has_browser;
  783. if cs_local_browser in aktmoduleswitches then
  784. flags:=flags or uf_local_browser;
  785. if do_release then
  786. flags:=flags or uf_release;
  787. if (cs_fp_emulation in aktmoduleswitches) then
  788. flags:=flags or uf_fpu_emulation;
  789. {$ifdef Test_Double_checksum_write}
  790. Assign(CRCFile,s+'.IMP');
  791. Rewrite(CRCFile);
  792. {$endif def Test_Double_checksum_write}
  793. { create new ppufile }
  794. ppufile:=tcompilerppufile.create(ppufilename^);
  795. if not ppufile.createfile then
  796. Message(unit_f_ppu_cannot_write);
  797. { first the unitname }
  798. ppufile.putstring(realmodulename^);
  799. ppufile.writeentry(ibmodulename);
  800. writesourcefiles;
  801. writeusedmacros;
  802. writeusedunit;
  803. { write the objectfiles and libraries that come for this unit,
  804. preserve the containers becuase they are still needed to load
  805. the link.res. All doesn't depend on the crc! It doesn't matter
  806. if a unit is in a .o or .a file }
  807. ppufile.do_crc:=false;
  808. writelinkcontainer(linkunitofiles,iblinkunitofiles,true);
  809. writelinkcontainer(linkunitstaticlibs,iblinkunitstaticlibs,true);
  810. writelinkcontainer(linkunitsharedlibs,iblinkunitsharedlibs,true);
  811. writelinkcontainer(linkotherofiles,iblinkotherofiles,false);
  812. writelinkcontainer(linkotherstaticlibs,iblinkotherstaticlibs,true);
  813. writelinkcontainer(linkothersharedlibs,iblinkothersharedlibs,true);
  814. ppufile.do_crc:=true;
  815. ppufile.writeentry(ibendinterface);
  816. { write the symtable entries }
  817. tstoredsymtable(globalsymtable).ppuwrite(ppufile);
  818. { everything after this doesn't affect the crc }
  819. ppufile.do_crc:=false;
  820. { write asmsymbols }
  821. writeasmsymbols;
  822. { end of implementation }
  823. ppufile.writeentry(ibendimplementation);
  824. { write static symtable
  825. needed for local debugging of unit functions }
  826. if ((flags and uf_local_browser)<>0) and
  827. assigned(localsymtable) then
  828. tstoredsymtable(localsymtable).ppuwrite(ppufile);
  829. { write all browser section }
  830. if (flags and uf_has_browser)<>0 then
  831. begin
  832. tstoredsymtable(globalsymtable).write_references(ppufile,true);
  833. pu:=tused_unit(used_units.first);
  834. while assigned(pu) do
  835. begin
  836. tstoredsymtable(pu.u.globalsymtable).write_references(ppufile,false);
  837. pu:=tused_unit(pu.next);
  838. end;
  839. ppufile.writeentry(ibendbrowser);
  840. end;
  841. if ((flags and uf_local_browser)<>0) and
  842. assigned(localsymtable) then
  843. tstaticsymtable(localsymtable).write_references(ppufile,true);
  844. { the last entry ibend is written automaticly }
  845. { flush to be sure }
  846. ppufile.flush;
  847. { create and write header }
  848. ppufile.header.size:=ppufile.size;
  849. ppufile.header.checksum:=ppufile.crc;
  850. ppufile.header.interface_checksum:=ppufile.interface_crc;
  851. ppufile.header.compiler:=wordversion;
  852. ppufile.header.cpu:=word(target_cpu);
  853. ppufile.header.target:=word(target_info.system);
  854. ppufile.header.flags:=flags;
  855. ppufile.writeheader;
  856. { save crc in current module also }
  857. crc:=ppufile.crc;
  858. interface_crc:=ppufile.interface_crc;
  859. {$ifdef Test_Double_checksum_write}
  860. close(CRCFile);
  861. {$endif Test_Double_checksum_write}
  862. ppufile.closefile;
  863. ppufile.free;
  864. ppufile:=nil;
  865. end;
  866. procedure tppumodule.getppucrc;
  867. begin
  868. {$ifdef Test_Double_checksum_write}
  869. Assign(CRCFile,s+'.INT')
  870. Rewrite(CRCFile);
  871. {$endif def Test_Double_checksum_write}
  872. { create new ppufile }
  873. ppufile:=tcompilerppufile.create(ppufilename^);
  874. ppufile.crc_only:=true;
  875. if not ppufile.createfile then
  876. Message(unit_f_ppu_cannot_write);
  877. { first the unitname }
  878. ppufile.putstring(realmodulename^);
  879. ppufile.writeentry(ibmodulename);
  880. { the interface units affect the crc }
  881. writeusedunit;
  882. ppufile.writeentry(ibendinterface);
  883. { write the symtable entries }
  884. tstoredsymtable(globalsymtable).ppuwrite(ppufile);
  885. { save crc }
  886. crc:=ppufile.crc;
  887. interface_crc:=ppufile.interface_crc;
  888. {$ifdef Test_Double_checksum}
  889. crc_array:=ppufile.crc_test;
  890. ppufile.crc_test:=nil;
  891. crc_size:=ppufile.crc_index2;
  892. crc_array2:=ppufile.crc_test2;
  893. ppufile.crc_test2:=nil;
  894. crc_size2:=ppufile.crc_index2;
  895. {$endif Test_Double_checksum}
  896. {$ifdef Test_Double_checksum_write}
  897. close(CRCFile);
  898. {$endif Test_Double_checksum_write}
  899. ppufile.closefile;
  900. ppufile.free;
  901. ppufile:=nil;
  902. end;
  903. procedure tppumodule.load_usedunits;
  904. var
  905. pu : tused_unit;
  906. loaded_unit : tmodule;
  907. load_refs : boolean;
  908. nextmapentry : longint;
  909. begin
  910. load_refs:=true;
  911. { init the map }
  912. new(map);
  913. fillchar(map^,sizeof(tunitmap),#0);
  914. {$ifdef NEWMAP}
  915. map^[0]:=current_module;
  916. {$endif NEWMAP}
  917. nextmapentry:=1;
  918. { load the used units from interface }
  919. in_implementation:=false;
  920. pu:=tused_unit(used_units.first);
  921. while assigned(pu) do
  922. begin
  923. if (not pu.loaded) and (pu.in_interface) then
  924. begin
  925. loaded_unit:=loadunit(pu.realname^,'');
  926. if compiled then
  927. exit;
  928. { register unit in used units }
  929. pu.u:=loaded_unit;
  930. pu.loaded:=true;
  931. { doubles are not important for that list PM }
  932. pu.u.dependent_units.concat(tdependent_unit.create(self));
  933. { need to recompile the current unit ? }
  934. if loaded_unit.crc<>pu.checksum then
  935. begin
  936. Message2(unit_u_recompile_crc_change,realmodulename^,pu.realname^);
  937. recompile_reason:=rr_crcchanged;
  938. do_compile:=true;
  939. dispose(map);
  940. map:=nil;
  941. exit;
  942. end;
  943. { setup the map entry for deref }
  944. {$ifndef NEWMAP}
  945. map^[nextmapentry]:=loaded_unit.globalsymtable;
  946. {$else NEWMAP}
  947. map^[nextmapentry]:=loaded_unit;
  948. {$endif NEWMAP}
  949. inc(nextmapentry);
  950. if nextmapentry>maxunits then
  951. Message(unit_f_too_much_units);
  952. end;
  953. pu:=tused_unit(pu.next);
  954. end;
  955. { ok, now load the interface of this unit }
  956. if current_module<>self then
  957. internalerror(200208187);
  958. // current_module:=self;
  959. // SetCompileModule(current_module);
  960. globalsymtable:=tglobalsymtable.create(modulename^);
  961. tstoredsymtable(globalsymtable).ppuload(ppufile);
  962. { now only read the implementation uses }
  963. in_implementation:=true;
  964. pu:=tused_unit(used_units.first);
  965. while assigned(pu) do
  966. begin
  967. if (not pu.loaded) and (not pu.in_interface) then
  968. begin
  969. loaded_unit:=loadunit(pu.realname^,'');
  970. if compiled then
  971. exit;
  972. { register unit in used units }
  973. pu.u:=loaded_unit;
  974. pu.loaded:=true;
  975. { need to recompile the current unit ? }
  976. if (loaded_unit.interface_crc<>pu.interface_checksum) {and
  977. not(current_module.in_second_compile) } then
  978. begin
  979. Message2(unit_u_recompile_crc_change,realmodulename^,pu.realname^+' {impl}');
  980. recompile_reason:=rr_crcchanged;
  981. do_compile:=true;
  982. dispose(map);
  983. map:=nil;
  984. exit;
  985. end;
  986. { setup the map entry for deref }
  987. {$ifndef NEWMAP}
  988. map^[nextmapentry]:=loaded_unit.globalsymtable;
  989. {$else NEWMAP}
  990. map^[nextmapentry]:=loaded_unit;
  991. {$endif NEWMAP}
  992. inc(nextmapentry);
  993. if nextmapentry>maxunits then
  994. Message(unit_f_too_much_units);
  995. end;
  996. pu:=tused_unit(pu.next);
  997. end;
  998. { read the implementation/objectdata part }
  999. load_implementation;
  1000. { load browser info if stored }
  1001. if ((flags and uf_has_browser)<>0) and load_refs then
  1002. begin
  1003. if current_module<>self then
  1004. internalerror(200208188);
  1005. // current_module:=self;
  1006. load_symtable_refs;
  1007. end;
  1008. { remove the map, it's not needed anymore }
  1009. dispose(map);
  1010. map:=nil;
  1011. end;
  1012. procedure tppumodule.loadppu;
  1013. var
  1014. name : string;
  1015. begin
  1016. { load interface section }
  1017. if not do_compile then
  1018. load_interface;
  1019. { only load units when we don't recompile }
  1020. if not do_compile then
  1021. load_usedunits;
  1022. { recompile if set }
  1023. if do_compile then
  1024. begin
  1025. { we don't need the ppufile anymore }
  1026. if assigned(ppufile) then
  1027. begin
  1028. ppufile.free;
  1029. ppufile:=nil;
  1030. end;
  1031. { recompile the unit or give a fatal error if sources not available }
  1032. if not(sources_avail) and
  1033. not(sources_checked) then
  1034. if (not search_unit(modulename^,'',true))
  1035. and (length(modulename^)>8) then
  1036. search_unit(copy(modulename^,1,8),'',true);
  1037. if not(sources_avail) then
  1038. begin
  1039. if recompile_reason=rr_noppu then
  1040. Message1(unit_f_cant_find_ppu,modulename^)
  1041. else
  1042. Message1(unit_f_cant_compile_unit,modulename^);
  1043. end
  1044. else
  1045. begin
  1046. if in_compile then
  1047. begin
  1048. in_second_compile:=true;
  1049. Message1(parser_d_compiling_second_time,modulename^);
  1050. end;
  1051. name:=mainsource^;
  1052. { compile this module }
  1053. compile(name);
  1054. in_second_compile:=false;
  1055. end;
  1056. end;
  1057. if assigned(ppufile) then
  1058. begin
  1059. ppufile.closefile;
  1060. ppufile.free;
  1061. ppufile:=nil;
  1062. end;
  1063. end;
  1064. {*****************************************************************************
  1065. LoadUnit
  1066. *****************************************************************************}
  1067. function loadunit(const s : stringid;const fn:string) : tmodule;
  1068. const
  1069. ImplIntf : array[boolean] of string[15]=('interface','implementation');
  1070. var
  1071. st : tglobalsymtable;
  1072. second_time : boolean;
  1073. old_current_module,hp2 : tmodule;
  1074. hp : tppumodule;
  1075. scanner : tscannerfile;
  1076. dummy : tmodule;
  1077. ups : stringid;
  1078. begin
  1079. old_current_module:=current_module;
  1080. { we are loading a new module, save the state of the scanner
  1081. and reset scanner+module }
  1082. if assigned(current_scanner) then
  1083. current_scanner.tempcloseinputfile;
  1084. current_scanner:=nil;
  1085. current_module:=nil;
  1086. { Info }
  1087. Message3(unit_u_load_unit,old_current_module.modulename^,ImplIntf[old_current_module.in_implementation],s);
  1088. ups:=upper(s);
  1089. { unit not found }
  1090. st:=nil;
  1091. dummy:=nil;
  1092. { search all loaded units }
  1093. hp:=tppumodule(loaded_units.first);
  1094. while assigned(hp) do
  1095. begin
  1096. if hp.modulename^=ups then
  1097. begin
  1098. { forced to reload ? }
  1099. if hp.do_reload then
  1100. begin
  1101. hp.do_reload:=false;
  1102. break;
  1103. end;
  1104. { only check for units. The main program is also
  1105. as a unit in the loaded_units list. We simply need
  1106. to ignore this entry (PFV) }
  1107. if hp.is_unit then
  1108. begin
  1109. { the unit is already registered }
  1110. { and this means that the unit }
  1111. { is already compiled }
  1112. { else there is a cyclic unit use }
  1113. if assigned(hp.globalsymtable) then
  1114. st:=tglobalsymtable(hp.globalsymtable)
  1115. else
  1116. begin
  1117. { both units in interface ? }
  1118. if (not old_current_module.in_implementation) and
  1119. (not hp.in_implementation) then
  1120. begin
  1121. { check for a cycle }
  1122. hp2:=old_current_module.loaded_from;
  1123. while assigned(hp2) and (hp2<>hp) do
  1124. begin
  1125. if hp2.in_implementation then
  1126. hp2:=nil
  1127. else
  1128. hp2:=hp2.loaded_from;
  1129. end;
  1130. if assigned(hp2) then
  1131. Message2(unit_f_circular_unit_reference,old_current_module.modulename^,hp.modulename^);
  1132. end;
  1133. end;
  1134. break;
  1135. end;
  1136. end
  1137. else if copy(hp.modulename^,1,8)=ups then
  1138. dummy:=hp;
  1139. { the next unit }
  1140. hp:=tppumodule(hp.next);
  1141. end;
  1142. if assigned(dummy) and not assigned(hp) then
  1143. Message2(unit_w_unit_name_error,s,dummy.modulename^);
  1144. { the unit is not in the loaded units, we must load it first }
  1145. if (not assigned(st)) then
  1146. begin
  1147. if assigned(hp) then
  1148. begin
  1149. current_module:=hp;
  1150. { try to load the unit a second time first }
  1151. Message1(unit_u_second_load_unit,current_module.modulename^);
  1152. second_time:=true;
  1153. current_module.in_second_load:=true;
  1154. { remove the old unit }
  1155. loaded_units.remove(current_module);
  1156. current_module.reset;
  1157. { try to reopen ppu }
  1158. tppumodule(current_module).search_unit(s,fn,false);
  1159. end
  1160. else
  1161. { generates a new unit info record }
  1162. begin
  1163. current_module:=tppumodule.create(s,fn,true);
  1164. second_time:=false;
  1165. end;
  1166. { close old_current_ppu on system that are
  1167. short on file handles like DOS PM }
  1168. {$ifdef SHORT_ON_FILE_HANDLES}
  1169. if old_current_module.is_unit and
  1170. assigned(tppumodule(old_current_module).ppufile) then
  1171. tppumodule(old_current_module).ppufile.tempclose;
  1172. {$endif SHORT_ON_FILE_HANDLES}
  1173. { now we can register the unit }
  1174. current_module.loaded_from:=old_current_module;
  1175. loaded_units.insert(current_module);
  1176. { now realy load the ppu }
  1177. tppumodule(current_module).loadppu;
  1178. { set compiled flag }
  1179. current_module.compiled:=true;
  1180. { load return pointer }
  1181. hp:=tppumodule(current_module);
  1182. { for a second_time recompile reload all dependent units,
  1183. for a first time compile register the unit _once_ }
  1184. if second_time then
  1185. begin
  1186. { now reload all dependent units }
  1187. hp2:=tmodule(loaded_units.first);
  1188. while assigned(hp2) do
  1189. begin
  1190. if hp2.do_reload then
  1191. dummy:=loadunit(hp2.modulename^,'');
  1192. hp2:=tmodule(hp2.next);
  1193. end;
  1194. end
  1195. else
  1196. usedunits.concat(tused_unit.create(current_module,true));
  1197. end;
  1198. { set the old module }
  1199. {$ifdef SHORT_ON_FILE_HANDLES}
  1200. if old_current_module.is_unit and
  1201. assigned(tppumodule(old_current_module).ppufile) then
  1202. tppumodule(old_current_module).ppufile.tempopen;
  1203. {$endif SHORT_ON_FILE_HANDLES}
  1204. { we are back, restore current_module and current_scanner }
  1205. current_module:=old_current_module;
  1206. current_scanner:=tscannerfile(current_module.scanner);
  1207. if assigned(current_scanner) then
  1208. current_scanner.tempopeninputfile;
  1209. SetCompileModule(current_module);
  1210. loadunit:=hp;
  1211. end;
  1212. end.
  1213. {
  1214. $Log$
  1215. Revision 1.26 2002-11-15 01:58:46 peter
  1216. * merged changes from 1.0.7 up to 04-11
  1217. - -V option for generating bug report tracing
  1218. - more tracing for option parsing
  1219. - errors for cdecl and high()
  1220. - win32 import stabs
  1221. - win32 records<=8 are returned in eax:edx (turned off by default)
  1222. - heaptrc update
  1223. - more info for temp management in .s file with EXTDEBUG
  1224. Revision 1.25 2002/10/20 14:49:31 peter
  1225. * store original source time in ppu so it can be compared instead of
  1226. comparing with the ppu time
  1227. Revision 1.24 2002/10/04 20:13:10 peter
  1228. * set in_second_load flag before resetting the module, this is
  1229. required to skip some checkings
  1230. Revision 1.23 2002/08/19 19:36:42 peter
  1231. * More fixes for cross unit inlining, all tnodes are now implemented
  1232. * Moved pocall_internconst to po_internconst because it is not a
  1233. calling type at all and it conflicted when inlining of these small
  1234. functions was requested
  1235. Revision 1.22 2002/08/18 19:58:28 peter
  1236. * more current_scanner fixes
  1237. Revision 1.21 2002/08/15 15:09:41 carl
  1238. + fpu emulation helpers (ppu checking also)
  1239. Revision 1.20 2002/08/12 16:46:04 peter
  1240. * tscannerfile is now destroyed in tmodule.reset and current_scanner
  1241. is updated accordingly. This removes all the loading and saving of
  1242. the old scanner and the invalid flag marking
  1243. Revision 1.19 2002/08/11 14:28:19 peter
  1244. * TScannerFile.SetInvalid added that will also reset inputfile
  1245. Revision 1.18 2002/08/11 13:24:11 peter
  1246. * saving of asmsymbols in ppu supported
  1247. * asmsymbollist global is removed and moved into a new class
  1248. tasmlibrarydata that will hold the info of a .a file which
  1249. corresponds with a single module. Added librarydata to tmodule
  1250. to keep the library info stored for the module. In the future the
  1251. objectfiles will also be stored to the tasmlibrarydata class
  1252. * all getlabel/newasmsymbol and friends are moved to the new class
  1253. Revision 1.17 2002/07/26 21:15:37 florian
  1254. * rewrote the system handling
  1255. Revision 1.16 2002/05/16 19:46:36 carl
  1256. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1257. + try to fix temp allocation (still in ifdef)
  1258. + generic constructor calls
  1259. + start of tassembler / tmodulebase class cleanup
  1260. Revision 1.15 2002/05/14 19:34:41 peter
  1261. * removed old logs and updated copyright year
  1262. Revision 1.14 2002/05/12 16:53:05 peter
  1263. * moved entry and exitcode to ncgutil and cgobj
  1264. * foreach gets extra argument for passing local data to the
  1265. iterator function
  1266. * -CR checks also class typecasts at runtime by changing them
  1267. into as
  1268. * fixed compiler to cycle with the -CR option
  1269. * fixed stabs with elf writer, finally the global variables can
  1270. be watched
  1271. * removed a lot of routines from cga unit and replaced them by
  1272. calls to cgobj
  1273. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  1274. u32bit then the other is typecasted also to u32bit without giving
  1275. a rangecheck warning/error.
  1276. * fixed pascal calling method with reversing also the high tree in
  1277. the parast, detected by tcalcst3 test
  1278. Revision 1.13 2002/04/04 19:05:56 peter
  1279. * removed unused units
  1280. * use tlocation.size in cg.a_*loc*() routines
  1281. Revision 1.12 2002/03/28 20:46:44 carl
  1282. - remove go32v1 support
  1283. Revision 1.11 2002/01/19 14:20:13 peter
  1284. * check for -Un when loading ppu with wrong name
  1285. }