Commit Graph

251 Commits

Author SHA1 Message Date
peter
af5a4842d5 * insert framepointer as voidpointer instead of returntype 2003-11-03 17:47:30 +00:00
peter
19727a3609 * don't search for overloads in parents for constructors 2003-10-30 16:23:13 +00:00
peter
079e489b08 * absolute to object field supported, fixes tb0458 2003-10-28 15:36:01 +00:00
peter
e720d73bd9 * compare_paras() has a parameter to ignore hidden parameters
* cross unit overload searching ignores hidden parameters when
    comparing parameter lists. Now function(string):string is
    not overriden with procedure(string) which has the same visible
    parameter list
2003-10-07 21:14:32 +00:00
peter
828df46e33 * procvar varargs fixed 2003-10-07 20:52:54 +00:00
peter
da9f5e2319 * c style array of const generates callparanodes
* varargs paraloc fixes
2003-10-05 21:21:52 +00:00
peter
60e2738c22 * temporary fix for compilerprocs on watcom 2003-10-05 11:10:52 +00:00
peter
3a92a2a25a * parameter alignment fixes 2003-10-03 22:00:33 +00:00
peter
2bec6b14fc * procvar directive parsing fixes 2003-10-02 21:13:09 +00:00
peter
7900a544a3 * searchsym_type to search for type definitions. It ignores
records,objects and parameters
2003-10-01 19:05:33 +00:00
peter
c1c8c5dbb1 * don't look in objectsymtable when parsing the function return type 2003-10-01 18:28:55 +00:00
florian
d85e1a9bf4 * para items are now reversed for pascal calling conventions 2003-10-01 16:49:05 +00:00
peter
2c4df4364e * fix check that filedef needs var para 2003-09-28 21:44:55 +00:00
peter
99bb20747e * parent framepointer changed to hidden parameter
* tloadparentfpnode added
2003-09-28 17:55:03 +00:00
peter
eee2002780 * don't include vo_has_local_copy for open array/array of const 2003-09-25 21:24:09 +00:00
peter
06071e3d31 * remove obsolete code 2003-09-23 20:36:47 +00:00
peter
8af51ea6d3 * locals and paras are allocated in the code generation
* tvarsym.localloc contains the location of para/local when
    generating code for the current procedure
2003-09-23 17:56:05 +00:00
peter
76a53a375d * varspez in calls to push_addr_param 2003-09-16 16:17:01 +00:00
peter
3a3d710c47 * basics for x86 register calling 2003-09-09 21:03:17 +00:00
peter
0a8bddc756 * calling convention fix 2003-09-09 15:54:10 +00:00
peter
b9d09a4e5c * preparations for different default calling conventions
* various RA fixes
2003-09-07 22:09:34 +00:00
florian
220e05dd5e * fixed arm concatcopy
+ arm support in the common compiler sources added
  * moved some generic cg code around
  + tfputype added
  * ...
2003-09-03 11:18:36 +00:00
peter
b7d99ec934 * paraloc splitted in callerparaloc,calleeparaloc
* sparc calling convention updates
2003-07-02 22:18:04 +00:00
peter
0dceec9a64 * current_procdef removed, use current_procinfo.procdef instead 2003-06-13 21:19:30 +00:00
peter
be7a5b76a4 * set po_public also when parsing the object declaration 2003-06-05 20:04:43 +00:00
Jonas Maebe
6f3e16298a * function results can now also be regvars
- removed tprocinfo.return_offset, never use it again since it's invalid
    if the result is a regvar
2003-06-02 21:42:05 +00:00
peter
345228fd29 * defer codegeneration for nested procedures 2003-05-22 21:31:35 +00:00
peter
92ee1804b6 * removed selfpointer_offset, vmtpointer_offset
* tvarsym.adjusted_address
  * address in localsymtable is now in the real direction
  * removed some obsolete globals
2003-05-15 18:58:53 +00:00
peter
a467b84faa * fixed various crashes 2003-05-13 15:18:49 +00:00
peter
1a2eedd767 * self moved to hidden parameter
* removed hdisposen,hnewn,selfn
2003-05-09 17:47:02 +00:00
peter
e2cbae0ff1 * vs_hidden replaced by is_hidden boolean 2003-05-05 14:53:16 +00:00
florian
9e0e8340f7 + first changes to make self a hidden parameter 2003-04-30 09:42:42 +00:00
peter
60978ba89c * aktprocdef renamed to current_procdef
* procinfo renamed to current_procinfo
  * procinfo will now be stored in current_module so it can be
    cleaned up properly
  * gen_main_procsym changed to create_main_proc and release_main_proc
    to also generate a tprocinfo structure
  * fixed unit implicit initfinal
2003-04-27 11:21:32 +00:00
peter
7f14891d66 * aktprocdef cleanup, aktprocdef is now always nil when parsing
a new procdef declaration
  * aktprocsym removed
  * lexlevel removed, use symtable.symtablelevel instead
  * implicit init/final code uses the normal genentry/genexit
  * funcret state checking updated for new funcret handling
2003-04-27 07:29:50 +00:00
peter
fe96aad6d6 * vo_is_result flag added for the special RESULT symbol 2003-04-26 00:33:07 +00:00
peter
f4b818fc1d * removed funcretn,funcretsym, function result is now in varsym
and aliases for result and function name are added using absolutesym
  * vs_hidden parameter for funcret passed in parameter
  * vs_hidden fixes
  * writenode changed to printnode and released from extdebug
  * -vp option added to generate a tree.log with the nodetree
  * nicer printnode for statements, callnode
2003-04-25 20:59:33 +00:00
florian
47a3437dba * comp is now written with its bit pattern to the ppu instead as an extended 2003-04-24 13:03:01 +00:00
peter
74756e4e85 * fix po_comp setting for fpc mode 2003-04-23 13:12:26 +00:00
peter
5207aaf391 * don't check po_varargs for delphi 2003-04-23 10:12:51 +00:00
peter
e248c0ece4 * fixed C style array of const
* fixed C array passing
  * fixed left to right with high parameters
2003-04-22 13:47:08 +00:00
peter
8da3f59d32 * vs_hidden released 2003-04-10 17:57:52 +00:00
peter
c4ddcc78a8 * generic constructor working for i386
* remove fixed self register
  * esi added as address register for i386
2003-03-28 19:16:56 +00:00
Tomas Hajny
8e7124f9f8 + emx target added 2003-03-23 23:11:17 +00:00
peter
31cee7b219 * only allow class [procedure|function] 2003-03-19 17:34:04 +00:00
peter
d42645ca0a * fix crash with duplicate id 2003-03-17 18:56:02 +00:00
peter
ec66760702 * store symoptions also for procdef
* check symoptions (private,public) when calculating possible
    overload candidates
2003-03-17 15:54:22 +00:00
carl
3967f76cdd * fix highname problem 2003-01-15 20:02:28 +00:00
peter
71e2d34b5a * m68k pathexist update from 1.0.x
* palmos res update from 1.0.x
2003-01-12 15:42:23 +00:00
peter
b49747a854 * removed some duplicate code when creating aktprocsym 2003-01-07 19:16:38 +00:00
peter
26a1786491 * more conflicts for constructor/destructor types 2003-01-05 18:17:45 +00:00
peter
bff0d3dd3e * pascal directive also conflicts with constructor 2003-01-05 18:09:36 +00:00
peter
cf5d395f0a * update self parameter only for methodpointer and methods 2003-01-02 19:49:00 +00:00
peter
d0725b2e7d * high value insertion changed so it works also when 2 parameters
are passed
2003-01-01 22:51:03 +00:00
peter
0e31df2ab8 * don't check for export directive repeat 2003-01-01 14:35:33 +00:00
peter
d7bedca213 * delphi allows setting calling convention in interface or
implementation
2002-12-29 18:16:06 +00:00
peter
24b7def7c2 * fix static method check
* don't require class for class methods in the implementation for
    non delphi modes
2002-12-29 14:55:44 +00:00
peter
b7d0f39211 * check procoptions when a forward is found
* exclude some call directives for constructor/destructor
2002-12-27 15:25:14 +00:00
peter
9147303907 * duplicate procsym-unitsym fix 2002-12-25 01:26:56 +00:00
peter
9f00031530 * remove code that skipped the _ prefix for win32 imports 2002-12-24 21:21:06 +00:00
peter
a44cae75fc * fix wrong internalerror when var names were different 2002-12-23 21:24:22 +00:00
peter
1c3ac34aa8 * cdecl array fix, hack to change it to vs_var is not needed 2002-12-23 20:58:52 +00:00
peter
46ed8eb932 * fixed pushing of records>8 bytes with stdcall
* simplified hightree loading
2002-12-17 22:19:33 +00:00
peter
133dee3633 * don't allow external in object declarations 2002-12-15 21:07:30 +00:00
florian
3f5541e996 + some front end stuff for vs_hidden added 2002-12-15 19:34:31 +00:00
carl
081a4aab35 * 3% memory optimization
* changed some types
  + added type checking with different size for call node and for
     parameters
2002-12-07 14:27:07 +00:00
peter
dc66eafb0b * merged cdecl and array fixes 2002-12-06 17:51:09 +00:00
carl
38f35b25cc * cleanup of error messages 2002-12-01 22:06:14 +00:00
carl
5c5db0e0a3 + unimplemented hint directive added
* hint directive parsing implemented
  * warning on these directives
2002-11-29 22:31:19 +00:00
peter
0da515f669 * fixed typo in method comparing 2002-11-27 02:35:28 +00:00
peter
f3fc72095f * splitted defbase in defutil,symutil,defcmp
* merged isconvertable and is_equal into compare_defs(_ext)
  * made operator search faster by walking the list only once
2002-11-25 17:43:16 +00:00
peter
a496dbe1ff * pass proccalloption to ret_in_xxx and push_xxx functions 2002-11-18 17:31:54 +00:00
carl
64655be168 * memory optimization (3-4%) : cleanup of tai fields,
cleanup of tdef and tsym fields.
  * make it work for m68k
2002-11-17 16:31:55 +00:00
peter
a073dadb63 * fix infinite loop in pd_inline 2002-11-16 14:20:50 +00:00
peter
bfd72ad5d5 * merged changes from 1.0.7 up to 04-11
- -V option for generating bug report tracing
    - more tracing for option parsing
    - errors for cdecl and high()
    - win32 import stabs
    - win32 records<=8 are returned in eax:edx (turned off by default)
    - heaptrc update
    - more info for temp management in .s file with EXTDEBUG
2002-11-15 01:58:45 +00:00
peter
b4ec92dad3 * variant:=nil supported 2002-10-06 15:09:12 +00:00
carl
f3d9f997cd * low-highval always checked if limit ober 2GB is reached (to avoid overflow) 2002-09-27 21:13:28 +00:00
peter
cea50f7185 * add argument to equal_paras() to support default values or not 2002-09-16 14:11:12 +00:00
peter
706ec85bcb * don't insert parast in symtablestack, because typesyms should not be
searched in the the parast
2002-09-10 16:27:28 +00:00
peter
2e6865175e * check return type for forwarddefs also not delphi mode when
the type is not void
2002-09-09 19:39:07 +00:00
peter
a540ff122c * tdicationary.replace added to replace and item in a dictionary. This
is only allowed for the same name
  * varsyms are inserted in symtable before the types are parsed. This
    fixes the long standing "var longint : longint" bug
  - consume_idlist and idstringlist removed. The loops are inserted
    at the callers place and uses the symtable for duplicate id checking
2002-09-09 17:34:14 +00:00
peter
dcd9e0107c * old logs removed and tabs fixed 2002-09-07 15:25:00 +00:00
daniel
b0364566d1 * Make Tprocdef.defs protected 2002-09-03 16:26:26 +00:00
peter
f68c3a9552 * calc param_offset after parameters are read, because the calculation
depends on po_containself
2002-09-01 12:11:33 +00:00
peter
a28f75ed03 * sym.insert_in_data removed
* symtable.insertvardata/insertconstdata added
  * removed insert_in_data call from symtable.insert, it needs to be
    called separatly. This allows to deref the address calculation
  * procedures now calculate the parast addresses after the procedure
    directives are parsed. This fixes the cdecl parast problem
  * push_addr_param has an extra argument that specifies if cdecl is used
    or not
2002-08-25 19:25:18 +00:00
peter
8a43a12934 * also check the paratypes when a forward was found 2002-08-25 11:33:06 +00:00
peter
91b49914f6 * More fixes for cross unit inlining, all tnodes are now implemented
* Moved pocall_internconst to po_internconst because it is not a
    calling type at all and it conflicted when inlining of these small
    functions was requested
2002-08-19 19:36:42 +00:00
peter
98dd65b0f3 * inlining is now also allowed in interface
* renamed write/load to ppuwrite/ppuload
  * tnode storing in ppu
  * nld,ncon,nbas are already updated for storing in ppu
2002-08-18 20:06:23 +00:00
florian
e313bab4ff * first part of procinfo rewrite 2002-08-17 09:23:33 +00:00
peter
425bb45ddc * renamed current_library to objectlibrary 2002-08-11 14:32:25 +00:00
peter
ac71268ce6 * saving of asmsymbols in ppu supported
* asmsymbollist global is removed and moved into a new class
    tasmlibrarydata that will hold the info of a .a file which
    corresponds with a single module. Added librarydata to tmodule
    to keep the library info stored for the module. In the future the
    objectfiles will also be stored to the tasmlibrarydata class
  * all getlabel/newasmsymbol and friends are moved to the new class
2002-08-11 13:24:10 +00:00
florian
eb2ca8d10f * rewrote the system handling 2002-07-26 21:15:37 +00:00
florian
59abf2555b * types.pas renamed to defbase.pas because D6 contains a types
unit so this would conflicts if D6 programms are compiled
  + Willamette/SSE2 instructions to assembler added
2002-07-20 11:57:52 +00:00
florian
336808f6c3 * start of the new generic parameter handling 2002-07-11 14:41:27 +00:00
peter
4285e99853 * internal linker
* reorganized aasm layer
2002-07-01 18:46:20 +00:00
peter
06ebac4e27 * readded missing revisions 2002-05-18 13:34:04 +00:00
carl
21b3a10f02 + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+ try to fix temp allocation (still in ifdef)
+ generic constructor calls
+ start of tassembler / tmodulebase class cleanup
2002-05-16 19:46:34 +00:00
peter
2992e1819c * removed old logs and updated copyright year 2002-05-14 19:34:38 +00:00
peter
4dcd96747e * moved entry and exitcode to ncgutil and cgobj
* foreach gets extra argument for passing local data to the
    iterator function
  * -CR checks also class typecasts at runtime by changing them
    into as
  * fixed compiler to cycle with the -CR option
  * fixed stabs with elf writer, finally the global variables can
    be watched
  * removed a lot of routines from cga unit and replaced them by
    calls to cgobj
  * u32bit-s32bit updates for and,or,xor nodes. When one element is
    u32bit then the other is typecasted also to u32bit without giving
    a rangecheck warning/error.
  * fixed pascal calling method with reversing also the high tree in
    the parast, detected by tcalcst3 test
2002-05-12 16:53:04 +00:00
peter
6320530bdd * removed newn and disposen nodes, the code is now directly
inlined from pexpr
  * -an option that will write the secondpass nodes to the .s file, this
    requires EXTDEBUG define to actually write the info
  * fixed various internal errors and crashes due recent code changes
2002-04-21 19:02:03 +00:00
carl
87aa88e9b7 + generic FPC_CHECKPOINTER
+ first parameter offset in stack now portable
* rename some constants
+ move some cpu stuff to other units
- remove unused constents
* fix stacksize for some targets
* fix generic size problems which depend now on EXTEND_SIZE constant
2002-04-20 21:32:23 +00:00
carl
1825ca25de - remove ifdef i386 define 2002-04-20 15:27:05 +00:00
peter
70ff711f73 * mangledname rewrite, tprocdef.mangledname is now created dynamicly
in most cases and not written to the ppu
  * add mangeledname_prefix() routine to generate the prefix of
    manglednames depending on the current procedure, object and module
  * removed static procprefix since the mangledname is now build only
    on demand from tprocdef.mangledname
2002-04-19 15:46:01 +00:00
carl
5befcda7e5 + target_info.size_of_pointer -> pointer_Size 2002-04-15 18:57:22 +00:00
peter
2750eb5017 * fixed memory corruption created by previous fix 2002-03-29 13:29:32 +00:00
michael
8e7bb6837f + Patch from Pavel Ozerski 2002-03-29 11:23:24 +00:00
peter
fd2ad837e2 * implicit result variable generation for assembler routines
* removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
2002-01-24 18:25:48 +00:00
michael
67732f1df0 + Patch from peter for library imports 2002-01-09 07:38:03 +00:00
peter
5a323a0f6e * fixed external <dll> name <c-name> manglednames 2002-01-06 21:54:07 +00:00
peter
60d2ddbbd5 * protected/private symbols parsing fixed 2001-12-31 16:59:41 +00:00
florian
b60666ae1f + parasym to tparaitem added 2001-12-06 17:57:33 +00:00
peter
d2e1952377 * procsym definition rewrite 2001-11-02 22:58:00 +00:00
peter
e37dbf904d * calling convention rewrite 2001-10-25 21:22:32 +00:00
peter
17d62feebe * $calling directive and -Cc commandline patch added
from Pavel Ozerski
2001-10-23 21:49:42 +00:00
Jonas Maebe
2c87e58a77 * allow self parameter for normal procedures again (because Kylix allows
it too) ("merged")
2001-10-01 13:38:44 +00:00
Jonas Maebe
6a15178f0f * fixed web bug #1593
* writing of procvar headers is more complete (mention var/const/out for
    paras, add "of object" if applicable)
  + error if declaring explicit self para as var/const
  * fixed mangled name of procedures which contain an explicit self para
  * parsing para's should be slightly faster because mangled name of
    procedure is only updated once instead of after parsing each para
    (all merged from fixes)
2001-09-10 10:26:26 +00:00
florian
9746f4c2d6 * some cg reorganisation
* some PPC updates
2001-08-26 13:35:06 +00:00
Jonas Maebe
a6cfe4083a + tempcreate/ref/delete nodes (allows the use of temps in the
resulttype and first pass)
  * made handling of read(ln)/write(ln) processor independent
  * moved processor independent handling for str and reset/rewrite-typed
    from firstpass to resulttype pass
  * changed names of helpers in text.inc to be generic for use as
    compilerprocs + added "iocheck" directive for most of them
  * reading of ordinals is done by procedures instead of functions
    because otherwise FPC_IOCHECK overwrote the result before it could
    be stored elsewhere (range checking still works)
  * compilerprocs can now be used in the system unit before they are
    implemented
  * added note to errore.msg that booleans can't be read using read/readln
2001-08-23 14:28:35 +00:00
florian
032023f8de * some interfaces related problems regarding
mapping of interface implementions fixed
2001-08-22 21:16:20 +00:00
florian
7db13ea48f * some bugs fix:
- overload; with external procedures fixed
    - better selection of routine to do an overloaded
      type case
    - ... some more
2001-08-19 21:11:20 +00:00
peter
fd8e5fa78c * palmos support from v10 merged 2001-08-19 11:22:22 +00:00
peter
071c6bc59a * turn pocall_inline off when inline is not supported 2001-08-05 13:18:50 +00:00
Jonas Maebe
367f7a0362 + "compilerproc" directive support, which turns both the public and mangled
name to lowercase(declaration_name). This prevents a normal user from
    accessing the routine, but they can still be easily looked up within
    the compiler. This is used for helper procedures and should facilitate
    the writing of more processor independent code in the code generator
    itself (mostly written by Peter)
  + new "createintern" constructor for tcal nodes to create a call to
    helper exported using the "compilerproc" directive
  + support for high(dynamic_array) using the the above new things
  + definition of 'HASCOMPILERPROC' symbol (to be able to check in the
    compiler and rtl whether the "compilerproc" directive is supported)
2001-08-01 15:07:29 +00:00
peter
7321b8436e * fixed overload checking for delphi. Empty parameters are only
allowed in implementation and not when the forward declaration
    contains overload directive
2001-07-09 21:11:14 +00:00
peter
b10e754536 * alignmentinfo record added
* -Oa argument supports more alignment settings that can be specified
    per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
    RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
    required alignment and the maximum usefull alignment. The final
    alignment will be choosen per variable size dependent on these
    settings
2001-07-01 20:16:15 +00:00
peter
4f4f28606d * fixed crash with procvar directive parsing. Be carefull as the procvar
directive parsing uses aktprocsym.definition that is a tprocdef, but
    for procvar the type is tprocvardef. So some fields are not available
2001-06-04 18:12:26 +00:00
peter
e652444594 + varargs directive 2001-06-04 11:53:12 +00:00
peter
f86ce17588 + hint directive parsing support 2001-06-03 21:57:35 +00:00
florian
05cfc07952 * some more support for widechars commited especially
regarding type casting and constants
2001-05-08 21:06:30 +00:00
Jonas Maebe
40ca771131 * fixed bug for overloaded operators with a return type that has a size
which isn't a multiple of the target_os.stackalignment (main branch
    patch from Peter)
2001-05-08 14:32:58 +00:00
florian
3c5793d8c6 * some Delphi incompatibilities fixed:
- out, dispose and new can be used as idenfiers now
     - const p = apointerype(nil); is supported now
  + support for const p = apointertype(pointer(1234)); added
2001-05-04 15:52:03 +00:00
peter
0c03535b5b * registration of targets and assemblers 2001-04-18 22:01:53 +00:00
peter
54b534cde7 * better check for globalsymtable 2001-04-13 20:05:15 +00:00
peter
79b1b63dcb * give error with local external procedure 2001-04-13 18:03:15 +00:00
peter
a7cf57524e * symtable change to classes
* range check generation and errors fixed, make cycle DEBUG=1 works
  * memory leaks fixed
2001-04-13 01:22:06 +00:00
peter
b193bf7df3 * remove unnecessary calls to firstpass 2001-04-04 22:43:50 +00:00
peter
4e2655cdc5 * resulttype rewrite 2001-04-02 21:20:29 +00:00
florian
07adca76f2 * procedure p(); is now allowed in all modes except TP 2001-03-24 12:18:11 +00:00
florian
1008d7faa0 + support for type a = (a=1); in Delphi mode added
+ procedure p(); in Delphi mode supported
  + on isn't keyword anymore, it can be used as
    id etc. now
2001-03-22 22:35:42 +00:00
peter
d8abf76f6b * getsym redesign, removed the globals srsym,srsymtable 2001-03-11 22:58:49 +00:00
peter
aab27143a3 * patch from Pavel with a new and much faster DLL Scanner for
automatic importing so $linklib works for DLLs. Thanks Pavel!
2001-03-06 18:28:02 +00:00
peter
f0e23ff231 * fixed crash with unsupported token overloading 2001-01-08 21:40:26 +00:00
peter
32b9cdb7cf + new tlinkedlist class (merge of old tstringqueue,tcontainer and
tlinkedlist objects)
2000-12-25 00:07:25 +00:00
florian
b9796f6a7f * unused units removed from uses clause
* some changes for widestrings
2000-11-29 00:30:30 +00:00
florian
6cacd92aff * pascal modifier in interfaces of units works now 2000-11-26 23:45:34 +00:00
peter
8df98007d6 * more fixes to get make cycle working 2000-11-06 20:30:54 +00:00
florian
51527ba1c9 + merged Attila's changes for interfaces, not tested yet 2000-11-04 14:25:19 +00:00
peter
5115083270 * tprocdef.fullprocname added for better casesensitve writing of
procedures
2000-11-01 23:04:37 +00:00
peter
451723647e * symtable splitted, no real code changes 2000-10-31 22:02:46 +00:00
florian
f80c24177a * a lot of changes:
- basic dyn. array support
     - basic C++ support
     - some work for interfaces done
     ....
2000-10-21 18:16:11 +00:00
peter
eb3ca9c51d * unit names and procedure names are stored mixed case 2000-10-15 07:47:51 +00:00