pmodules.pas 47 KB

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