Commit Graph

225 Commits

Author SHA1 Message Date
peter
23f6b91c4a * extended information about overloaded candidates when compiled
with EXTDEBUG
2003-01-09 21:45:46 +00:00
Jonas Maebe
ed5a4a6977 * fixed check for whether or not a high parameter was already generated
* no type checking/conversions for invisible parameters
2002-12-26 18:24:33 +00:00
florian
c7ca2ff901 + some stuff for the new hidden parameter handling added 2002-12-15 22:50:00 +00:00
peter
772d7147cd * give sign difference between ordinals a small penalty. This is
needed to get word->[longword|longint] working
2002-12-15 21:34:15 +00:00
florian
1da30f2610 * tcallnode.paraitem introduced, all references to defcoll removed 2002-12-15 21:30:12 +00:00
peter
5ebf9afd63 * fix crash with default parameters 2002-12-15 20:59:58 +00:00
peter
a2a1a36e83 * ignore vs_hidden parameters when choosing overloaded proc 2002-12-15 11:26:02 +00:00
peter
d611c25599 * tcallnode.det_resulttype rewrite, merged code from nice_ncal and
the old code. The new code collects the information about possible
    candidates only once resultting in much less calls to type compare
    routines
2002-12-11 22:42:28 +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
peter
cab4c8879f * only compile cs_fp_emulation support when cpufpuemu is defined
* define cpufpuemu for m68k only
2002-12-06 16:56:57 +00:00
peter
1b116848d8 * cdecl array of const fixes 2002-11-27 20:04:38 +00:00
peter
67153fd9a1 * the never ending story of tp procvar hacks 2002-11-27 15:33:46 +00:00
peter
1ba12c259e * fixed inlinetree parsing in det_resulttype 2002-11-27 02:31:17 +00:00
carl
6a52e7a9e5 - removed the invalid if <> checking (Delphi is strange on this)
+ implemented abstract warning on instance creation of class with
    abstract methods.
 * some error message cleanups
2002-11-25 18:43:31 +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
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
carl
ed1a28dcdc * var parameter checking for classes and interfaces in Delphi mode 2002-10-14 18:20:30 +00:00
peter
a1b570bc48 * fixed limit checking for qword 2002-10-06 21:02:17 +00:00
peter
ebbf4d8d14 * Write unknwon compiler proc using Comment and only in Extdebug 2002-10-05 15:15:45 +00:00
carl
67486c96c3 * fixes for Delphi 6 compilation
(warning : Some features do not work under Delphi)
2002-10-05 12:43:23 +00:00
peter
9d0437f8aa * support inherited; support for overload as it is handled by
delphi. This is only for delphi mode as it is working is
    undocumented and hard to predict what is done
2002-10-05 00:48:57 +00:00
peter
cea50f7185 * add argument to equal_paras() to support default values or not 2002-09-16 14:11:12 +00:00
peter
6d0e34fa5e * don't have strict var parameter checking for procedures in the
system unit
2002-09-15 17:49:59 +00:00
peter
ab536bffc2 * don't allow convertable parameters for var and out parameters in
delphi and tp mode
2002-09-09 19:30:34 +00:00
peter
dcd9e0107c * old logs removed and tabs fixed 2002-09-07 15:25:00 +00:00
carl
6c2bede5a8 * second part bug report 1996 fix, testrange in cordconstnode
only called if option is set (also make parsing a tiny faster)
2002-09-07 12:16:03 +00:00
peter
f5a4b06b8a * fixed old callnode.det_resulttype code
* old ncal code is default again
2002-09-05 14:53:41 +00:00
daniel
c2fcc297ad * Small bugfix for procdef selection 2002-09-03 21:32:49 +00:00
daniel
d5870e8075 * Activated new ncal code 2002-09-03 19:27:22 +00:00
daniel
b0364566d1 * Make Tprocdef.defs protected 2002-09-03 16:26:26 +00:00
daniel
f4c6d762fd - write_access fields removed in favor of a flag 2002-09-01 13:28:37 +00:00
peter
8ee2462ba4 * remove debug line
* containself methods can be called directly
2002-09-01 12:14:15 +00:00
daniel
4b82d30953 * Removed sets from Tcallnode.det_resulttype
+ Added read/write notifications of variables. These will be usefull
   for providing information for several optimizations. For example
   the value of the loop variable of a for loop does matter is the
   variable is read after the for loop, but if it's no longer used
   or written, it doesn't matter and this can be used to optimize
   the loop code generation.
2002-09-01 08:01:16 +00:00
peter
770b338833 * also firstpass funcretrefnode if available. This was breaking the
asnode compilerproc code
2002-08-23 16:13:16 +00:00
daniel
ba29715c7a * Tcallnode.det_resulttype rewritten 2002-08-20 10:31:26 +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
florian
4144773f01 * result type handling in tcgcal.pass_2 overhauled
* better tnode.dowrite
  * some ppc stuff fixed
2002-08-17 22:09:43 +00:00
florian
e313bab4ff * first part of procinfo rewrite 2002-08-17 09:23:33 +00:00
carl
745efb2c47 * issameref() to test if two references are the same (then emit no opcodes)
+ ret_in_reg to replace ret_in_acc
    (fix some register allocation bugs at the same time)
  + save_std_register now has an extra parameter which is the
    usedinproc registers
2002-08-16 14:24:57 +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
daniel
399036f1c2 * State tracker work
* The whilen and repeatn are now completely unified into whilerepeatn. This
  allows the state tracker to change while nodes automatically into
  repeat nodes.
* Resulttypepass improvements to the notn. 'not not a' is optimized away and
  'not(a>b)' is optimized into 'a<=b'.
* Resulttypepass improvements to the whilerepeatn. 'while not a' is optimized
  by removing the notn and later switchting the true and falselabels. The
  same is done with 'repeat until not a'.
2002-07-19 11:41:34 +00:00
florian
c3f4220f3b * readded removed changes 2002-07-15 18:03:14 +00:00
daniel
eeae0e4c00 + Added the beginning of a state tracker. This will track the values of
variables through procedures and optimize things away.
2002-07-14 18:00:43 +00:00
florian
336808f6c3 * start of the new generic parameter handling 2002-07-11 14:41:27 +00:00
florian
479a745096 * first x86-64 patches 2002-07-04 20:43:00 +00:00
peter
68ce5a00e5 * cg64 patch
* basics for currency
  * asnode updates for class and interface (not finished)
2002-07-01 16:23:52 +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
cc8c4d7093 * moved more routines from cga/n386util 2002-04-25 20:16:38 +00:00
florian
6bbaa14daf * block nodes within expressions shouldn't release the used registers,
fixed using a flag till the new rg is ready
2002-04-25 20:15:39 +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
peter
c7428a9e4a * allow passing the address of a procedure to a formal parameter
in delphi mode
2002-04-16 16:09:08 +00:00
peter
3bcfe33002 * fixed stackcheck that would be called recursively when a stack
error was found
  * generic changeregsize(reg,size) for i386 register resizing
  * removed some more routines from cga unit
  * fixed returnvalue handling
  * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
2002-04-15 19:44:18 +00:00
carl
5befcda7e5 + target_info.size_of_pointer -> pointer_Size 2002-04-15 18:57:22 +00:00
peter
5b242f7741 * tlocation,treference update
* LOC_CONSTANT added for better constant handling
  * secondadd splitted in multiple routines
  * location_force_reg added for loading a location to a register
    of a specified size
  * secondassignment parses now first the right and then the left node
    (this is compatible with Kylix). This saves a lot of push/pop especially
    with string operations
  * adapted some routines to use the new cg methods
2002-04-02 17:11:27 +00:00
Jonas Maebe
7fb55bf4e4 + a_loadfpu_* and a_loadmm_* methods in tcg
* register allocation is now handled by a class and is mostly processor
    independent (+rgobj.pas and i386/rgcpu.pas)
  * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  * some small improvements and fixes to the optimizer
  * some register allocation fixes
  * some fpuvaroffset fixes in the unary minus node
  * push/popusedregisters is now called rg.save/restoreusedregisters and
    (for i386) uses temps instead of push/pop's when using -Op3 (that code is
    also better optimizable)
  * fixed and optimized register saving/restoring for new/dispose nodes
  * LOC_FPU locations now also require their "register" field to be set to
    R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  - list field removed of the tnode class because it's not used currently
    and can cause hard-to-find bugs
2002-03-31 20:26:33 +00:00
carl
c50d06d4de * avoid crash with inline routines 2002-03-30 23:02:42 +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
Jonas Maebe
2b3898aeff * adapted ranges of native types to int64 (e.g. high cardinal is no
longer longint($ffffffff), but just $fffffff in psystem)
  * small additional fix in 64bit rangecheck code generation for 32 bit
    processors
  * adaption of ranges required the matching talgorithm used for selecting
    which overloaded procedure to call to be adapted. It should now always
    select the closest match for ordinal parameters.
  + inttostr(qword) in sysstr.inc/sysstrh.inc
  + abs(int64), sqr(int64), sqr(qword) in systemh.inc/generic.inc (previous
    fixes were required to be able to add them)
  * is_in_limit() moved from ncal to types unit, should always be used
    instead of direct comparisons of low/high values of orddefs because
    qword is a special case
2002-01-24 12:33:52 +00:00
peter
2e96721c20 * fixed path appending for lib 2002-01-19 11:57:05 +00:00
peter
60d2ddbbd5 * protected/private symbols parsing fixed 2001-12-31 16:59:41 +00:00
Jonas Maebe
479f1a5ce9 * fixed to my previous patch: the hightree must always be converted to a
longint
2001-12-11 13:21:36 +00:00
Jonas Maebe
8ddb738e07 * gen_high_tree now uses an inline node of type in_high_x in most cases
so that it doesn't duplicate any code anymore from ninl.pas (and
    dynamic array support was still missing)
2001-12-10 14:28:47 +00:00
peter
f20cbc5edf * require overload for cross object overloading 2001-11-20 18:49:43 +00:00
peter
2dc60c9fed * use cp_value_equal_const instead of cp_all 2001-11-18 20:18:54 +00:00
peter
faf78ea813 * overloading supported in child classes
* fixed parsing of classes with private and virtual and overloaded
    so it is compatible with delphi
2001-11-18 18:43:13 +00:00
peter
887f6ba34c * removed obsolete chainprocsym and test_procsym code 2001-11-02 23:16:50 +00:00
peter
d2e1952377 * procsym definition rewrite 2001-11-02 22:58:00 +00:00
peter
ac400051bd * allow assignment of overloaded procedures to procvars when we know
which procedure to take
2001-10-28 17:22:25 +00:00
peter
e37dbf904d * calling convention rewrite 2001-10-25 21:22:32 +00:00
Jonas Maebe
42002892ab * fixed bug with using procedures as procvar parameters in TP/Delphi mode 2001-10-13 09:01:14 +00:00
peter
68bc48c96a * nested inline fix (merged) 2001-10-12 16:04:32 +00:00
peter
43dea5a35f * move class of definitions into type section for delphi 2001-09-02 21:12:06 +00:00
Jonas Maebe
a41949db8e * fixed docompare for the fields I added to tcallnode in my previous
commit
  * removed nested comment warning
2001-08-30 15:39:59 +00:00
Jonas Maebe
105b7ae809 + new createinternres() constructor for tcallnode to support setting a
custom resulttype
  * compilerproc typeconversions now set the resulttype from the type
    conversion for the generated call node, because the resulttype of
    of the compilerproc helper isn't always exact (e.g. the ones that
    return shortstrings, actually return a shortstring[x], where x is
    specified by the typeconversion node)
  * ti386callnode.pass_2 now always uses resulttype instead of
    procsym.definition.rettype (so the custom resulttype, if any, is
    always used). Note that this "rettype" stuff is only for use with
    compilerprocs.
2001-08-29 12:18:07 +00:00
Jonas Maebe
fc92c3b336 + compilerproc implementation of most string-related type conversions
- removed all code from the compiler which has been replaced by
    compilerproc implementations (using {$ifdef hascompilerproc} is not
    necessary in the compiler)
2001-08-28 13:24:46 +00:00
florian
9746f4c2d6 * some cg reorganisation
* some PPC updates
2001-08-26 13:35:06 +00:00
Jonas Maebe
fc1b58c22c * moved "reverseparameters" from ninl.pas to ncal.pas
+ support for non-persistent temps in ttempcreatenode.create, for use
    with typeconversion nodes
2001-08-24 13:47:26 +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
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
Jonas Maebe
0895ca2f28 * made code for str(x,y) completely processor independent 2001-08-13 12:41:56 +00:00
peter
81200dc9ef * funcret moved from tprocinfo to tprocdef 2001-08-06 21:40:46 +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
27c78aa247 * fixed array constructor passing with type conversions 2001-07-30 20:52:25 +00:00
peter
db87f86f00 * Length made internal
* Add array support for Length
2001-07-09 21:15:40 +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
beac5a7f9f * procvar support for varargs 2001-06-04 18:08:19 +00:00
peter
55eb369653 * better const to var checking 2001-06-04 11:48:01 +00:00
peter
2b8091365e * fixed exit with ansistring return from function call, no_fast_exit
should be set in det_resulttype instead of pass_1
2001-05-20 12:09:31 +00:00
peter
d923961b1a * defcoll must be assigned in insert_typeconv 2001-04-26 21:55:05 +00:00
peter
9a47ac9ec2 * m68k updates merged from fixes branch 2001-04-21 12:03:11 +00:00
peter
0c03535b5b * registration of targets and assemblers 2001-04-18 22:01:53 +00:00
peter
12fe0226f6 * don't allow passing signed-unsigned ords to var parameter, this
forbids smallint-word, shortint-byte, longint-cardinal mixtures.
    It's still allowed in tp7 -So mode.
2001-04-13 23:52:29 +00:00
peter
451b14c6b5 * call set_varstate for procvar calls 2001-04-13 22:22:59 +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
759f678192 * move constant folding into det_resulttype 2001-04-04 22:42:39 +00:00
peter
4e2655cdc5 * resulttype rewrite 2001-04-02 21:20:29 +00:00
michael
fb05310d44 + Patches from peter 2001-03-12 12:47:46 +00:00
peter
684970ea22 * merged generic m68k updates from fixes branch 2001-02-26 19:44:52 +00:00
peter
d61f29c799 * don't push high value for open array with cdecl;external; 2001-01-08 21:46:46 +00:00
Jonas Maebe
4c8ca9774f + implemented/fixed docompare() mathods for all nodes (not tested)
+ nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
    and constant strings/chars together
  * n386add.pas: don't copy temp strings (of size 256) to another temp string
    when adding
2000-12-31 11:14:10 +00:00
peter
32b9cdb7cf + new tlinkedlist class (merge of old tstringqueue,tcontainer and
tlinkedlist objects)
2000-12-25 00:07:25 +00:00
peter
3315ad63d4 * fixed crash with procvar load in tp mode 2000-12-17 14:35:12 +00:00
florian
b9796f6a7f * unused units removed from uses clause
* some changes for widestrings
2000-11-29 00:30:30 +00:00
Jonas Maebe
cc5b2c5709 * fixed inline-related problems (partially "merges") 2000-11-22 15:12:06 +00:00
peter
512b1fcc74 * fixed crash with settextbuf,ptr 2000-11-11 16:14:52 +00:00
peter
fdeb6e0506 * fixed var parameter varstate bug 2000-11-06 21:36:25 +00:00
florian
51527ba1c9 + merged Attila's changes for interfaces, not tested yet 2000-11-04 14:25:19 +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
182552a82b * readd to many remove p. for tcallnode.is_equal() 2000-10-21 14:35:27 +00:00
peter
4b17f6f0ff * fixed memory leaks 2000-10-14 21:52:54 +00:00
peter
e171f341a0 * moehrendorf oct 2000 rewrite 2000-10-14 10:14:45 +00:00
peter
38951f5ce1 * lot of compile updates for cg11 2000-10-01 19:48:23 +00:00
florian
57a566e53d *** empty log message *** 2000-09-28 19:49:51 +00:00
florian
c284d15e57 * fixed a lot of syntax errors in the n*.pas stuff 2000-09-27 18:14:31 +00:00
florian
426905c464 * some errors fix to get more stuff compilable 2000-09-24 21:15:34 +00:00
florian
b880cd3002 * more conversion work done 2000-09-24 20:17:44 +00:00
peter
a71e44ac49 * use defines.inc 2000-09-24 15:06:10 +00:00
florian
69ffcbae25 * removed a lot of errors 2000-09-20 21:52:38 +00:00
florian
697e2af325 * initial revision 2000-09-20 20:52:16 +00:00