pmodules.pas 47 KB

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