pmodules.pas 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Florian Klaempfl
  4. Handles the parsing and loading of the modules (ppufiles)
  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 pmodules;
  19. {.$define TEST_IMPL does not work well }
  20. interface
  21. procedure proc_unit;
  22. procedure proc_program(islibrary : boolean);
  23. implementation
  24. uses
  25. cobjects,comphook,systems,globals,
  26. symtable,aasm,files,
  27. hcodegen,verbose,
  28. link,assemble,import,gendef,ppu
  29. {$ifdef i386}
  30. ,i386
  31. {$endif}
  32. {$ifdef m68k}
  33. ,m68k
  34. {$endif}
  35. ,scanner,pbase,psystem,pdecl,psub,parser;
  36. procedure create_objectfile;
  37. begin
  38. { create the .s file and assemble it }
  39. GenerateAsm;
  40. { When creating a library call the linker. And insert the output
  41. of the linker files }
  42. if (cs_create_sharedlib in aktmoduleswitches) then
  43. Linker.MakeSharedLibrary
  44. else
  45. if (cs_create_staticlib in aktmoduleswitches) or
  46. (cs_smartlink in aktmoduleswitches) then
  47. Linker.MakeStaticLibrary(SmartLinkFilesCnt);
  48. { add the files for the linker from current_module }
  49. Linker.AddModuleFiles(current_module);
  50. end;
  51. procedure insertobjectfile;
  52. { Insert the used object file for this unit in the used list for this unit }
  53. begin
  54. if (cs_create_sharedlib in aktmoduleswitches) then
  55. current_module^.linksharedlibs.insert(current_module^.sharedlibfilename^)
  56. else
  57. begin
  58. if (cs_create_staticlib in aktmoduleswitches) or
  59. (cs_smartlink in aktmoduleswitches) then
  60. current_module^.linkstaticlibs.insert(current_module^.staticlibfilename^)
  61. else
  62. current_module^.linkofiles.insert(current_module^.objfilename^);
  63. end;
  64. end;
  65. procedure insertsegment;
  66. procedure fixseg(p:paasmoutput;sec:tsection);
  67. begin
  68. p^.insert(new(pai_section,init(sec)));
  69. if (cs_smartlink in aktmoduleswitches) then
  70. p^.insert(new(pai_cut,init));
  71. p^.concat(new(pai_section,init(sec_none)));
  72. end;
  73. begin
  74. {Insert Ident of the compiler}
  75. if (not (cs_smartlink in aktmoduleswitches))
  76. {$ifndef EXTDEBUG}
  77. and (not current_module^.is_unit)
  78. {$endif}
  79. then
  80. begin
  81. datasegment^.insert(new(pai_align,init(4)));
  82. datasegment^.insert(new(pai_string,init('FPC '+version_string+' for '+target_string+' - '+target_info.short_name)));
  83. end;
  84. { Insert start and end of sections }
  85. fixseg(codesegment,sec_code);
  86. fixseg(datasegment,sec_data);
  87. fixseg(bsssegment,sec_bss);
  88. fixseg(consts,sec_data);
  89. end;
  90. procedure insertheap;
  91. begin
  92. if (cs_smartlink in aktmoduleswitches) then
  93. begin
  94. bsssegment^.concat(new(pai_cut,init));
  95. datasegment^.concat(new(pai_cut,init));
  96. end;
  97. { On the Macintosh Classic M68k Architecture
  98. The Heap variable is simply a POINTER to the
  99. real HEAP. The HEAP must be set up by the RTL
  100. and must store the pointer in this value.
  101. On OS/2 the heap is also intialized by the RTL. We do
  102. not output a pointer }
  103. case target_info.target of
  104. {$ifdef i386}
  105. target_OS2 : ;
  106. {$endif i386}
  107. {$ifdef m68k}
  108. target_Mac68K : bsssegment^.concat(new(pai_datablock,init_global('HEAP',4)));
  109. {$endif m68k}
  110. else
  111. bsssegment^.concat(new(pai_datablock,init_global('HEAP',heapsize)));
  112. end;
  113. {$ifdef i386}
  114. datasegment^.concat(new(pai_symbol,init_global('HEAPSIZE')));
  115. {$endif i386}
  116. {$ifdef m68k}
  117. datasegment^.concat(new(pai_symbol,init_global('HEAP_SIZE')));
  118. {$endif m68k}
  119. datasegment^.concat(new(pai_const,init_32bit(heapsize)));
  120. end;
  121. procedure inserttargetspecific;
  122. begin
  123. case target_info.target of
  124. {$ifdef i386}
  125. target_GO32V2 : begin
  126. { stacksize can be specified }
  127. datasegment^.concat(new(pai_symbol,init_global('__stklen')));
  128. datasegment^.concat(new(pai_const,init_32bit(stacksize)));
  129. end;
  130. target_WIN32 : begin
  131. { Generate an external entry to be sure that _mainCRTStarup will be
  132. linked, can't use concat_external because those aren't written for
  133. asw (PFV) }
  134. datasegment^.concat(new(pai_const,init_symbol('_mainCRTStartup')));
  135. end;
  136. {$endif i386}
  137. {$ifdef m68k}
  138. target_Atari : begin
  139. { stacksize can be specified }
  140. datasegment^.concat(new(pai_symbol,init_global('__stklen')));
  141. datasegment^.concat(new(pai_const,init_32bit(stacksize)));
  142. end;
  143. {$endif m68k}
  144. end;
  145. end;
  146. function loadunit(const s : string;compile_system:boolean) : pmodule;forward;
  147. procedure load_usedunits(compile_system:boolean);
  148. var
  149. pu : pused_unit;
  150. loaded_unit : pmodule;
  151. nextmapentry : longint;
  152. begin
  153. { init the map }
  154. new(current_module^.map);
  155. fillchar(current_module^.map^,sizeof(tunitmap),#0);
  156. {$ifdef NEWMAP}
  157. current_module^.map^[0]:=current_module;
  158. {$endif NEWMAP}
  159. nextmapentry:=1;
  160. { load the used units from interface }
  161. current_module^.in_implementation:=false;
  162. pu:=pused_unit(current_module^.used_units.first);
  163. while assigned(pu) do
  164. begin
  165. if (not pu^.loaded) and (pu^.in_interface) then
  166. begin
  167. loaded_unit:=loadunit(pu^.name^,false);
  168. if current_module^.compiled then
  169. exit;
  170. { register unit in used units }
  171. pu^.u:=loaded_unit;
  172. pu^.loaded:=true;
  173. { need to recompile the current unit ? }
  174. if loaded_unit^.crc<>pu^.checksum then
  175. begin
  176. Message2(unit_u_recompile_crc_change,current_module^.modulename^,pu^.name^);
  177. current_module^.do_compile:=true;
  178. dispose(current_module^.map);
  179. current_module^.map:=nil;
  180. exit;
  181. end;
  182. { setup the map entry for deref }
  183. {$ifndef NEWMAP}
  184. current_module^.map^[nextmapentry]:=loaded_unit^.globalsymtable;
  185. {$else NEWMAP}
  186. current_module^.map^[nextmapentry]:=loaded_unit;
  187. {$endif NEWMAP}
  188. inc(nextmapentry);
  189. if nextmapentry>maxunits then
  190. Message(unit_f_too_much_units);
  191. end;
  192. pu:=pused_unit(pu^.next);
  193. end;
  194. { ok, now load the unit }
  195. current_module^.globalsymtable:=new(punitsymtable,loadasunit);
  196. { if this is the system unit insert the intern symbols }
  197. if compile_system then
  198. begin
  199. make_ref:=false;
  200. insertinternsyms(psymtable(current_module^.globalsymtable));
  201. make_ref:=true;
  202. end;
  203. { now only read the implementation part }
  204. current_module^.in_implementation:=true;
  205. { load the used units from implementation }
  206. pu:=pused_unit(current_module^.used_units.first);
  207. while assigned(pu) do
  208. begin
  209. if (not pu^.loaded) and (not pu^.in_interface) then
  210. begin
  211. loaded_unit:=loadunit(pu^.name^,false);
  212. if current_module^.compiled then
  213. exit;
  214. { register unit in used units }
  215. pu^.u:=loaded_unit;
  216. pu^.loaded:=true;
  217. {$ifdef TEST_IMPL}
  218. { need to recompile the current unit ? }
  219. if loaded_unit^.crc<>pu^.checksum then
  220. begin
  221. Message2(unit_u_recompile_crc_change,current_module^.modulename^,pu^.name^);
  222. current_module^.do_compile:=true;
  223. dispose(current_module^.map);
  224. current_module^.map:=nil;
  225. exit;
  226. end;
  227. {$endif TEST_IMPL}
  228. { setup the map entry for deref }
  229. {$ifndef NEWMAP}
  230. current_module^.map^[nextmapentry]:=loaded_unit^.globalsymtable;
  231. {$else NEWMAP}
  232. current_module^.map^[nextmapentry]:=loaded_unit;
  233. {$endif NEWMAP}
  234. inc(nextmapentry);
  235. if nextmapentry>maxunits then
  236. Message(unit_f_too_much_units);
  237. end;
  238. pu:=pused_unit(pu^.next);
  239. end;
  240. {$ifdef UseBrowser}
  241. if cs_browser in aktmoduleswitches then
  242. punitsymtable(current_module^.globalsymtable)^.load_symtable_refs;
  243. if ((current_module^.flags and uf_has_browser)<>0) and
  244. (cs_local_browser in aktmoduleswitches) then
  245. begin
  246. current_module^.implsymtable:=new(psymtable,load);
  247. psymtable(current_module^.implsymtable)^.name:=
  248. stringdup('implementation of '+psymtable(current_module^.globalsymtable)^.name^);
  249. psymtable(current_module^.implsymtable)^.load_browser;
  250. end;
  251. {$endif UseBrowser}
  252. { remove the map, it's not needed anymore }
  253. dispose(current_module^.map);
  254. current_module^.map:=nil;
  255. end;
  256. function loadunit(const s : string;compile_system:boolean) : pmodule;
  257. const
  258. ImplIntf : array[boolean] of string[15]=('interface','implementation');
  259. var
  260. st : punitsymtable;
  261. old_current_ppu : pppufile;
  262. old_current_module,hp,hp2 : pmodule;
  263. name : string;{ necessary because
  264. current_module^.mainsource^ is reset in compile !! }
  265. scanner : pscannerfile;
  266. procedure loadppufile;
  267. begin
  268. { load interface section }
  269. if not current_module^.do_compile then
  270. load_interface;
  271. { only load units when we don't recompile }
  272. if not current_module^.do_compile then
  273. load_usedunits(compile_system);
  274. { recompile if set }
  275. if current_module^.do_compile then
  276. begin
  277. { we don't need the ppufile anymore }
  278. if assigned(current_module^.ppufile) then
  279. begin
  280. dispose(current_module^.ppufile,done);
  281. current_module^.ppufile:=nil;
  282. end;
  283. { recompile the unit or give a fatal error if sources not available }
  284. if not(current_module^.sources_avail) then
  285. if (not current_module^.search_unit(current_module^.modulename^))
  286. and (length(current_module^.modulename^)>8) then
  287. current_module^.search_unit(copy(current_module^.modulename^,1,8));
  288. if not(current_module^.sources_avail) then
  289. Message1(unit_f_cant_compile_unit,current_module^.modulename^)
  290. else
  291. begin
  292. if current_module^.in_second_compile then
  293. Message1(parser_d_compiling_second_time,current_module^.modulename^);
  294. current_scanner^.tempcloseinputfile;
  295. name:=current_module^.mainsource^;
  296. if assigned(scanner) then
  297. scanner^.invalid:=true;
  298. compile(name,compile_system);
  299. if (not current_scanner^.invalid) then
  300. current_scanner^.tempopeninputfile;
  301. (*
  302. if assigned(old_current_module^.scanner) then
  303. begin
  304. current_scanner^.tempcloseinputfile;
  305. current_scanner:=nil;
  306. { the current_scanner is always the same
  307. as current_module^.scanner (PFV) }
  308. NO !!! unless you changed the code
  309. because it is only change in compile
  310. whereas current_module is changed here !!
  311. end;
  312. compile(current_module^.mainsource^,compile_system);
  313. if (not old_current_module^.compiled) and
  314. assigned(old_current_module^.scanner) then
  315. begin
  316. current_scanner:=old_current_module^.scanner;
  317. current_scanner^.tempopeninputfile;
  318. end; *)
  319. end;
  320. end
  321. else
  322. begin
  323. { only reassemble ? }
  324. if (current_module^.do_assemble) then
  325. OnlyAsm;
  326. { add the files for the linker }
  327. Linker.AddModuleFiles(current_module);
  328. end;
  329. if assigned(current_module^.ppufile) then
  330. begin
  331. dispose(current_module^.ppufile,done);
  332. current_module^.ppufile:=nil;
  333. end;
  334. end;
  335. begin
  336. old_current_module:=current_module;
  337. old_current_ppu:=current_ppu;
  338. { Info }
  339. Message3(unit_u_load_unit,current_module^.modulename^,ImplIntf[current_module^.in_implementation],s);
  340. { unit not found }
  341. st:=nil;
  342. { search all loaded units }
  343. hp:=pmodule(loaded_units.first);
  344. while assigned(hp) do
  345. begin
  346. if hp^.modulename^=s then
  347. begin
  348. { the unit is already registered }
  349. { and this means that the unit }
  350. { is already compiled }
  351. { else there is a cyclic unit use }
  352. if assigned(hp^.globalsymtable) then
  353. st:=punitsymtable(hp^.globalsymtable)
  354. else
  355. begin
  356. { both units in interface ? }
  357. if (not current_module^.in_implementation) and (not hp^.in_implementation) then
  358. begin
  359. { check for a cycle }
  360. hp2:=current_module^.loaded_from;
  361. while assigned(hp2) and (hp2<>hp) do
  362. begin
  363. if hp2^.in_implementation then
  364. hp2:=nil
  365. else
  366. hp2:=hp2^.loaded_from;
  367. end;
  368. if assigned(hp2) then
  369. Message2(unit_f_circular_unit_reference,current_module^.modulename^,hp^.modulename^);
  370. end;
  371. end;
  372. break;
  373. end;
  374. { the next unit }
  375. hp:=pmodule(hp^.next);
  376. end;
  377. { the unit is not in the symtable stack }
  378. if (not assigned(st)) then
  379. begin
  380. { if the unit is loaded remove it first, but hold the same
  381. memory position, so no new/dispose }
  382. { this creates problem with the browser !! }
  383. if assigned(hp) then
  384. begin
  385. { remove the old unit }
  386. loaded_units.remove(hp);
  387. scanner:=hp^.scanner;
  388. hp^.reset;
  389. hp^.scanner:=scanner;
  390. current_module:=hp;
  391. current_module^.in_second_compile:=true;
  392. current_module^.do_compile:=true;
  393. Message1(unit_u_second_compile,current_module^.modulename^);
  394. end
  395. else
  396. { generates a new unit info record }
  397. begin
  398. current_module:=new(pmodule,init(s,true));
  399. scanner:=nil;
  400. end;
  401. current_ppu:=current_module^.ppufile;
  402. { now we can register the unit }
  403. current_module^.loaded_from:=old_current_module;
  404. loaded_units.insert(current_module);
  405. { now realy load the ppu }
  406. loadppufile;
  407. { set compiled flag }
  408. current_module^.compiled:=true;
  409. { register the unit _once_ }
  410. usedunits.concat(new(pused_unit,init(current_module,true)));
  411. { load return pointer }
  412. hp:=current_module;
  413. end;
  414. { set the old module }
  415. current_ppu:=old_current_ppu;
  416. current_module:=old_current_module;
  417. loadunit:=hp;
  418. end;
  419. procedure loaddefaultunits;
  420. var
  421. hp : pmodule;
  422. begin
  423. { are we compiling the system unit? }
  424. if (cs_compilesystem in aktmoduleswitches) then
  425. begin
  426. { create system defines }
  427. createconstdefs;
  428. { we don't need to reset anything, it's already done in parser.pas }
  429. exit;
  430. end;
  431. { insert the system unit, it is allways the first }
  432. hp:=loadunit(upper(target_info.system_unit),true);
  433. systemunit:=hp^.globalsymtable;
  434. { it's always the first unit }
  435. systemunit^.next:=nil;
  436. symtablestack:=systemunit;
  437. { add to the used units }
  438. current_module^.used_units.concat(new(pused_unit,init(hp,true)));
  439. refsymtable^.insert(new(punitsym,init('SYSTEM',systemunit)));
  440. { read default constant definitions }
  441. make_ref:=false;
  442. readconstdefs;
  443. make_ref:=true;
  444. { if POWER is defined in the RTL then use it for starstar overloading }
  445. getsym('POWER',false);
  446. if assigned(srsym) and (srsym^.typ=procsym) and (overloaded_operators[STARSTAR]=nil) then
  447. overloaded_operators[STARSTAR]:=pprocsym(srsym);
  448. { Objpas unit? }
  449. if m_objpas in aktmodeswitches then
  450. begin
  451. hp:=loadunit('OBJPAS',false);
  452. objpasunit:=hp^.globalsymtable;
  453. { insert in stack }
  454. objpasunit^.next:=symtablestack;
  455. symtablestack:=objpasunit;
  456. { add to the used units }
  457. current_module^.used_units.concat(new(pused_unit,init(hp,true)));
  458. refsymtable^.insert(new(punitsym,init('OBJPAS',objpasunit)));
  459. end
  460. else
  461. objpasunit:=nil;
  462. { save default symtablestack }
  463. defaultsymtablestack:=symtablestack;
  464. end;
  465. procedure loadunits;
  466. var
  467. s : stringid;
  468. hp : pused_unit;
  469. hp2 : pmodule;
  470. hp3 : psymtable;
  471. oldprocsym:Pprocsym;
  472. begin
  473. oldprocsym:=aktprocsym;
  474. consume(_USES);
  475. {$ifdef DEBUG}
  476. test_symtablestack;
  477. {$endif DEBUG}
  478. repeat
  479. s:=pattern;
  480. consume(ID);
  481. hp2:=loadunit(s,false);
  482. { the current module uses the unit hp2 }
  483. current_module^.used_units.concat(new(pused_unit,init(hp2,not current_module^.in_implementation)));
  484. pused_unit(current_module^.used_units.last)^.in_uses:=true;
  485. if current_module^.compiled then
  486. exit;
  487. refsymtable^.insert(new(punitsym,init(s,hp2^.globalsymtable)));
  488. if token=COMMA then
  489. begin
  490. pattern:='';
  491. consume(COMMA);
  492. end
  493. else
  494. break;
  495. until false;
  496. consume(SEMICOLON);
  497. { set the symtable to systemunit so it gets reorderd correctly }
  498. symtablestack:=defaultsymtablestack;
  499. { now insert the units in the symtablestack }
  500. hp:=pused_unit(current_module^.used_units.first);
  501. while assigned(hp) do
  502. begin
  503. {$IfDef GDB}
  504. if (cs_debuginfo in aktmoduleswitches) and
  505. not hp^.is_stab_written then
  506. begin
  507. punitsymtable(hp^.u^.globalsymtable)^.concattypestabto(debuglist);
  508. hp^.is_stab_written:=true;
  509. hp^.unitid:=psymtable(hp^.u^.globalsymtable)^.unitid;
  510. end;
  511. {$EndIf GDB}
  512. if hp^.in_uses then
  513. begin
  514. hp3:=symtablestack;
  515. while assigned(hp3) do
  516. begin
  517. { insert units only once ! }
  518. if hp^.u^.globalsymtable=hp3 then
  519. break;
  520. hp3:=hp3^.next;
  521. { unit isn't inserted }
  522. if hp3=nil then
  523. begin
  524. psymtable(hp^.u^.globalsymtable)^.next:=symtablestack;
  525. symtablestack:=psymtable(hp^.u^.globalsymtable);
  526. {$ifdef CHAINPROCSYMS}
  527. symtablestack^.chainprocsyms;
  528. {$endif CHAINPROCSYMS}
  529. {$ifdef DEBUG}
  530. test_symtablestack;
  531. {$endif DEBUG}
  532. end;
  533. end;
  534. end;
  535. hp:=pused_unit(hp^.next);
  536. end;
  537. aktprocsym:=oldprocsym;
  538. end;
  539. procedure parse_implementation_uses(symt:Psymtable);
  540. begin
  541. if token=_USES then
  542. begin
  543. symt^.symtabletype:=unitsymtable;
  544. loadunits;
  545. symt^.symtabletype:=globalsymtable;
  546. {$ifdef DEBUG}
  547. test_symtablestack;
  548. {$endif DEBUG}
  549. end;
  550. end;
  551. procedure gen_main_procsym(const name:string;options:longint;st:psymtable);
  552. begin
  553. {Generate a procsym for main}
  554. make_ref:=false;
  555. aktprocsym:=new(Pprocsym,init(name));
  556. aktprocsym^.definition:=new(Pprocdef,init);
  557. aktprocsym^.definition^.options:=aktprocsym^.definition^.options or options;
  558. aktprocsym^.definition^.setmangledname(target_os.cprefix+name);
  559. aktprocsym^.definition^.forwarddef:=false;
  560. make_ref:=true;
  561. { The localst is a local symtable. Change it into the static
  562. symtable }
  563. dispose(aktprocsym^.definition^.localst,done);
  564. aktprocsym^.definition^.localst:=st;
  565. { and insert the procsym in symtable }
  566. st^.insert(aktprocsym);
  567. { set some informations about the main program }
  568. with procinfo do
  569. begin
  570. retdef:=voiddef;
  571. _class:=nil;
  572. call_offset:=8;
  573. framepointer:=frame_pointer;
  574. flags:=0;
  575. end;
  576. end;
  577. procedure proc_unit;
  578. var
  579. { unitname : stringid; }
  580. names : Tstringcontainer;
  581. st : psymtable;
  582. unitst : punitsymtable;
  583. {$ifdef GDB}
  584. pu : pused_unit;
  585. {$endif GDB}
  586. i : longint;
  587. s1,s2 : ^string; {Saves stack space}
  588. begin
  589. consume(_UNIT);
  590. if token=ID then
  591. begin
  592. { create filenames and unit name }
  593. current_module^.SetFileName(current_scanner^.inputfile^.path^+current_scanner^.inputfile^.name^,true);
  594. stringdispose(current_module^.modulename);
  595. current_module^.modulename:=stringdup(upper(pattern));
  596. { check for system unit }
  597. new(s1);
  598. new(s2);
  599. s1^:=upper(target_info.system_unit);
  600. s2^:=upper(current_scanner^.inputfile^.name^);
  601. { strip extension, there could only be one dot }
  602. i:=pos('.',s2^);
  603. if i>0 then
  604. s2^:=Copy(s2^,1,i-1);
  605. if (cs_compilesystem in aktmoduleswitches) then
  606. begin
  607. if (cs_check_unit_name in aktglobalswitches) and
  608. ((length(current_module^.modulename^)>8) or
  609. (current_module^.modulename^<>s1^) or
  610. (current_module^.modulename^<>s2^)) then
  611. Message1(unit_e_illegal_unit_name,s1^);
  612. end
  613. else
  614. if (current_module^.modulename^=s1^) then
  615. Message(unit_w_switch_us_missed);
  616. dispose(s2);
  617. dispose(s1);
  618. end;
  619. consume(ID);
  620. consume(SEMICOLON);
  621. consume(_INTERFACE);
  622. { global switches are read, so further changes aren't allowed }
  623. current_module^.in_global:=false;
  624. Message1(unit_u_start_parse_interface,current_module^.modulename^);
  625. { update status }
  626. status.currentmodule:=current_module^.modulename^;
  627. { maybe turn off m_objpas if we are compiling objpas }
  628. if (current_module^.modulename^='OBJPAS') then
  629. aktmodeswitches:=aktmodeswitches-[m_objpas];
  630. { this should be placed after uses !!}
  631. {$ifndef UseNiceNames}
  632. procprefix:='_'+current_module^.modulename^+'$$';
  633. {$else UseNiceNames}
  634. procprefix:='_'+tostr(length(current_module^.unitname^))+lowercase(current_module^.unitname^)+'_';
  635. {$endif UseNiceNames}
  636. parse_only:=true;
  637. { generate now the global symboltable }
  638. st:=new(punitsymtable,init(globalsymtable,current_module^.modulename^));
  639. refsymtable:=st;
  640. unitst:=punitsymtable(st);
  641. { define first as local to overcome dependency conflicts }
  642. current_module^.localsymtable:=st;
  643. { the unit name must be usable as a unit specifier }
  644. { inside the unit itself (PM) }
  645. { this also forbids to have another symbol }
  646. { with the same name as the unit }
  647. refsymtable^.insert(new(punitsym,init(current_module^.modulename^,unitst)));
  648. { a unit compiled at command line must be inside the loaded_unit list }
  649. if (compile_level=1) then
  650. loaded_units.insert(current_module);
  651. { load default units, like the system unit }
  652. loaddefaultunits;
  653. { reset }
  654. make_ref:=true;
  655. lexlevel:=0;
  656. { insert qualifier for the system unit (allows system.writeln) }
  657. if not(cs_compilesystem in aktmoduleswitches) then
  658. begin
  659. if token=_USES then
  660. begin
  661. unitst^.symtabletype:=unitsymtable;
  662. loadunits;
  663. { has it been compiled at a higher level ?}
  664. if current_module^.compiled then
  665. begin
  666. { this unit symtable is obsolete }
  667. dispose(unitst,done);
  668. exit;
  669. end;
  670. unitst^.symtabletype:=globalsymtable;
  671. end;
  672. { ... but insert the symbol table later }
  673. st^.next:=symtablestack;
  674. symtablestack:=st;
  675. end
  676. else
  677. { while compiling a system unit, some types are directly inserted }
  678. begin
  679. st^.next:=symtablestack;
  680. symtablestack:=st;
  681. insert_intern_types(st);
  682. end;
  683. { now we know the place to insert the constants }
  684. constsymtable:=symtablestack;
  685. { move the global symtab from the temporary local to global }
  686. current_module^.globalsymtable:=current_module^.localsymtable;
  687. current_module^.localsymtable:=nil;
  688. { ... parse the declarations }
  689. read_interface_declarations;
  690. {$ifdef GDB}
  691. { add all used definitions}
  692. if (cs_debuginfo in aktmoduleswitches) then
  693. begin
  694. { all types }
  695. punitsymtable(refsymtable)^.concattypestabto(debuglist);
  696. { and all local symbols}
  697. refsymtable^.concatstabto(debuglist);
  698. end;
  699. {$endif GDB}
  700. { Parse the implementation section }
  701. consume(_IMPLEMENTATION);
  702. current_module^.in_implementation:=true;
  703. Message1(unit_u_start_parse_implementation,current_module^.modulename^);
  704. parse_only:=false;
  705. { generates static symbol table }
  706. st:=new(punitsymtable,init(staticsymtable,current_module^.modulename^));
  707. current_module^.localsymtable:=st;
  708. { remove the globalsymtable from the symtable stack }
  709. { to reinsert it after loading the implementation units }
  710. symtablestack:=unitst^.next;
  711. { number the definitions, so a deref from other units works }
  712. refsymtable^.number_defs;
  713. {$ifdef UseBrowser}
  714. refsymtable^.number_symbols;
  715. { we don't want implementation units symbols in unitsymtable !! PM }
  716. refsymtable:=st;
  717. {$endif UseBrowser}
  718. { Read the implementation units }
  719. parse_implementation_uses(unitst);
  720. if current_module^.compiled then
  721. begin
  722. { this unit symtable is obsolete }
  723. dispose(unitst,done);
  724. { avoid self recursive destructor call !! PM }
  725. aktprocsym^.definition^.localst:=nil;
  726. { absence does not matter here !! }
  727. aktprocsym^.definition^.forwarddef:=false;
  728. dispose(st,done);
  729. exit;
  730. end;
  731. { All units are read, now give them a number }
  732. numberunits;
  733. { now we can change refsymtable }
  734. refsymtable:=st;
  735. { but reinsert the global symtable as lasts }
  736. unitst^.next:=symtablestack;
  737. symtablestack:=unitst;
  738. {$ifdef DEBUG}
  739. test_symtablestack;
  740. {$endif DEBUG}
  741. constsymtable:=symtablestack;
  742. {$ifdef Splitheap}
  743. if testsplit then
  744. begin
  745. Split_Heap;
  746. allow_special:=true;
  747. Switch_to_temp_heap;
  748. end;
  749. { it will report all crossings }
  750. allow_special:=false;
  751. {$endif Splitheap}
  752. { Generate a procsym }
  753. gen_main_procsym(current_module^.modulename^+'_init',pounitinit,st);
  754. { Compile the unit }
  755. codegen_newprocedure;
  756. names.init;
  757. names.insert('INIT$$'+current_module^.modulename^);
  758. names.insert(target_os.cprefix+current_module^.modulename^+'_init');
  759. compile_proc_body(names,true,false);
  760. names.done;
  761. codegen_doneprocedure;
  762. { avoid self recursive destructor call !! PM }
  763. aktprocsym^.definition^.localst:=nil;
  764. { finalize? }
  765. if token=_FINALIZATION then
  766. begin
  767. { set module options }
  768. current_module^.flags:=current_module^.flags or uf_finalize;
  769. { Generate a procsym }
  770. gen_main_procsym(current_module^.modulename^+'_finalize',pounitfinalize,st);
  771. { Compile the finalize }
  772. codegen_newprocedure;
  773. names.init;
  774. names.insert('FINALIZE$$'+current_module^.modulename^);
  775. names.insert(target_os.cprefix+current_module^.modulename^+'_finalize');
  776. compile_proc_body(names,true,false);
  777. names.done;
  778. codegen_doneprocedure;
  779. { avoid self recursive destructor call !! PM }
  780. aktprocsym^.definition^.localst:=nil;
  781. end;
  782. { the last char should always be a point }
  783. consume(POINT);
  784. { avoid self recursive destructor call !! PM }
  785. aktprocsym^.definition^.localst:=nil;
  786. { absence does not matter here !! }
  787. aktprocsym^.definition^.forwarddef:=false;
  788. { test static symtable }
  789. st^.allsymbolsused;
  790. { size of the static data }
  791. datasize:=st^.datasize;
  792. {$ifdef GDB}
  793. { add all used definitions even for implementation}
  794. if (cs_debuginfo in aktmoduleswitches) then
  795. begin
  796. { all types }
  797. punitsymtable(st)^.concattypestabto(debuglist);
  798. { and all local symbols}
  799. st^.concatstabto(debuglist);
  800. end;
  801. {$endif GDB}
  802. { tests, if all (interface) forwards are resolved }
  803. symtablestack^.check_forwards;
  804. { now we have a correct unit, change the symtable type }
  805. current_module^.in_implementation:=false;
  806. symtablestack^.symtabletype:=unitsymtable;
  807. {$ifdef GDB}
  808. punitsymtable(symtablestack)^.is_stab_written:=false;
  809. {$endif GDB}
  810. { leave when we got an error }
  811. if status.errorcount>0 then
  812. begin
  813. Message1(unit_f_errors_in_unit,tostr(status.errorcount));
  814. exit;
  815. end;
  816. { insert own objectfile }
  817. insertobjectfile;
  818. { Write out the ppufile }
  819. writeunitas(current_module^.ppufilename^,punitsymtable(symtablestack));
  820. { write local browser }
  821. {$ifdef UseBrowser}
  822. if cs_local_browser in aktmoduleswitches then
  823. begin
  824. current_module^.implsymtable:=refsymtable;
  825. refsymtable^.write;
  826. refsymtable^.write_browser;
  827. end;
  828. {$endif UseBrowser}
  829. {$ifdef GDB}
  830. pu:=pused_unit(usedunits.first);
  831. while assigned(pu) do
  832. begin
  833. punitsymtable(pu^.u^.globalsymtable)^.is_stab_written:=false;
  834. pu:=pused_unit(pu^.next);
  835. end;
  836. {$endif GDB}
  837. { remove static symtable (=refsymtable) here to save some mem }
  838. {$ifndef UseBrowser}
  839. dispose(st,done);
  840. {$endif UseBrowser}
  841. current_module^.localsymtable:=nil;
  842. { generate imports }
  843. if current_module^.uses_imports then
  844. importlib^.generatelib;
  845. { finish asmlist by adding segment starts }
  846. insertsegment;
  847. { assemble }
  848. create_objectfile;
  849. end;
  850. procedure proc_program(islibrary : boolean);
  851. var
  852. st : psymtable;
  853. names : Tstringcontainer;
  854. begin
  855. parse_only:=false;
  856. if islibrary then
  857. begin
  858. consume(_LIBRARY);
  859. stringdispose(current_module^.modulename);
  860. current_module^.modulename:=stringdup(pattern);
  861. consume(ID);
  862. consume(SEMICOLON);
  863. end
  864. else
  865. { is there an program head ? }
  866. if token=_PROGRAM then
  867. begin
  868. consume(_PROGRAM);
  869. stringdispose(current_module^.modulename);
  870. current_module^.modulename:=stringdup(pattern);
  871. consume(ID);
  872. if token=LKLAMMER then
  873. begin
  874. consume(LKLAMMER);
  875. idlist;
  876. consume(RKLAMMER);
  877. end;
  878. consume(SEMICOLON);
  879. end;
  880. { global switches are read, so further changes aren't allowed }
  881. current_module^.in_global:=false;
  882. { set implementation flag }
  883. current_module^.in_implementation:=true;
  884. { insert after the unit symbol tables the static symbol table }
  885. { of the program }
  886. st:=new(punitsymtable,init(staticsymtable,current_module^.modulename^));
  887. current_module^.localsymtable:=st;
  888. symtablestack:=st;
  889. refsymtable:=st;
  890. { necessary for browser }
  891. loaded_units.insert(current_module);
  892. { load standard units (system,objpas unit) }
  893. loaddefaultunits;
  894. { reset }
  895. lexlevel:=0;
  896. {Load the units used by the program we compile.}
  897. if token=_USES then
  898. loadunits;
  899. {Insert the name of the main program into the symbol table.}
  900. if current_module^.modulename^<>'' then
  901. st^.insert(new(pprogramsym,init(current_module^.modulename^)));
  902. { ...is also constsymtable, this is the symtable where }
  903. { the elements of enumeration types are inserted }
  904. constsymtable:=st;
  905. { Generate a procsym for main }
  906. gen_main_procsym('main',poproginit,st);
  907. { reset }
  908. procprefix:='';
  909. in_except_block:=false;
  910. {The program intialization needs an alias, so it can be called
  911. from the bootstrap code.}
  912. codegen_newprocedure;
  913. names.init;
  914. names.insert('program_init');
  915. names.insert('PASCALMAIN');
  916. names.insert(target_os.cprefix+'main');
  917. {$ifdef m68k}
  918. if target_info.target=target_PalmOS then
  919. names.insert('PilotMain');
  920. {$endif}
  921. compile_proc_body(names,true,false);
  922. names.done;
  923. { avoid self recursive destructor call !! PM }
  924. aktprocsym^.definition^.localst:=nil;
  925. codegen_doneprocedure;
  926. { consume the last point }
  927. consume(POINT);
  928. { leave when we got an error }
  929. if status.errorcount>0 then
  930. begin
  931. Message1(unit_f_errors_in_unit,tostr(status.errorcount));
  932. exit;
  933. end;
  934. { insert heap }
  935. insertheap;
  936. { generate imports }
  937. if current_module^.uses_imports then
  938. importlib^.generatelib;
  939. inserttargetspecific;
  940. datasize:=symtablestack^.datasize;
  941. { finish asmlist by adding segment starts }
  942. insertsegment;
  943. { insert own objectfile }
  944. insertobjectfile;
  945. { assemble and link }
  946. create_objectfile;
  947. { create the executable when we are at level 1 }
  948. if (compile_level=1) then
  949. begin
  950. if (cs_link_deffile in aktglobalswitches) then
  951. deffile.writefile;
  952. if (not current_module^.is_unit) then
  953. Linker.MakeExecutable;
  954. end;
  955. end;
  956. end.
  957. {
  958. $Log$
  959. Revision 1.63 1998-10-08 23:29:01 peter
  960. * -vu shows unit info, -vt shows tried/used files
  961. Revision 1.62 1998/10/08 17:17:25 pierre
  962. * current_module old scanner tagged as invalid if unit is recompiled
  963. + added ppheap for better info on tracegetmem of heaptrc
  964. (adds line column and file index)
  965. * several memory leaks removed ith help of heaptrc !!
  966. Revision 1.61 1998/10/08 13:48:47 peter
  967. * fixed memory leaks for do nothing source
  968. * fixed unit interdependency
  969. Revision 1.60 1998/10/06 17:16:54 pierre
  970. * some memory leaks fixed (thanks to Peter for heaptrc !)
  971. Revision 1.59 1998/10/05 21:33:26 peter
  972. * fixed 161,165,166,167,168
  973. Revision 1.58 1998/09/30 16:43:37 peter
  974. * fixed unit interdependency with circular uses
  975. Revision 1.57 1998/09/30 12:11:52 peter
  976. * fixed circular uses which looped forever
  977. Revision 1.56 1998/09/28 11:22:15 pierre
  978. * did not compile for browser
  979. * merge from fixes
  980. Revision 1.48.2.1 1998/09/28 10:55:16 pierre
  981. fix for current_module dispose bug
  982. Revision 1.55 1998/09/28 11:04:03 peter
  983. * fixed loaddefaultunits which was at the wrong place for programs, so
  984. the default defs were not loaded when main was initialized
  985. Revision 1.54 1998/09/24 23:49:12 peter
  986. + aktmodeswitches
  987. Revision 1.53 1998/09/23 12:20:50 pierre
  988. * main program tmodule had no symtable (crashed browser)
  989. * unit symbols problem fixed !!
  990. Revision 1.52 1998/09/22 17:13:49 pierre
  991. + browsing updated and developed
  992. records and objects fields are also stored
  993. Revision 1.51 1998/09/22 15:40:55 peter
  994. * some extra ifdef GDB
  995. Revision 1.50 1998/09/21 08:45:17 pierre
  996. + added vmt_offset in tobjectdef.write for fututre use
  997. (first steps to have objects without vmt if no virtual !!)
  998. + added fpu_used field for tabstractprocdef :
  999. sets this level to 2 if the functions return with value in FPU
  1000. (is then set to correct value at parsing of implementation)
  1001. THIS MIGHT refuse some code with FPU expression too complex
  1002. that were accepted before and even in some cases
  1003. that don't overflow in fact
  1004. ( like if f : float; is a forward that finally in implementation
  1005. only uses one fpu register !!)
  1006. Nevertheless I think that it will improve security on
  1007. FPU operations !!
  1008. * most other changes only for UseBrowser code
  1009. (added symtable references for record and objects)
  1010. local switch for refs to args and local of each function
  1011. (static symtable still missing)
  1012. UseBrowser still not stable and probably broken by
  1013. the definition hash array !!
  1014. Revision 1.49 1998/09/18 08:01:36 pierre
  1015. + improvement on the usebrowser part
  1016. (does not work correctly for now)
  1017. Revision 1.48 1998/09/09 15:33:07 peter
  1018. * fixed in_global to allow directives also after interface token
  1019. Revision 1.47 1998/09/09 11:50:55 pierre
  1020. * forward def are not put in record or objects
  1021. + added check for forwards also in record and objects
  1022. * dummy parasymtable for unit initialization removed from
  1023. symtable stack
  1024. Revision 1.46 1998/09/03 11:24:01 peter
  1025. * moved more inputfile things from tscannerfile to tinputfile
  1026. * changed ifdef Sourceline to cs_asm_source
  1027. Revision 1.45 1998/08/31 12:26:28 peter
  1028. * m68k and palmos updates from surebugfixes
  1029. Revision 1.44 1998/08/26 15:35:33 peter
  1030. * fixed scannerfiles for macros
  1031. + $I %<environment>%
  1032. Revision 1.43 1998/08/26 10:08:47 peter
  1033. * fixed problem with libprefix at the wrong place
  1034. * fixed lib generation with smartlinking and no -CS used
  1035. Revision 1.42 1998/08/19 18:04:54 peter
  1036. * fixed current_module^.in_implementation flag
  1037. Revision 1.41 1998/08/17 10:10:08 peter
  1038. - removed OLDPPU
  1039. Revision 1.40 1998/08/17 09:17:50 peter
  1040. * static/shared linking updates
  1041. Revision 1.39 1998/08/14 21:56:37 peter
  1042. * setting the outputfile using -o works now to create static libs
  1043. Revision 1.38 1998/08/10 14:50:13 peter
  1044. + localswitches, moduleswitches, globalswitches splitting
  1045. Revision 1.37 1998/08/10 10:18:31 peter
  1046. + Compiler,Comphook unit which are the new interface units to the
  1047. compiler
  1048. Revision 1.36 1998/07/14 14:46:54 peter
  1049. * released NEWINPUT
  1050. Revision 1.35 1998/07/08 12:39:38 peter
  1051. * heap_size for m68k
  1052. Revision 1.34 1998/07/07 11:20:03 peter
  1053. + NEWINPUT for a better inputfile and scanner object
  1054. Revision 1.33 1998/06/25 11:15:34 pierre
  1055. * ppu files where not closed in newppu !!
  1056. second compilation was impossible due to too many opened files
  1057. (not visible in 'make cycle' as we remove all the ppu files)
  1058. Revision 1.32 1998/06/25 08:48:16 florian
  1059. * first version of rtti support
  1060. Revision 1.31 1998/06/24 14:48:35 peter
  1061. * ifdef newppu -> ifndef oldppu
  1062. Revision 1.30 1998/06/17 14:10:16 peter
  1063. * small os2 fixes
  1064. * fixed interdependent units with newppu (remake3 under linux works now)
  1065. Revision 1.29 1998/06/16 08:56:25 peter
  1066. + targetcpu
  1067. * cleaner pmodules for newppu
  1068. Revision 1.28 1998/06/13 00:10:10 peter
  1069. * working browser and newppu
  1070. * some small fixes against crashes which occured in bp7 (but not in
  1071. fpc?!)
  1072. Revision 1.27 1998/06/11 13:58:08 peter
  1073. * small fix to let newppu compile
  1074. Revision 1.26 1998/06/09 16:01:47 pierre
  1075. + added procedure directive parsing for procvars
  1076. (accepted are popstack cdecl and pascal)
  1077. + added C vars with the following syntax
  1078. var C calias 'true_c_name';(can be followed by external)
  1079. reason is that you must add the Cprefix
  1080. which is target dependent
  1081. Revision 1.25 1998/06/08 22:59:49 peter
  1082. * smartlinking works for win32
  1083. * some defines to exclude some compiler parts
  1084. Revision 1.24 1998/06/08 13:13:44 pierre
  1085. + temporary variables now in temp_gen.pas unit
  1086. because it is processor independent
  1087. * mppc68k.bat modified to undefine i386 and support_mmx
  1088. (which are defaults for i386)
  1089. Revision 1.23 1998/06/05 17:47:29 peter
  1090. * some better uses clauses
  1091. Revision 1.22 1998/06/05 14:37:34 pierre
  1092. * fixes for inline for operators
  1093. * inline procedure more correctly restricted
  1094. Revision 1.21 1998/06/04 23:51:53 peter
  1095. * m68k compiles
  1096. + .def file creation moved to gendef.pas so it could also be used
  1097. for win32
  1098. Revision 1.20 1998/06/04 09:55:42 pierre
  1099. * demangled name of procsym reworked to become independant of the mangling scheme
  1100. Revision 1.19 1998/06/03 23:40:38 peter
  1101. + unlimited file support, release tempclose
  1102. Revision 1.18 1998/06/03 22:49:00 peter
  1103. + wordbool,longbool
  1104. * rename bis,von -> high,low
  1105. * moved some systemunit loading/creating to psystem.pas
  1106. Revision 1.17 1998/05/28 14:40:25 peter
  1107. * fixes for newppu, remake3 works now with it
  1108. Revision 1.16 1998/05/27 19:45:06 peter
  1109. * symtable.pas splitted into includefiles
  1110. * symtable adapted for $ifdef NEWPPU
  1111. Revision 1.15 1998/05/23 01:21:22 peter
  1112. + aktasmmode, aktoptprocessor, aktoutputformat
  1113. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1114. + $LIBNAME to set the library name where the unit will be put in
  1115. * splitted cgi386 a bit (codeseg to large for bp7)
  1116. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1117. Revision 1.14 1998/05/20 09:42:35 pierre
  1118. + UseTokenInfo now default
  1119. * unit in interface uses and implementation uses gives error now
  1120. * only one error for unknown symbol (uses lastsymknown boolean)
  1121. the problem came from the label code !
  1122. + first inlined procedures and function work
  1123. (warning there might be allowed cases were the result is still wrong !!)
  1124. * UseBrower updated gives a global list of all position of all used symbols
  1125. with switch -gb
  1126. Revision 1.13 1998/05/12 10:47:00 peter
  1127. * moved printstatus to verb_def
  1128. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1129. prefix like error: warning: and is included in V_Default
  1130. * fixed some messages
  1131. * first time parameter scan is only for -v and -T
  1132. - removed old style messages
  1133. Revision 1.12 1998/05/11 13:07:56 peter
  1134. + $ifdef NEWPPU for the new ppuformat
  1135. + $define GDB not longer required
  1136. * removed all warnings and stripped some log comments
  1137. * no findfirst/findnext anymore to remove smartlink *.o files
  1138. Revision 1.11 1998/05/06 18:36:53 peter
  1139. * tai_section extended with code,data,bss sections and enumerated type
  1140. * ident 'compiled by FPC' moved to pmodules
  1141. * small fix for smartlink
  1142. Revision 1.10 1998/05/04 17:54:28 peter
  1143. + smartlinking works (only case jumptable left todo)
  1144. * redesign of systems.pas to support assemblers and linkers
  1145. + Unitname is now also in the PPU-file, increased version to 14
  1146. Revision 1.9 1998/05/01 16:38:45 florian
  1147. * handling of private and protected fixed
  1148. + change_keywords_to_tp implemented to remove
  1149. keywords which aren't supported by tp
  1150. * break and continue are now symbols of the system unit
  1151. + widestring, longstring and ansistring type released
  1152. Revision 1.8 1998/04/30 15:59:41 pierre
  1153. * GDB works again better :
  1154. correct type info in one pass
  1155. + UseTokenInfo for better source position
  1156. * fixed one remaining bug in scanner for line counts
  1157. * several little fixes
  1158. Revision 1.7 1998/04/29 10:33:59 pierre
  1159. + added some code for ansistring (not complete nor working yet)
  1160. * corrected operator overloading
  1161. * corrected nasm output
  1162. + started inline procedures
  1163. + added starstarn : use ** for exponentiation (^ gave problems)
  1164. + started UseTokenInfo cond to get accurate positions
  1165. Revision 1.6 1998/04/27 23:10:28 peter
  1166. + new scanner
  1167. * $makelib -> if smartlink
  1168. * small filename fixes pmodule.setfilename
  1169. * moved import from files.pas -> import.pas
  1170. Revision 1.5 1998/04/14 23:27:03 florian
  1171. + exclude/include with constant second parameter added
  1172. Revision 1.4 1998/04/10 14:41:43 peter
  1173. * removed some Hints
  1174. * small speed optimization for AsmLn
  1175. Revision 1.3 1998/04/03 09:51:00 daniel
  1176. * Fixed heap allocation for OS/2.
  1177. }