symppu.inc 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl, Pierre Muller
  4. Implementation of the reading of PPU Files for the symtable
  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. const
  19. {$ifdef FPC}
  20. ppubufsize=32768;
  21. {$ELSE}
  22. {$IFDEF USEOVERLAY}
  23. ppubufsize=512;
  24. {$ELSE}
  25. ppubufsize=4096;
  26. {$ENDIF}
  27. {$ENDIF}
  28. { define ORDERSOURCES}
  29. {*****************************************************************************
  30. PPU Writing
  31. *****************************************************************************}
  32. procedure writebyte(b:byte);
  33. begin
  34. current_ppu^.putbyte(b);
  35. end;
  36. procedure writeword(w:word);
  37. begin
  38. current_ppu^.putword(w);
  39. end;
  40. procedure writelong(l:longint);
  41. begin
  42. current_ppu^.putlongint(l);
  43. end;
  44. procedure writereal(d:bestreal);
  45. begin
  46. current_ppu^.putreal(d);
  47. end;
  48. procedure writestring(const s:string);
  49. begin
  50. current_ppu^.putstring(s);
  51. end;
  52. procedure writenormalset(var s); {You cannot pass an array[0..31] of byte!}
  53. begin
  54. current_ppu^.putdata(s,sizeof(tnormalset));
  55. end;
  56. procedure writesmallset(var s);
  57. begin
  58. current_ppu^.putdata(s,4);
  59. end;
  60. { posinfo is not relevant for changes in PPU }
  61. procedure writeposinfo(const p:tfileposinfo);
  62. var
  63. oldcrc : boolean;
  64. begin
  65. oldcrc:=current_ppu^.do_crc;
  66. current_ppu^.do_crc:=false;
  67. current_ppu^.putword(p.fileindex);
  68. current_ppu^.putlongint(p.line);
  69. current_ppu^.putword(p.column);
  70. current_ppu^.do_crc:=oldcrc;
  71. end;
  72. procedure writederef(p : psymtableentry);
  73. begin
  74. if p=nil then
  75. current_ppu^.putbyte(ord(derefnil))
  76. else
  77. begin
  78. { Static symtable ? }
  79. if p^.owner^.symtabletype=staticsymtable then
  80. begin
  81. current_ppu^.putbyte(ord(derefaktstaticindex));
  82. current_ppu^.putword(p^.indexnr);
  83. end
  84. { Local record/object symtable ? }
  85. else if (p^.owner=aktrecordsymtable) then
  86. begin
  87. current_ppu^.putbyte(ord(derefaktrecordindex));
  88. current_ppu^.putword(p^.indexnr);
  89. end
  90. else
  91. begin
  92. current_ppu^.putbyte(ord(derefindex));
  93. current_ppu^.putword(p^.indexnr);
  94. { Current unit symtable ? }
  95. repeat
  96. if not assigned(p) then
  97. internalerror(556655);
  98. case p^.owner^.symtabletype of
  99. { when writing the pseudo PPU file
  100. to get CRC values the globalsymtable is not yet
  101. a unitsymtable PM }
  102. {$ifndef Dont_use_double_checksum}
  103. globalsymtable,
  104. {$endif Dont_use_double_checksum}
  105. unitsymtable :
  106. begin
  107. current_ppu^.putbyte(ord(derefunit));
  108. current_ppu^.putword(p^.owner^.unitid);
  109. break;
  110. end;
  111. staticsymtable :
  112. begin
  113. current_ppu^.putbyte(ord(derefaktstaticindex));
  114. current_ppu^.putword(p^.indexnr);
  115. break;
  116. end;
  117. localsymtable :
  118. begin
  119. p:=p^.owner^.defowner;
  120. current_ppu^.putbyte(ord(dereflocal));
  121. current_ppu^.putword(p^.indexnr);
  122. end;
  123. parasymtable :
  124. begin
  125. p:=p^.owner^.defowner;
  126. current_ppu^.putbyte(ord(derefpara));
  127. current_ppu^.putword(p^.indexnr);
  128. end;
  129. objectsymtable,
  130. recordsymtable :
  131. begin
  132. p:=p^.owner^.defowner;
  133. current_ppu^.putbyte(ord(derefrecord));
  134. current_ppu^.putword(p^.indexnr);
  135. end;
  136. else
  137. internalerror(556656);
  138. end;
  139. until false;
  140. end;
  141. end;
  142. end;
  143. procedure writedefref(p : pdef);
  144. begin
  145. writederef(p);
  146. end;
  147. procedure writesymref(p : psym);
  148. begin
  149. writederef(p);
  150. end;
  151. procedure writesourcefiles;
  152. var
  153. hp : pinputfile;
  154. {$ifdef ORDERSOURCES}
  155. i,j : longint;
  156. {$endif ORDERSOURCES}
  157. begin
  158. { second write the used source files }
  159. current_ppu^.do_crc:=false;
  160. hp:=current_module^.sourcefiles^.files;
  161. {$ifdef ORDERSOURCES}
  162. { write source files directly in good order }
  163. j:=0;
  164. while assigned(hp) do
  165. begin
  166. inc(j);
  167. hp:=hp^.ref_next;
  168. end;
  169. while j>0 do
  170. begin
  171. hp:=current_module^.sourcefiles^.files;
  172. for i:=1 to j-1 do
  173. hp:=hp^.ref_next;
  174. current_ppu^.putstring(hp^.name^);
  175. dec(j);
  176. end;
  177. {$else not ORDERSOURCES}
  178. while assigned(hp) do
  179. begin
  180. { only name and extension }
  181. current_ppu^.putstring(hp^.name^);
  182. hp:=hp^.ref_next;
  183. end;
  184. {$endif ORDERSOURCES}
  185. current_ppu^.writeentry(ibsourcefiles);
  186. current_ppu^.do_crc:=true;
  187. end;
  188. procedure writeusedmacros;
  189. var
  190. hp : pmacrosym;
  191. i : longint;
  192. begin
  193. { second write the used source files }
  194. current_ppu^.do_crc:=false;
  195. for i:=1 to macros^.symindex^.count do
  196. begin
  197. hp:=pmacrosym(macros^.symindex^.search(i));
  198. { only used or init defined macros are stored }
  199. if hp^.is_used or hp^.defined_at_startup then
  200. begin
  201. current_ppu^.putstring(hp^.name);
  202. current_ppu^.putbyte(byte(hp^.defined_at_startup));
  203. current_ppu^.putbyte(byte(hp^.is_used));
  204. end;
  205. end;
  206. current_ppu^.writeentry(ibusedmacros);
  207. current_ppu^.do_crc:=true;
  208. end;
  209. procedure writeusedunit;
  210. var
  211. hp : pused_unit;
  212. begin
  213. numberunits;
  214. hp:=pused_unit(current_module^.used_units.first);
  215. while assigned(hp) do
  216. begin
  217. { implementation units should not change
  218. the CRC PM }
  219. current_ppu^.do_crc:=hp^.in_interface;
  220. current_ppu^.putstring(hp^.name^);
  221. { the checksum should not affect the crc of this unit ! (PFV) }
  222. current_ppu^.do_crc:=false;
  223. current_ppu^.putlongint(hp^.checksum);
  224. current_ppu^.putlongint(hp^.interface_checksum);
  225. current_ppu^.putbyte(byte(hp^.in_interface));
  226. current_ppu^.do_crc:=true;
  227. hp:=pused_unit(hp^.next);
  228. end;
  229. current_ppu^.do_interface_crc:=true;
  230. current_ppu^.writeentry(ibloadunit);
  231. end;
  232. procedure writelinkcontainer(var p:tlinkcontainer;id:byte;strippath:boolean);
  233. var
  234. hcontainer : tlinkcontainer;
  235. s : string;
  236. mask : longint;
  237. begin
  238. hcontainer.init;
  239. while not p.empty do
  240. begin
  241. s:=p.get(mask);
  242. if strippath then
  243. current_ppu^.putstring(SplitFileName(s))
  244. else
  245. current_ppu^.putstring(s);
  246. current_ppu^.putlongint(mask);
  247. hcontainer.insert(s,mask);
  248. end;
  249. current_ppu^.writeentry(id);
  250. p:=hcontainer;
  251. end;
  252. procedure writeunitas(const s : string;unittable : punitsymtable;only_crc : boolean);
  253. begin
  254. Message1(unit_u_ppu_write,s);
  255. { create unit flags }
  256. with Current_Module^ do
  257. begin
  258. {$ifdef GDB}
  259. if cs_gdb_dbx in aktglobalswitches then
  260. flags:=flags or uf_has_dbx;
  261. {$endif GDB}
  262. if target_os.endian=endian_big then
  263. flags:=flags or uf_big_endian;
  264. if cs_browser in aktmoduleswitches then
  265. flags:=flags or uf_has_browser;
  266. if cs_local_browser in aktmoduleswitches then
  267. flags:=flags or uf_local_browser;
  268. end;
  269. {$ifdef Test_Double_checksum_write}
  270. If only_crc then
  271. Assign(CRCFile,s+'.INT')
  272. else
  273. Assign(CRCFile,s+'.IMP');
  274. Rewrite(CRCFile);
  275. {$endif def Test_Double_checksum_write}
  276. { open ppufile }
  277. current_ppu:=new(pppufile,init(s));
  278. current_ppu^.crc_only:=only_crc;
  279. if not current_ppu^.create then
  280. Message(unit_f_ppu_cannot_write);
  281. {$ifdef Test_Double_checksum}
  282. if only_crc then
  283. begin
  284. new(current_ppu^.crc_test);
  285. new(current_ppu^.crc_test2);
  286. end
  287. else
  288. begin
  289. current_ppu^.crc_test:=Current_Module^.crc_array;
  290. current_ppu^.crc_index:=Current_Module^.crc_size;
  291. current_ppu^.crc_test2:=Current_Module^.crc_array2;
  292. current_ppu^.crc_index2:=Current_Module^.crc_size2;
  293. end;
  294. {$endif def Test_Double_checksum}
  295. current_ppu^.change_endian:=source_os.endian<>target_os.endian;
  296. { write symbols and definitions }
  297. unittable^.writeasunit;
  298. { flush to be sure }
  299. current_ppu^.flush;
  300. { create and write header }
  301. current_ppu^.header.size:=current_ppu^.size;
  302. current_ppu^.header.checksum:=current_ppu^.crc;
  303. current_ppu^.header.interface_checksum:=current_ppu^.interface_crc;
  304. current_ppu^.header.compiler:=wordversion;
  305. current_ppu^.header.cpu:=word(target_cpu);
  306. current_ppu^.header.target:=word(target_info.target);
  307. current_ppu^.header.flags:=current_module^.flags;
  308. If not only_crc then
  309. current_ppu^.writeheader;
  310. { save crc in current_module also }
  311. current_module^.crc:=current_ppu^.crc;
  312. current_module^.interface_crc:=current_ppu^.interface_crc;
  313. if only_crc then
  314. begin
  315. {$ifdef Test_Double_checksum}
  316. Current_Module^.crc_array:=current_ppu^.crc_test;
  317. current_ppu^.crc_test:=nil;
  318. Current_Module^.crc_size:=current_ppu^.crc_index2;
  319. Current_Module^.crc_array2:=current_ppu^.crc_test2;
  320. current_ppu^.crc_test2:=nil;
  321. Current_Module^.crc_size2:=current_ppu^.crc_index2;
  322. {$endif def Test_Double_checksum}
  323. closecurrentppu;
  324. end;
  325. {$ifdef Test_Double_checksum_write}
  326. close(CRCFile);
  327. {$endif Test_Double_checksum_write}
  328. end;
  329. procedure closecurrentppu;
  330. begin
  331. {$ifdef Test_Double_checksum}
  332. if assigned(current_ppu^.crc_test) then
  333. dispose(current_ppu^.crc_test);
  334. if assigned(current_ppu^.crc_test2) then
  335. dispose(current_ppu^.crc_test2);
  336. {$endif Test_Double_checksum}
  337. { close }
  338. current_ppu^.close;
  339. dispose(current_ppu,done);
  340. current_ppu:=nil;
  341. end;
  342. {*****************************************************************************
  343. PPU Reading
  344. *****************************************************************************}
  345. function readbyte:byte;
  346. begin
  347. readbyte:=current_ppu^.getbyte;
  348. if current_ppu^.error then
  349. Message(unit_f_ppu_read_error);
  350. end;
  351. function readword:word;
  352. begin
  353. readword:=current_ppu^.getword;
  354. if current_ppu^.error then
  355. Message(unit_f_ppu_read_error);
  356. end;
  357. function readlong:longint;
  358. begin
  359. readlong:=current_ppu^.getlongint;
  360. if current_ppu^.error then
  361. Message(unit_f_ppu_read_error);
  362. end;
  363. function readreal : bestreal;
  364. begin
  365. readreal:=current_ppu^.getreal;
  366. if current_ppu^.error then
  367. Message(unit_f_ppu_read_error);
  368. end;
  369. function readstring : string;
  370. begin
  371. readstring:=current_ppu^.getstring;
  372. if current_ppu^.error then
  373. Message(unit_f_ppu_read_error);
  374. end;
  375. procedure readnormalset(var s); {You cannot pass an array [0..31] of byte.}
  376. begin
  377. current_ppu^.getdata(s,sizeof(tnormalset));
  378. if current_ppu^.error then
  379. Message(unit_f_ppu_read_error);
  380. end;
  381. procedure readsmallset(var s);
  382. begin
  383. current_ppu^.getdata(s,4);
  384. if current_ppu^.error then
  385. Message(unit_f_ppu_read_error);
  386. end;
  387. procedure readposinfo(var p:tfileposinfo);
  388. begin
  389. p.fileindex:=current_ppu^.getword;
  390. p.line:=current_ppu^.getlongint;
  391. p.column:=current_ppu^.getword;
  392. end;
  393. {$ifndef OLDDEREF}
  394. function readderef : pderef;
  395. var
  396. hp,p : pderef;
  397. b : tdereftype;
  398. begin
  399. p:=nil;
  400. repeat
  401. hp:=p;
  402. b:=tdereftype(current_ppu^.getbyte);
  403. case b of
  404. derefnil :
  405. break;
  406. derefunit,
  407. derefaktrecordindex,
  408. derefaktstaticindex :
  409. begin
  410. new(p,init(b,current_ppu^.getword));
  411. p^.next:=hp;
  412. break;
  413. end;
  414. derefindex,
  415. derefrecord :
  416. begin
  417. new(p,init(b,current_ppu^.getword));
  418. p^.next:=hp;
  419. end;
  420. end;
  421. until false;
  422. readderef:=p;
  423. end;
  424. function readdefref : pdef;
  425. begin
  426. readdefref:=pdef(readderef);
  427. end;
  428. function readsymref : psym;
  429. begin
  430. readsymref:=psym(readderef);
  431. end;
  432. {$else}
  433. function readdefref : pdef;
  434. var
  435. hd : pdef;
  436. begin
  437. longint(hd):=current_ppu^.getword;
  438. longint(hd):=longint(hd) or (longint(current_ppu^.getword) shl 16);
  439. readdefref:=hd;
  440. end;
  441. function readsymref : psym;
  442. var
  443. hd : psym;
  444. begin
  445. longint(hd):=current_ppu^.getword;
  446. longint(hd):=longint(hd) or (longint(current_ppu^.getword) shl 16);
  447. readsymref:=hd;
  448. end;
  449. {$endif}
  450. procedure readusedmacros;
  451. var
  452. hs : string;
  453. mac : pmacrosym;
  454. was_defined_at_startup,
  455. was_used : boolean;
  456. begin
  457. while not current_ppu^.endofentry do
  458. begin
  459. hs:=current_ppu^.getstring;
  460. was_defined_at_startup:=boolean(current_ppu^.getbyte);
  461. was_used:=boolean(current_ppu^.getbyte);
  462. mac:=pmacrosym(macros^.search(hs));
  463. if assigned(mac)
  464. {$ifndef EXTDEBUG}
  465. { if we don't have the sources why tell }
  466. and current_module^.sources_avail
  467. {$endif ndef EXTDEBUG}
  468. then
  469. begin
  470. if not was_defined_at_startup and was_used and
  471. mac^.defined_at_startup then
  472. Comment(V_Hint,'Conditional '+hs+' was not set at startup '+
  473. 'in last compilation of '+current_module^.mainsource^);
  474. end
  475. else { not assigned }
  476. if was_defined_at_startup and was_used then
  477. Comment(V_Hint,'Conditional '+hs+' was set at startup '+
  478. 'in last compilation of '+current_module^.mainsource^);
  479. end;
  480. end;
  481. procedure readsourcefiles;
  482. var
  483. temp,hs : string;
  484. {$ifdef ORDERSOURCES}
  485. main_dir : string;
  486. {$endif ORDERSOURCES}
  487. incfile_found,
  488. main_found,
  489. is_main : boolean;
  490. ppufiletime,
  491. source_time : longint;
  492. hp : pinputfile;
  493. begin
  494. ppufiletime:=getnamedfiletime(current_module^.ppufilename^);
  495. current_module^.sources_avail:=true;
  496. {$ifdef ORDERSOURCES}
  497. is_main:=true;
  498. main_dir:='';
  499. {$endif ORDERSOURCES}
  500. while not current_ppu^.endofentry do
  501. begin
  502. hs:=current_ppu^.getstring;
  503. {$ifndef ORDERSOURCES}
  504. is_main:=current_ppu^.endofentry;
  505. {$endif ORDERSOURCES}
  506. temp:='';
  507. if (current_module^.flags and uf_in_library)<>0 then
  508. begin
  509. current_module^.sources_avail:=false;
  510. temp:=' library';
  511. end
  512. else if pos('Macro ',hs)=1 then
  513. begin
  514. { we don't want to find this file }
  515. { but there is a problem with file indexing !! }
  516. temp:='';
  517. end
  518. else
  519. begin
  520. { check the date of the source files }
  521. Source_Time:=GetNamedFileTime(current_module^.path^+hs);
  522. incfile_found:=false;
  523. if Source_Time<>-1 then
  524. hs:=current_module^.path^+hs
  525. {$ifdef ORDERSOURCES}
  526. else if not(is_main) then
  527. begin
  528. Source_Time:=GetNamedFileTime(main_dir+hs);
  529. if Source_Time<>-1 then
  530. hs:=main_dir+hs;
  531. end
  532. {$endif def ORDERSOURCES}
  533. ;
  534. if (Source_Time=-1) then
  535. begin
  536. if is_main then
  537. temp:=search(hs,unitsearchpath,main_found)
  538. else
  539. temp:=search(hs,includesearchpath,incfile_found);
  540. {$ifdef ORDERSOURCES}
  541. if is_main then
  542. begin
  543. stringdispose(current_module^.mainsource);
  544. current_module^.mainsource:=stringdup(hs);
  545. if main_found then
  546. main_dir:=temp;
  547. end;
  548. {$endif ORDERSOURCES}
  549. if incfile_found or main_found then
  550. begin
  551. hs:=temp+hs;
  552. Source_Time:=GetNamedFileTime(hs);
  553. end
  554. end;
  555. if Source_Time=-1 then
  556. begin
  557. current_module^.sources_avail:=false;
  558. temp:=' not found';
  559. end
  560. else
  561. begin
  562. { time newer? But only allow if the file is not searched
  563. in the include path (PFV), else you've problems with
  564. units which use the same includefile names }
  565. if incfile_found then
  566. temp:=' found'
  567. else
  568. begin
  569. temp:=' time '+filetimestring(source_time);
  570. if (source_time>ppufiletime) then
  571. begin
  572. current_module^.do_compile:=true;
  573. current_module^.recompile_reason:=rr_sourcenewer;
  574. temp:=temp+' *'
  575. end;
  576. end;
  577. end;
  578. new(hp,init(hs));
  579. { the indexing is wrong here PM }
  580. current_module^.sourcefiles^.register_file(hp);
  581. end;
  582. Message1(unit_u_ppu_source,hs+temp);
  583. {$ifdef ORDERSOURCES}
  584. is_main:=false;
  585. {$endif ORDERSOURCES}
  586. end;
  587. {$ifndef ORDERSOURCES}
  588. { main source is always the last }
  589. stringdispose(current_module^.mainsource);
  590. current_module^.mainsource:=stringdup(hs);
  591. { the indexing is corrected here PM }
  592. current_module^.sourcefiles^.inverse_register_indexes;
  593. {$endif ORDERSOURCES}
  594. { check if we want to rebuild every unit, only if the sources are
  595. available }
  596. if do_build and current_module^.sources_avail then
  597. begin
  598. current_module^.do_compile:=true;
  599. current_module^.recompile_reason:=rr_build;
  600. end;
  601. end;
  602. procedure readloadunit;
  603. var
  604. hs : string;
  605. intfchecksum,
  606. checksum : longint;
  607. in_interface : boolean;
  608. begin
  609. while not current_ppu^.endofentry do
  610. begin
  611. hs:=current_ppu^.getstring;
  612. checksum:=current_ppu^.getlongint;
  613. intfchecksum:=current_ppu^.getlongint;
  614. in_interface:=(current_ppu^.getbyte<>0);
  615. current_module^.used_units.concat(new(pused_unit,init_to_load(hs,checksum,intfchecksum,in_interface)));
  616. end;
  617. end;
  618. procedure readlinkcontainer(var p:tlinkcontainer);
  619. var
  620. s : string;
  621. m : longint;
  622. begin
  623. while not current_ppu^.endofentry do
  624. begin
  625. s:=current_ppu^.getstring;
  626. m:=current_ppu^.getlongint;
  627. p.insert(s,m);
  628. end;
  629. end;
  630. procedure load_interface;
  631. var
  632. b : byte;
  633. newmodulename : pstring;
  634. begin
  635. { read interface part }
  636. repeat
  637. b:=current_ppu^.readentry;
  638. case b of
  639. ibmodulename :
  640. begin
  641. newmodulename:=stringdup(current_ppu^.getstring);
  642. if newmodulename^<>current_module^.modulename^ then
  643. Message2(unit_f_unit_name_error,current_module^.modulename^,newmodulename^);
  644. stringdispose(current_module^.modulename);
  645. current_module^.modulename:=newmodulename;
  646. end;
  647. ibsourcefiles :
  648. readsourcefiles;
  649. ibusedmacros :
  650. readusedmacros;
  651. ibloadunit :
  652. readloadunit;
  653. iblinkunitofiles :
  654. readlinkcontainer(current_module^.LinkUnitOFiles);
  655. iblinkunitstaticlibs :
  656. readlinkcontainer(current_module^.LinkUnitStaticLibs);
  657. iblinkunitsharedlibs :
  658. readlinkcontainer(current_module^.LinkUnitSharedLibs);
  659. iblinkotherofiles :
  660. readlinkcontainer(current_module^.LinkotherOFiles);
  661. iblinkotherstaticlibs :
  662. readlinkcontainer(current_module^.LinkotherStaticLibs);
  663. iblinkothersharedlibs :
  664. readlinkcontainer(current_module^.LinkotherSharedLibs);
  665. ibendinterface :
  666. break;
  667. else
  668. Message1(unit_f_ppu_invalid_entry,tostr(b));
  669. end;
  670. until false;
  671. end;
  672. {
  673. $Log$
  674. Revision 1.51 1999-09-16 13:27:08 pierre
  675. + error if PPU modulename is different from what is searched
  676. (8+3 limitations!)
  677. + cond ORDERSOURCES to allow recompilation of FP
  678. if symppu.inc is changed (need PPUversion change!)
  679. Revision 1.50 1999/09/12 15:45:11 florian
  680. * tnamedindexobject._name should be never accessed direct! Use the
  681. function name instead
  682. Revision 1.49 1999/09/03 10:54:22 pierre
  683. * message about conditionals changed to Hint
  684. Revision 1.48 1999/08/31 15:47:56 pierre
  685. + startup conditionals stored in PPU file for debug info
  686. Revision 1.47 1999/08/27 10:54:45 pierre
  687. * some code adapted to CRC_only computation
  688. + main file is search in unitspathlist
  689. and triggers do_compile flag
  690. * some changes to get identical CRC vaules after
  691. interface and after implementation
  692. Revision 1.46 1999/08/13 21:33:12 peter
  693. * support for array constructors extended and more error checking
  694. Revision 1.45 1999/08/03 22:03:17 peter
  695. * moved bitmask constants to sets
  696. * some other type/const renamings
  697. Revision 1.44 1999/07/14 21:19:12 florian
  698. + implemented a better error message if a PPU file isn't found as suggested
  699. by Lee John
  700. Revision 1.43 1999/07/03 00:30:00 peter
  701. * new link writing to the ppu, one .ppu is needed for all link types,
  702. static (.o) is now always created also when smartlinking is used
  703. Revision 1.42 1999/06/22 16:24:47 pierre
  704. * local browser stuff corrected
  705. Revision 1.41 1999/05/14 17:52:28 peter
  706. * new deref code
  707. Revision 1.40 1999/05/13 21:59:44 peter
  708. * removed oldppu code
  709. * warning if objpas is loaded from uses
  710. * first things for new deref writing
  711. Revision 1.39 1999/05/04 21:45:06 florian
  712. * changes to compile it with Delphi 4.0
  713. Revision 1.38 1999/04/26 13:31:51 peter
  714. * release storenumber,double_checksum
  715. Revision 1.37 1999/04/21 09:43:53 peter
  716. * storenumber works
  717. * fixed some typos in double_checksum
  718. + incompatible types type1 and type2 message (with storenumber)
  719. Revision 1.36 1999/04/14 09:15:01 peter
  720. * first things to store the symbol/def number in the ppu
  721. Revision 1.35 1999/04/07 15:39:35 pierre
  722. + double_checksum code added
  723. Revision 1.34 1999/03/02 13:49:19 peter
  724. * renamed loadunit_int -> loadunit
  725. Revision 1.33 1999/02/23 18:29:25 pierre
  726. * win32 compilation error fix
  727. + some work for local browser (not cl=omplete yet)
  728. Revision 1.32 1999/02/22 13:07:08 pierre
  729. + -b and -bl options work !
  730. + cs_local_browser ($L+) is disabled if cs_browser ($Y+)
  731. is not enabled when quitting global section
  732. * local vars and procedures are not yet stored into PPU
  733. Revision 1.31 1999/02/16 00:48:25 peter
  734. * save in the ppu if linked with obj file instead of using the
  735. library flag, so the .inc files are also checked
  736. Revision 1.30 1999/02/05 08:54:30 pierre
  737. + linkofiles splitted inot linkofiles and linkunitfiles
  738. because linkofiles must be stored with directory
  739. to enabled linking of different objects with same name
  740. in a different directory
  741. Revision 1.29 1999/01/20 10:16:46 peter
  742. * don't update crc when writing objs,libs and sources
  743. Revision 1.28 1999/01/12 14:25:35 peter
  744. + BrowserLog for browser.log generation
  745. + BrowserCol for browser info in TCollections
  746. * released all other UseBrowser
  747. Revision 1.27 1998/12/08 10:18:14 peter
  748. + -gh for heaptrc unit
  749. Revision 1.26 1998/11/26 14:36:02 peter
  750. * set also library flag if smartlinking and outputname is different
  751. Revision 1.25 1998/10/26 09:35:47 peter
  752. * don't count includefiles which are found in the includepath for a
  753. recompile.
  754. Revision 1.24 1998/10/20 08:06:59 pierre
  755. * several memory corruptions due to double freemem solved
  756. => never use p^.loc.location:=p^.left^.loc.location;
  757. + finally I added now by default
  758. that ra386dir translates global and unit symbols
  759. + added a first field in tsymtable and
  760. a nextsym field in tsym
  761. (this allows to obtain ordered type info for
  762. records and objects in gdb !)
  763. Revision 1.23 1998/10/16 13:37:24 florian
  764. + switch -FD added to specify the path for utilities
  765. Revision 1.22 1998/10/14 13:38:24 peter
  766. * fixed path with staticlib/objects in ppufiles
  767. Revision 1.21 1998/10/14 10:45:10 pierre
  768. * ppu problems for m68k fixed (at least in cross compiling)
  769. * one last memory leak for sysamiga fixed
  770. * the amiga RTL compiles now completely !!
  771. Revision 1.20 1998/10/13 13:10:30 peter
  772. * new style for m68k/i386 infos and enums
  773. Revision 1.19 1998/10/08 23:29:07 peter
  774. * -vu shows unit info, -vt shows tried/used files
  775. Revision 1.18 1998/09/28 16:57:27 pierre
  776. * changed all length(p^.value_str^) into str_length(p)
  777. to get it work with and without ansistrings
  778. * changed sourcefiles field of tmodule to a pointer
  779. Revision 1.17 1998/09/22 17:13:53 pierre
  780. + browsing updated and developed
  781. records and objects fields are also stored
  782. Revision 1.16 1998/09/22 15:40:56 peter
  783. * some extra ifdef GDB
  784. Revision 1.15 1998/09/21 08:45:23 pierre
  785. + added vmt_offset in tobjectdef.write for fututre use
  786. (first steps to have objects without vmt if no virtual !!)
  787. + added fpu_used field for tabstractprocdef :
  788. sets this level to 2 if the functions return with value in FPU
  789. (is then set to correct value at parsing of implementation)
  790. THIS MIGHT refuse some code with FPU expression too complex
  791. that were accepted before and even in some cases
  792. that don't overflow in fact
  793. ( like if f : float; is a forward that finally in implementation
  794. only uses one fpu register !!)
  795. Nevertheless I think that it will improve security on
  796. FPU operations !!
  797. * most other changes only for UseBrowser code
  798. (added symtable references for record and objects)
  799. local switch for refs to args and local of each function
  800. (static symtable still missing)
  801. UseBrowser still not stable and probably broken by
  802. the definition hash array !!
  803. Revision 1.14 1998/09/01 07:54:24 pierre
  804. * UseBrowser a little updated (might still be buggy !!)
  805. * bug in psub.pas in function specifier removed
  806. * stdcall allowed in interface and in implementation
  807. (FPC will not yet complain if it is missing in either part
  808. because stdcall is only a dummy !!)
  809. Revision 1.13 1998/08/17 10:10:11 peter
  810. - removed OLDPPU
  811. Revision 1.12 1998/08/17 09:17:53 peter
  812. * static/shared linking updates
  813. Revision 1.11 1998/08/16 20:32:49 peter
  814. * crcs of used units are not important for the current crc, reduces the
  815. amount of recompiles
  816. Revision 1.10 1998/08/13 10:57:30 peter
  817. * constant sets are now written correctly to the ppufile
  818. Revision 1.9 1998/08/11 15:31:41 peter
  819. * write extended to ppu file
  820. * new version 0.99.7
  821. Revision 1.8 1998/08/10 14:50:29 peter
  822. + localswitches, moduleswitches, globalswitches splitting
  823. Revision 1.7 1998/07/14 14:47:07 peter
  824. * released NEWINPUT
  825. Revision 1.6 1998/07/07 11:20:14 peter
  826. + NEWINPUT for a better inputfile and scanner object
  827. Revision 1.5 1998/06/24 14:48:39 peter
  828. * ifdef newppu -> ifndef oldppu
  829. Revision 1.4 1998/06/16 08:56:32 peter
  830. + targetcpu
  831. * cleaner pmodules for newppu
  832. Revision 1.3 1998/06/13 00:10:17 peter
  833. * working browser and newppu
  834. * some small fixes against crashes which occured in bp7 (but not in
  835. fpc?!)
  836. Revision 1.2 1998/05/28 14:40:28 peter
  837. * fixes for newppu, remake3 works now with it
  838. Revision 1.1 1998/05/27 19:45:09 peter
  839. * symtable.pas splitted into includefiles
  840. * symtable adapted for $ifdef NEWPPU
  841. }