parser.pas 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. This unit does the parsing process
  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. {$ifdef tp}
  19. {$E+,N+,D+,F+}
  20. {$endif}
  21. unit parser;
  22. interface
  23. procedure compile(const filename:string;compile_system:boolean);
  24. procedure initparser;
  25. implementation
  26. uses
  27. dos,objects,cobjects,globals,scanner,systems,symtable,tree,aasm,
  28. types,strings,pass_1,hcodegen,files,verbose,script,import
  29. {$ifdef i386}
  30. ,i386
  31. ,cgi386
  32. ,cgai386
  33. ,tgeni386
  34. ,aopt386
  35. {$endif i386}
  36. {$ifdef m68k}
  37. ,m68k
  38. ,cg68k
  39. ,tgen68k
  40. ,cga68k
  41. {$endif m68k}
  42. { parser units }
  43. ,pbase,pmodules,pdecl,
  44. { assembling & linking }
  45. assemble,
  46. link;
  47. { dummy variable for search when calling exec }
  48. var
  49. file_found : boolean;
  50. procedure readconstdefs;
  51. begin
  52. s32bitdef:=porddef(globaldef('longint'));
  53. u32bitdef:=porddef(globaldef('ulong'));
  54. cstringdef:=pstringdef(globaldef('string'));
  55. {$ifdef UseLongString}
  56. clongstringdef:=pstringdef(globaldef('longstring'));
  57. {$endif UseLongString}
  58. {$ifdef UseAnsiString}
  59. cansistringdef:=pstringdef(globaldef('ansistring'));
  60. {$endif UseAnsiString}
  61. cchardef:=porddef(globaldef('char'));
  62. {$ifdef i386}
  63. c64floatdef:=pfloatdef(globaldef('s64real'));
  64. {$endif}
  65. {$ifdef m68k}
  66. c64floatdef:=pfloatdef(globaldef('s32real'));
  67. {$endif m68k}
  68. s80floatdef:=pfloatdef(globaldef('s80real'));
  69. s32fixeddef:=pfloatdef(globaldef('cs32fixed'));
  70. voiddef:=porddef(globaldef('void'));
  71. u8bitdef:=porddef(globaldef('byte'));
  72. u16bitdef:=porddef(globaldef('word'));
  73. booldef:=porddef(globaldef('boolean'));
  74. voidpointerdef:=ppointerdef(globaldef('void_pointer'));
  75. cfiledef:=pfiledef(globaldef('file'));
  76. end;
  77. procedure initparser;
  78. begin
  79. forwardsallowed:=false;
  80. { ^M means a string or a char, because we don't parse a }
  81. { type declaration }
  82. parse_types:=false;
  83. { we didn't parse a object or class declaration }
  84. { and no function header }
  85. testcurobject:=0;
  86. { create error defintion }
  87. generrordef:=new(perrordef,init);
  88. symtablestack:=nil;
  89. { a long time, this was forgotten }
  90. aktprocsym:=nil;
  91. current_module:=nil;
  92. loaded_units.init;
  93. usedunits.init;
  94. end;
  95. { moved out to save stack }
  96. var
  97. addparam : string;
  98. procedure compile(const filename:string;compile_system:boolean);
  99. var
  100. hp : pmodule;
  101. comp_unit : boolean;
  102. { some variables to save the compiler state }
  103. oldtoken : ttoken;
  104. oldpattern : stringid;
  105. oldpreprocstack : ppreprocstack;
  106. oldorgpattern,oldprocprefix : string;
  107. oldparse_types : boolean;
  108. oldinputbuffer : pchar;
  109. oldinputpointer : longint;
  110. olds_point,oldparse_only : boolean;
  111. oldc : char;
  112. oldcomment_level : word;
  113. oldimports,oldexports,oldresource,
  114. oldbsssegment,olddatasegment,oldcodesegment,
  115. oldexprasmlist,olddebuglist,
  116. oldinternals,oldexternals,oldconsts : paasmoutput;
  117. oldnextlabelnr : longint;
  118. oldswitches : Tcswitches;
  119. oldmacros,oldrefsymtable,oldsymtablestack : psymtable;
  120. procedure def_macro(const s : string);
  121. var
  122. mac : pmacrosym;
  123. begin
  124. mac:=pmacrosym(macros^.search(s));
  125. if mac=nil then
  126. begin
  127. mac:=new(pmacrosym,init(s));
  128. Message1(parser_m_macro_defined,mac^.name);
  129. macros^.insert(mac);
  130. end;
  131. mac^.defined:=true;
  132. end;
  133. procedure set_macro(const s : string;value : string);
  134. var
  135. mac : pmacrosym;
  136. begin
  137. mac:=pmacrosym(macros^.search(s));
  138. if mac=nil then
  139. begin
  140. mac:=new(pmacrosym,init(s));
  141. macros^.insert(mac);
  142. end
  143. else
  144. begin
  145. if assigned(mac^.buftext) then
  146. freemem(mac^.buftext,mac^.buflen);
  147. end;
  148. Message2(parser_m_macro_set_to,mac^.name,value);
  149. mac^.buflen:=length(value);
  150. getmem(mac^.buftext,mac^.buflen);
  151. move(value[1],mac^.buftext^,mac^.buflen);
  152. mac^.defined:=true;
  153. end;
  154. procedure define_macros;
  155. var
  156. hp : pstring_item;
  157. begin
  158. hp:=pstring_item(commandlinedefines.first);
  159. while assigned(hp) do
  160. begin
  161. def_macro(hp^.str^);
  162. hp:=pstring_item(hp^.next);
  163. end;
  164. { set macros for version checking }
  165. set_macro('FPC_VERSION',version_nr);
  166. set_macro('FPC_RELEASE',release_nr);
  167. set_macro('FPC_PATCH',patch_nr);
  168. end;
  169. var
  170. a : PAsmFile;
  171. g : file;
  172. ftime : longint;
  173. label
  174. done;
  175. begin {compile}
  176. inc(compile_level);
  177. { save old state }
  178. { save symtable state }
  179. oldsymtablestack:=symtablestack;
  180. symtablestack:=nil;
  181. oldrefsymtable:=refsymtable;
  182. refsymtable:=nil;
  183. oldprocprefix:=procprefix;
  184. { a long time, this was only in init_parser
  185. but it should be reset to zero for each module }
  186. aktprocsym:=nil;
  187. { first, we assume a program }
  188. if not(assigned(current_module)) then
  189. begin
  190. {!!!}
  191. current_module:=new(pmodule,init(filename,false));
  192. main_module:=current_module;
  193. end;
  194. { reset flags }
  195. current_module^.flags:=0;
  196. { ... and crc }
  197. current_module^.crc:=0;
  198. { save scanner state }
  199. oldmacros:=macros;
  200. oldpattern:=pattern;
  201. oldtoken:=token;
  202. oldorgpattern:=orgpattern;
  203. oldparse_types:=parse_types;
  204. oldpreprocstack:=preprocstack;
  205. oldinputbuffer:=inputbuffer;
  206. oldinputpointer:=inputpointer;
  207. olds_point:=s_point;
  208. oldc:=c;
  209. oldcomment_level:=comment_level;
  210. oldparse_only:=parse_only;
  211. { save assembler lists }
  212. olddatasegment:=datasegment;
  213. oldbsssegment:=bsssegment;
  214. oldcodesegment:=codesegment;
  215. olddebuglist:=debuglist;
  216. oldexternals:=externals;
  217. oldinternals:=internals;
  218. oldconsts:=consts;
  219. oldexprasmlist:=exprasmlist;
  220. oldimports:=importssection;
  221. oldexports:=exportssection;
  222. oldresource:=resourcesection;
  223. oldswitches:=aktswitches;
  224. oldnextlabelnr:=nextlabelnr;
  225. Message1(parser_i_compiling,filename);
  226. InitScanner(filename);
  227. aktswitches:=initswitches;
  228. { we need this to make the system unit }
  229. if compile_system then
  230. aktswitches:=aktswitches+[cs_compilesystem];
  231. aktexprlevel:=initexprlevel;
  232. aktpackrecords:=initpackrecords;
  233. { init code generator for a new module }
  234. codegen_newmodule;
  235. macros:=new(psymtable,init(macrosymtable));
  236. define_macros;
  237. { startup scanner }
  238. token:=yylex;
  239. { init asm writing }
  240. datasegment:=new(paasmoutput,init);
  241. codesegment:=new(paasmoutput,init);
  242. bsssegment:=new(paasmoutput,init);
  243. debuglist:=new(paasmoutput,init);
  244. externals:=new(paasmoutput,init);
  245. internals:=new(paasmoutput,init);
  246. consts:=new(paasmoutput,init);
  247. importssection:=nil;
  248. exportssection:=nil;
  249. resourcesection:=nil;
  250. { global switches are read, so further changes aren't allowed }
  251. current_module^.in_main:=true;
  252. { open assembler response }
  253. if (compile_level=1) then
  254. AsmRes.Init('ppas');
  255. { if the current file isn't a system unit }
  256. { the the system unit will be loaded }
  257. if not(cs_compilesystem in aktswitches) then
  258. begin
  259. { should be done in unit system (changing the field system_unit)
  260. FK
  261. }
  262. hp:=loadunit(upper(target_info.system_unit),true,true);
  263. systemunit:=hp^.symtable;
  264. readconstdefs;
  265. { we could try to overload caret by default }
  266. symtablestack:=systemunit;
  267. { if POWER is defined in the RTL then use it for caret overloading }
  268. getsym('POWER',false);
  269. if assigned(srsym) and (srsym^.typ=procsym) and
  270. (overloaded_operators[CARET]=nil) then
  271. overloaded_operators[CARET]:=pprocsym(srsym);
  272. end
  273. else
  274. begin
  275. { create definitions for constants }
  276. registerdef:=false;
  277. s32bitdef:=new(porddef,init(s32bit,$80000000,$7fffffff));
  278. u32bitdef:=new(porddef,init(u32bit,0,$ffffffff));
  279. cstringdef:=new(pstringdef,init(255));
  280. { should we give a length to the default long and ansi string definition ?? }
  281. {$ifdef UseLongString}
  282. clongstringdef:=new(pstringdef,longinit(-1));
  283. {$endif UseLongString}
  284. {$ifdef UseAnsiString}
  285. cansistringdef:=new(pstringdef,ansiinit(-1));
  286. {$endif UseAnsiString}
  287. cchardef:=new(porddef,init(uchar,0,255));
  288. {$ifdef i386}
  289. c64floatdef:=new(pfloatdef,init(s64real));
  290. s80floatdef:=new(pfloatdef,init(s80real));
  291. {$endif}
  292. {$ifdef m68k}
  293. c64floatdef:=new(pfloatdef,init(s32real));
  294. if (cs_fp_emulation in aktswitches) then
  295. s80floatdef:=new(pfloatdef,init(s32real))
  296. else
  297. s80floatdef:=new(pfloatdef,init(s80real));
  298. {$endif}
  299. s32fixeddef:=new(pfloatdef,init(f32bit));
  300. { some other definitions }
  301. voiddef:=new(porddef,init(uvoid,0,0));
  302. u8bitdef:=new(porddef,init(u8bit,0,255));
  303. u16bitdef:=new(porddef,init(u16bit,0,65535));
  304. booldef:=new(porddef,init(bool8bit,0,1));
  305. voidpointerdef:=new(ppointerdef,init(voiddef));
  306. cfiledef:=new(pfiledef,init(ft_untyped,nil));
  307. systemunit:=nil;
  308. end;
  309. registerdef:=true;
  310. { current return type is void }
  311. procinfo.retdef:=voiddef;
  312. { reset lexical level }
  313. lexlevel:=0;
  314. { parse source }
  315. {***BUGFIX}
  316. if (token=_UNIT) or (compile_level>1) then
  317. begin
  318. {If the compile level > 1 we get a nice "unit expected" error
  319. message if we are trying to use a program as unit.}
  320. proc_unit;
  321. if current_module^.compiled then
  322. goto done;
  323. comp_unit:=true;
  324. end
  325. else
  326. begin
  327. proc_program(token=_LIBRARY);
  328. comp_unit:=false;
  329. end;
  330. { Why? The definition of Pascal requires that everything
  331. after 'end.' is ignored!
  332. if not(cs_tp_compatible in aktswitches) then
  333. consume(_EOF); }
  334. if errorcount=0 then
  335. begin
  336. if current_module^.uses_imports then
  337. importlib^.generatelib;
  338. a:=new(PAsmFile,Init(filename));
  339. a^.WriteAsmSource;
  340. a^.DoAssemble;
  341. dispose(a,Done);
  342. { Check linking => we are at first level in compile }
  343. if (compile_level=1) then
  344. begin
  345. if Linker.ExeName='' then
  346. Linker.SetFileName(FileName);
  347. if (comp_unit) then
  348. begin
  349. Linker.Make_Library;
  350. end
  351. else
  352. begin
  353. if (cs_no_linking in initswitches) then
  354. externlink:=true;
  355. Linker.Link;
  356. end;
  357. end;
  358. end
  359. else
  360. begin
  361. Message1(unit_e_total_errors,tostr(errorcount));
  362. Message(unit_f_errors_in_unit);
  363. end;
  364. { clear memory }
  365. {$ifdef Splitheap}
  366. if testsplit then
  367. begin
  368. { temp heap should be empty after that !!!}
  369. codegen_donemodule;
  370. Releasetempheap;
  371. end;
  372. {else
  373. codegen_donemodule;}
  374. {$endif Splitheap}
  375. { restore old state }
  376. { if already compiled jumps directly here }
  377. done:
  378. { close trees }
  379. {$ifdef disposetree}
  380. dispose(datasegment,Done);
  381. dispose(codesegment,Done);
  382. dispose(bsssegment,Done);
  383. dispose(debuglist,Done);
  384. dispose(externals,Done);
  385. dispose(internals,Done);
  386. dispose(consts,Done);
  387. {$endif}
  388. { restore symtable state }
  389. {$ifdef UseBrowser}
  390. if (compile_level>1) then
  391. { we want to keep the current symtablestack }
  392. {$endif UseBrowser}
  393. begin
  394. refsymtable:=oldrefsymtable;
  395. symtablestack:=oldsymtablestack;
  396. end;
  397. procprefix:=oldprocprefix;
  398. { close the inputfiles }
  399. {$ifndef UseBrowser}
  400. { but not if we want the names for the browser ! }
  401. current_module^.sourcefiles.done;
  402. {$endif not UseBrowser}
  403. { restore scanner state }
  404. pattern:=oldpattern;
  405. token:=oldtoken;
  406. orgpattern:=oldorgpattern;
  407. parse_types:=oldparse_types;
  408. { call donescanner before restoring preprocstack, because }
  409. { donescanner tests for a empty preprocstack }
  410. { and can also check for unused macros }
  411. donescanner(current_module^.compiled);
  412. dispose(macros,done);
  413. macros:=oldmacros;
  414. preprocstack:=oldpreprocstack;
  415. aktswitches:=oldswitches;
  416. inputbuffer:=oldinputbuffer;
  417. inputpointer:=oldinputpointer;
  418. s_point:=olds_point;
  419. c:=oldc;
  420. comment_level:=oldcomment_level;
  421. parse_only:=oldparse_only;
  422. { restore asmlists }
  423. datasegment:=olddatasegment;
  424. bsssegment:=oldbsssegment;
  425. codesegment:=oldcodesegment;
  426. debuglist:=olddebuglist;
  427. externals:=oldexternals;
  428. internals:=oldinternals;
  429. importssection:=oldimports;
  430. exportssection:=oldexports;
  431. resourcesection:=oldresource;
  432. nextlabelnr:=oldnextlabelnr;
  433. exprasmlist:=oldexprasmlist;
  434. consts:=oldconsts;
  435. nextlabelnr:=oldnextlabelnr;
  436. reset_gdb_info;
  437. if (compile_level=1) then
  438. begin
  439. if (not AsmRes.Empty) then
  440. begin
  441. Message1(exec_i_closing_script,AsmRes.Fn);
  442. AsmRes.WriteToDisk;
  443. end;
  444. end;
  445. dec(compile_level);
  446. end;
  447. end.
  448. {
  449. $Log$
  450. Revision 1.1 1998-03-25 11:18:12 root
  451. Initial revision
  452. Revision 1.60 1998/03/24 21:48:32 florian
  453. * just a couple of fixes applied:
  454. - problem with fixed16 solved
  455. - internalerror 10005 problem fixed
  456. - patch for assembler reading
  457. - small optimizer fix
  458. - mem is now supported
  459. Revision 1.59 1998/03/20 23:31:33 florian
  460. * bug0113 fixed
  461. * problem with interdepened units fixed ("options.pas problem")
  462. * two small extensions for future AMD 3D support
  463. Revision 1.58 1998/03/13 22:45:58 florian
  464. * small bug fixes applied
  465. Revision 1.57 1998/03/10 17:19:29 peter
  466. * fixed bug0108
  467. * better linebreak scanning (concentrated in nextchar(), it supports
  468. #10, #13, #10#13, #13#10
  469. Revision 1.56 1998/03/10 16:27:40 pierre
  470. * better line info in stabs debug
  471. * symtabletype and lexlevel separated into two fields of tsymtable
  472. + ifdef MAKELIB for direct library output, not complete
  473. + ifdef CHAINPROCSYMS for overloaded seach across units, not fully
  474. working
  475. + ifdef TESTFUNCRET for setting func result in underfunction, not
  476. working
  477. Revision 1.55 1998/03/10 12:54:06 peter
  478. * def_symbol renamed to def_macro and use it in defines_macros
  479. Revision 1.54 1998/03/10 01:17:22 peter
  480. * all files have the same header
  481. * messages are fully implemented, EXTDEBUG uses Comment()
  482. + AG... files for the Assembler generation
  483. Revision 1.53 1998/03/06 00:52:34 peter
  484. * replaced all old messages from errore.msg, only ExtDebug and some
  485. Comment() calls are left
  486. * fixed options.pas
  487. Revision 1.52 1998/03/02 16:00:37 peter
  488. * -Ch works again
  489. Revision 1.51 1998/03/02 13:38:44 peter
  490. + importlib object
  491. * doesn't crash on a systemunit anymore
  492. * updated makefile and depend
  493. Revision 1.49 1998/02/28 00:20:31 florian
  494. * more changes to get import libs for Win32 working
  495. Revision 1.48 1998/02/27 22:27:56 florian
  496. + win_targ unit
  497. + support of sections
  498. + new asmlists: sections, exports and resource
  499. Revision 1.47 1998/02/24 10:29:17 peter
  500. * -a works again
  501. Revision 1.46 1998/02/24 00:19:14 peter
  502. * makefile works again (btw. linux does like any char after a \ )
  503. * removed circular unit with assemble and files
  504. * fixed a sigsegv in pexpr
  505. * pmodule init unit/program is the almost the same, merged them
  506. Revision 1.45 1998/02/22 23:03:25 peter
  507. * renamed msource->mainsource and name->unitname
  508. * optimized filename handling, filename is not seperate anymore with
  509. path+name+ext, this saves stackspace and a lot of fsplit()'s
  510. * recompiling of some units in libraries fixed
  511. * shared libraries are working again
  512. + $LINKLIB <lib> to support automatic linking to libraries
  513. + libraries are saved/read from the ppufile, also allows more libraries
  514. per ppufile
  515. Revision 1.44 1998/02/19 00:11:04 peter
  516. * fixed -g to work again
  517. * fixed some typos with the scriptobject
  518. Revision 1.43 1998/02/18 13:48:12 michael
  519. + Implemented an OS independent AsmRes object.
  520. Revision 1.42 1998/02/17 21:20:54 peter
  521. + Script unit
  522. + __EXIT is called again to exit a program
  523. - target_info.link/assembler calls
  524. * linking works again for dos
  525. * optimized a few filehandling functions
  526. * fixed stabs generation for procedures
  527. Revision 1.41 1998/02/16 12:51:35 michael
  528. + Implemented linker object
  529. Revision 1.40 1998/02/15 21:16:25 peter
  530. * all assembler outputs supported by assemblerobject
  531. * cleanup with assembleroutputs, better .ascii generation
  532. * help_constructor/destructor are now added to the externals
  533. - generation of asmresponse is not outputformat depended
  534. Revision 1.39 1998/02/14 01:45:26 peter
  535. * more fixes
  536. - pmode target is removed
  537. - search_as_ld is removed, this is done in the link.pas/assemble.pas
  538. + findexe() to search for an executable (linker,assembler,binder)
  539. Revision 1.38 1998/02/13 22:26:33 peter
  540. * fixed a few SigSegv's
  541. * INIT$$ was not written for linux!
  542. * assembling and linking works again for linux and dos
  543. + assembler object, only attasmi3 supported yet
  544. * restore pp.pas with AddPath etc.
  545. Revision 1.37 1998/02/13 10:35:17 daniel
  546. * Made Motorola version compilable.
  547. * Fixed optimizer
  548. Revision 1.36 1998/02/12 17:19:12 florian
  549. * fixed to get remake3 work, but needs additional fixes (output, I don't like
  550. also that aktswitches isn't a pointer)
  551. Revision 1.35 1998/02/12 11:50:16 daniel
  552. Yes! Finally! After three retries, my patch!
  553. Changes:
  554. Complete rewrite of psub.pas.
  555. Added support for DLL's.
  556. Compiler requires less memory.
  557. Platform units for each platform.
  558. Revision 1.34 1998/02/02 11:47:36 pierre
  559. + compilation stops at unit with error
  560. Revision 1.33 1998/02/01 22:41:08 florian
  561. * clean up
  562. + system.assigned([class])
  563. + system.assigned([class of xxxx])
  564. * first fixes of as and is-operator
  565. Revision 1.32 1998/01/30 17:31:23 pierre
  566. * bug of cyclic symtablestack fixed
  567. Revision 1.31 1998/01/29 12:13:21 michael
  568. * fixed Typos for library making
  569. Revision 1.30 1998/01/28 13:48:45 michael
  570. + Initial implementation for making libs from within FPC. Not tested, as compiler does not run
  571. Revision 1.29 1998/01/25 18:45:47 peter
  572. + Search for as and ld at startup
  573. + source_info works the same as target_info
  574. + externlink allows only external linking
  575. Revision 1.28 1998/01/23 21:14:59 carl
  576. * RunError 105 (file not open) with -Agas switch fix
  577. Revision 1.27 1998/01/23 17:55:11 michael
  578. + Moved linking stage to it's own unit (link.pas)
  579. Incorporated Pierres changes, but removed -E switch
  580. switch for not linking is now -Cn instead of -E
  581. Revision 1.26 1998/01/23 17:12:15 pierre
  582. * added some improvements for as and ld :
  583. - doserror and dosexitcode treated separately
  584. - PATH searched if doserror=2
  585. + start of long and ansi string (far from complete)
  586. in conditionnal UseLongString and UseAnsiString
  587. * options.pas cleaned (some variables shifted to globals)gl
  588. Revision 1.25 1998/01/22 14:47:16 michael
  589. + Reinstated linker options as -k option. How did they dissapear ?
  590. Revision 1.24 1998/01/17 01:57:36 michael
  591. + Start of shared library support. First working version.
  592. Revision 1.23 1998/01/16 22:34:37 michael
  593. * Changed 'conversation' to 'conversion'. Waayyy too much chatting going on
  594. in this compiler :)
  595. Revision 1.22 1998/01/14 12:52:04 michael
  596. - Removed the 'Assembled' line and replaced 'Calling Linker/assembler...'
  597. with 'Assembling/linking...'. Too much verbosity when V_info is on.
  598. Revision 1.21 1998/01/13 16:15:56 pierre
  599. * bug in interdependent units handling
  600. - primary unit was not in loaded_units list
  601. - current_module^.symtable was assigned too early
  602. - donescanner must not call error if the compilation
  603. of the unit was done at a higher level.
  604. Revision 1.20 1998/01/11 10:54:22 florian
  605. + generic library support
  606. Revision 1.19 1998/01/11 04:17:11 carl
  607. + correct heap and memory variables for m68k targets
  608. Revision 1.18 1998/01/08 23:56:39 florian
  609. * parser unit divided into several smaller units
  610. Revision 1.17 1998/01/08 17:10:12 florian
  611. * the name of the initialization part of a unit was sometimes written
  612. in lower case
  613. Revision 1.16 1998/01/07 00:16:56 michael
  614. Restored released version (plus fixes) as current
  615. Revision 1.13 1997/12/14 22:43:21 florian
  616. + command line switch -Xs for DOS (passes -s to the linker to strip symbols from
  617. executable)
  618. * some changes of Carl-Eric implemented
  619. Revision 1.12 1997/12/12 13:28:31 florian
  620. + version 0.99.0
  621. * all WASM options changed into MASM
  622. + -O2 for Pentium II optimizations
  623. Revision 1.11 1997/12/10 23:07:21 florian
  624. * bugs fixed: 12,38 (also m68k),39,40,41
  625. + warning if a system unit is without -Us compiled
  626. + warning if a method is virtual and private (was an error)
  627. * some indentions changed
  628. + factor does a better error recovering (omit some crashes)
  629. + problem with @type(x) removed (crashed the compiler)
  630. Revision 1.10 1997/12/09 13:50:36 carl
  631. * bugfix of possible alignment problems with m68k
  632. * bugfix of circular unit use -- could still give a stack overflow,
  633. so changed to fatalerror instead.
  634. * bugfix of nil procedural variables, fpc = @nil is illogical!
  635. (if was reversed!)
  636. Revision 1.9 1997/12/08 13:31:31 daniel
  637. * File was in DOS format. Translated to Unix.
  638. Revision 1.8 1997/12/08 10:01:08 pierre
  639. * nil for a procvar const was not allowed (os2_targ.pas not compilable)
  640. * bug in loadunit for units in implementation part already loaded
  641. (crashed on dos_targ.pas, thanks to Daniel who permitted me
  642. to find this bug out)
  643. Revision 1.7 1997/12/04 17:47:50 carl
  644. + renamed m68k units and refs to these units according to cpu rules.
  645. Revision 1.6 1997/12/02 15:56:13 carl
  646. * bugfix of postfixoperator with pd =nil
  647. * bugfix of motorola instructions types for exit code.
  648. Revision 1.5 1997/12/01 18:14:33 pierre
  649. * fixes a bug in nasm output due to my previous changes
  650. Revision 1.3 1997/11/28 18:14:40 pierre
  651. working version with several bug fixes
  652. Revision 1.2 1997/11/27 17:59:46 carl
  653. * made it compile under BP (line too long errors)
  654. Revision 1.1.1.1 1997/11/27 08:32:57 michael
  655. FPC Compiler CVS start
  656. Pre-CVS log:
  657. CEC Carl-Eric Codere
  658. FK Florian Klaempfl
  659. PM Pierre Muller
  660. + feature added
  661. - removed
  662. * bug fixed or changed
  663. History (started with version 0.9.0):
  664. 5th november 1996:
  665. * adapted to 0.9.0
  666. 25th november 1996:
  667. * more stuff adapted
  668. 9th december 1996:
  669. + support for different inline assemblers added (FK)
  670. 22th september:
  671. + support for PACKED RECORD implemented (FK)
  672. 24th september:
  673. + internal support of system.seg added (FK)
  674. * system.ofs bug fixed (FK)
  675. * problem with compiler switches solved (see also pass_1.pas) (FK)
  676. * all aktswitch memory is now recoverd (see also scanner.pas) (FK)
  677. 24th september 1997:
  678. * bug in ESI offset, pushed only if not nested, changed in cgi386.pas in v93 by (FK)
  679. but forgotten here (PM)
  680. 25th september:
  681. + parsing of open arrays implemented (FK)
  682. + parsing of high and low implemented (FK)
  683. + open array support also for proc vars added (FK)
  684. 1th october:
  685. * in typed constants is now the conversion int -> real
  686. automatically done (FK)
  687. 3rd october 1997:
  688. + started conversion to motorola 68000 - ifdef m68k to find
  689. changes (this makes the code look horrible, may later separate
  690. in includes?) - look for all ifdef i386 and ifdef m68k to see
  691. changes. (CEC)
  692. - commented out regnames (was unused) (CEC)
  693. + peepholeopt put in i386 define (not yet available for motorola
  694. 68000) (CEC)
  695. + i386 defines around a_att, in a_o and around a_wasm, a_nasm (CEC).
  696. + code for in_ord_x (PM)
  697. 4th october 1997:
  698. + checking for double definitions of function/procedure
  699. with same parameters in interface (PM)
  700. + enums with jumps set the boolean has_jumps and
  701. disable the succ and pred use (PM)
  702. 9th october 1997:
  703. * Fixed problem with 80float on the 68000 output, caused a GPF (CEC).
  704. 13th october 1997:
  705. + Added support for Motorola Standard assembler. (CEC)
  706. 15th october 1997:
  707. + added code for static modifier for objects variables and methods
  708. controlled by -St switch at command line (PM)
  709. 17th october 1997:
  710. + Added support for Motorola inline assembler (CEC)
  711. * Bugfix with .align 4,0x90, this is NOT allowed in TASM/MASM/WASM (CEC).
  712. + procedure set_macro and setting of fpc_* macros (FK)
  713. 19th october 1997:
  714. * Bugfix of RTS on 68000 target. PC Counter would become corrupt
  715. with paramsize (CEC).
  716. 23th october 1997:
  717. * Small bugfixes concerning SUBI #const,address_reg (CEC).
  718. 24th october 1997:
  719. * array[boolean] works now (FK)
  720. 25th october 1997:
  721. + CDECL and STDCALL (FK)
  722. * ASSEMBLER isn't a keyword anymore (FK)
  723. 3rd november 1997:
  724. + added symdif for sets (PM)
  725. 5th november 1997:
  726. * changed all while token<>ATOKEN do consume(token);
  727. by a procedure call consume_all_untill(ATOKEN)
  728. to test for _EOF (PM)
  729. * aktobjectname was not reset to '' at the end of objectcomponenten (PM)
  730. 14th november 1997:
  731. * removed bug for procvar where the type was not allways set correctly (PM)
  732. + integer const not in longint range converted to real constant (PM)
  733. 25th november 1997:
  734. * removed bugs due to wrong current_module references in compile procedure (PM)
  735. }