Commit Graph

160 Commits

Author SHA1 Message Date
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
peter
e258c7bf84 * allow multi pass2 changed to global boolean instead of node flag 2003-04-23 10:12:14 +00:00
peter
47489f2376 * firstpass uses expectloc
* checks if there are differences between the expectloc and
    location.loc from secondpass in EXTDEBUG
2003-04-22 23:50:22 +00:00
florian
92a29d7e82 * fixed generic in operator code
+ added debug code to check if all scratch registers are released
2003-04-22 12:45:58 +00:00
daniel
7b2fd10fb4 * Converted some code in cgx86.pas to new register numbering 2003-01-09 20:40:59 +00:00
daniel
6e507ba483 * Added register conversion 2003-01-09 15:49:56 +00:00
peter
51991609e0 * removed Writeln 2002-12-22 14:35:39 +00:00
mazen
00ee9f8063 + added support for the shift nodes
+ added debug output on screen with -an command line option
2002-12-21 23:21:47 +00:00
peter
4b81e16fe2 * tempgen cleanup
* tt_noreuse temp type added that will be used in genentrycode
2002-08-23 16:14:48 +00:00
peter
ecb430a8eb * don't write (stabs)line info when inlining a procedure 2002-08-20 16:55:38 +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
8082f79ea6 * first things tai,tnode storing in ppu 2002-08-15 19:10:35 +00:00
florian
ed950491a8 * the code generator knows now if parameters are in registers 2002-07-30 20:50:43 +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
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
ae40ef680c - removed unused variable 2002-04-07 13:30:13 +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
Jonas Maebe
60dc4bf0a9 * moved call to "cleanup_regvars" to cga.pas for i386 because it has
to insert "fstp %st0" instructions after the exit label
2001-11-06 16:39:02 +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
florian
9746f4c2d6 * some cg reorganisation
* some PPC updates
2001-08-26 13:35:06 +00:00
peter
81200dc9ef * funcret moved from tprocinfo to tprocdef 2001-08-06 21:40:46 +00:00
peter
2019918dc9 * check for errorcount after firstpass 2001-05-09 19:57:07 +00:00
peter
5677fbe1b4 * fixed crash in labelnode
* easier detection of goto and label in try blocks
2001-04-15 09:48:29 +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
4e2655cdc5 * resulttype rewrite 2001-04-02 21:20:29 +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
peter
451723647e * symtable splitted, no real code changes 2000-10-31 22:02:46 +00:00
peter
e171f341a0 * moehrendorf oct 2000 rewrite 2000-10-14 10:14:45 +00:00
peter
a71e44ac49 * use defines.inc 2000-09-24 15:06:10 +00:00
peter
4c94659743 * moved some util functions from globals,cobjects to cutils
* splitted files into finput,fmodule
2000-08-27 16:11:48 +00:00
peter
cdbe6a1fa3 + usedasmsymbollist to check and reset only the used symbols (merged) 2000-08-12 15:34:21 +00:00
Jonas Maebe
c999d3b17d + allow regvars to be used inside inlined procs, which required the
following changes:
      + load regvars in genentrycode/free them in genexitcode (cgai386)
      * moved all regvar related code to new regvars unit
      + added pregvarinfo type to hcodegen
      + added regvarinfo field to tprocinfo (symdef/symdefh)
      * deallocate the regvars of the caller in secondprocinline before
        inlining the called procedure and reallocate them afterwards
2000-08-03 13:17:25 +00:00
Jonas Maebe
ac16977232 - disable regvars for inlined procedures (merged from fixes branch) 2000-08-03 11:15:42 +00:00
Jonas Maebe
67ac676004 + added is_addr field for labels, if they are only used for getting the address
(e.g. for io checks) and corresponding getaddrlabel() procedure
2000-07-21 15:14:01 +00:00
michael
650fbb86aa + removed logs 2000-07-13 11:32:24 +00:00
michael
e7aca136a1 + Initial import 2000-07-13 06:29:38 +00:00
pierre
d2aa336b2f * avoid bug #911, worng unused parameter hints 2000-04-06 11:28:17 +00:00
florian
7c75febd64 * enumerations with size 1 or 2 weren't handled corretly if they were register
variables: in fact they got 32 bit register assigned; fixed
2000-04-02 12:11:38 +00:00
florian
f3ed1eaf5c * improved allocation rules for integer register variables 2000-03-26 10:50:04 +00:00
peter
ffab53c30f * tp7 fix 2000-03-19 08:17:36 +00:00
pierre
35d59eeb52 Use $GOTO ON 2000-02-29 23:59:47 +00:00
florian
df41d1395c * newcg is compiling
* fixed the dup id problem reported by Paul Y.
2000-02-20 20:49:45 +00:00
florian
05e486a068 * big update for exception handling code generation: possible mem holes
fixed, break/continue/exit should work always now as expected
2000-02-10 23:44:42 +00:00
peter
4a4a24b6e8 * log truncated 2000-02-09 13:22:42 +00:00
florian
7ab03a6efc * for some strange reasons my fix regarding register variable
allocation was lost
2000-02-05 15:57:58 +00:00
Jonas Maebe
16e46c496c * moved call to resetusableregs to compile_proc_body (put it right before the
reset of the temp generator) so the optimizer can know which registers are
    regvars
2000-02-04 14:54:17 +00:00
florian
26fc3fb886 * better register variable allocation in -Or mode 2000-02-04 08:47:10 +00:00
Jonas Maebe
e5af12b684 * forgot to commit a procedure for -dlogsecondpass the last time 2000-01-22 15:58:12 +00:00
Jonas Maebe
9c59eb8a12 + add info on entry/exit of secondpass procedure in assembler files, between
-dlogsecondpass
2000-01-21 12:16:53 +00:00
peter
25dda03cdc * renamed call_offset to para_offset 2000-01-16 22:17:11 +00:00
peter
e525797c51 * updated copyright to 2000 2000-01-07 01:14:18 +00:00
florian
89ccc81c2b + added compiler switch $maxfpuregisters
+ fixed a small problem in secondvecn
2000-01-04 15:15:50 +00:00
peter
7583de7a4f - removed freelabel()
* added undefined label detection in internal assembler, this prevents
    a lot of ld crashes and wrong .o files
  * .o files aren't written anymore if errors have occured
  * inlining of assembler labels is now correct
1999-12-22 01:01:45 +00:00
pierre
21ec770944 * fix for web bug735 1999-12-19 23:37:18 +00:00
florian
577edbbd3f + compiler checks now if a goto leaves an exception block 1999-12-14 09:58:41 +00:00
peter
0512ba80fb + ttype, tsymlist 1999-11-30 10:40:42 +00:00
pierre
b528749138 * Notes/Hints for local syms changed to
Set_varstate function
1999-11-18 15:34:44 +00:00
peter
23ca9de3b3 * esi_offset -> selfpointer_offset to be newcg compatible
* hcogegen -> cgbase fixes for newcg
1999-11-09 23:06:44 +00:00
peter
0887060ff2 * truncated log to 20 revs 1999-11-06 14:34:16 +00:00
peter
6b1ab5eb31 * procinfo is now a pointer
* support for result setting in sub procedure
1999-09-27 23:44:46 +00:00
peter
2687d75c38 + constant pointer support which can happend with typecasting like
const p=pointer(1)
  * better procvar parsing in typed consts
1999-09-26 21:30:15 +00:00
florian
fbbf8a505c * m68k compiler is again compilable (only gas writer, no assembler reader) 1999-09-16 23:05:51 +00:00
florian
1c638f2952 * small fix to operator overloading when in MMX mode
+ the compiler uses now fldz and fld1 if possible
  + some fixes to floating point registers
  + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  * .... ???
1999-09-15 20:35:37 +00:00
Jonas Maebe
88306ed3f3 * framepointer cannot be changed to esp for methods 1999-09-07 14:12:35 +00:00
pierre
03263b9285 + some EXTTEMPREGDEBUG code added 1999-08-27 10:46:26 +00:00
Jonas Maebe
5fc1435036 * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu) 1999-08-25 11:59:32 +00:00
pierre
87847fac70 * wrong testregisters32 placement corrected 1999-08-24 09:07:04 +00:00
pierre
409b092c87 + TEMPREGDEBUG code, test of register allocation
if a tree uses more than registers32 regs then
    internalerror(10) is issued
  + EXTTEMPREGDEBUG will also give internalerror(10) if
    a same register is freed twice (happens in several part
    of current compiler like addn for strings and sets)
1999-08-23 23:25:58 +00:00
florian
e6c1b96cff * some small problems fixed 1999-08-07 14:20:55 +00:00
florian
d66fdc645a * now every available fpu register is used for
fpu register variables
1999-08-04 14:21:07 +00:00
florian
e53aceb9be + floating point register variables !!
* pairegalloc is now generated for register variables
1999-08-04 13:45:17 +00:00
florian
ca53eee67e * renamed i386asm and i386base to cpuasm and cpubase 1999-08-04 00:22:34 +00:00
peter
ed8eb13d59 * moved bitmask constants to sets
* some other type/const renamings
1999-08-03 22:02:29 +00:00
pierre
5f05d07dcb * previous wrong log corrected 1999-06-02 22:43:57 +00:00
pierre
35777a48a1 types.pas 1999-06-02 22:25:22 +00:00
peter
cc0511a890 * @procvar is now always needed for FPC 1999-06-01 14:45:40 +00:00
peter
0b272f13c7 * removed oldasm
* plabel -> pasmlabel
  * -a switches to source writing automaticly
  * assembler readers OOPed
  * asmsymbol automaticly external
  * jumptables and other label fixes for asm readers
1999-05-27 19:43:55 +00:00
peter
e8bf496ae8 * containsself fixes
* checktypes()
1999-05-18 14:15:18 +00:00
florian
8706cd801f * new temporary ansistring handling 1999-05-17 21:56:57 +00:00
florian
8836c26503 * several bugs regarding -Or fixed 1999-05-02 21:33:52 +00:00
peter
611da2d24e * merged nasm compiler
* old asm moved to oldasm/
1999-05-01 13:23:57 +00:00
florian
d27b21891b * changes of Bruessel:
+ message handler can now take an explicit self
     * typinfo fixed: sometimes the type names weren't written
     * the type checking for pointer comparisations and subtraction
       and are now more strict (was also buggy)
     * small bug fix to link.pas to support compiling on another
       drive
     * probable bug in popt386 fixed: call/jmp => push/jmp
       transformation didn't count correctly the jmp references
     + threadvar support
     * warning if ln/sqrt gets an invalid constant argument
1999-04-28 06:01:54 +00:00
peter
2bfdf91c5c * assembler inlining working for ag386bin 1999-03-31 13:55:03 +00:00
peter
d0cb5a147a * fixed bugs 212,222,225,227,229,231,233 1999-03-24 23:16:42 +00:00
peter
bf9b5e3a54 * updates for ag386bin 1999-02-22 02:14:59 +00:00
florian
90d0bea35a * first running version of the new code generator
* when compiling exceptions under Linux fixed
1999-01-23 23:29:31 +00:00
peter
000336a586 * released valuepara 1998-12-30 13:41:05 +00:00
florian
d656d708b7 * ansistring memory leaks fixed 1998-12-19 00:23:40 +00:00
peter
1b369bb4bb + globtype,tokens,version unit splitted from globals 1998-12-11 00:02:37 +00:00