Commit Graph

379 Commits

Author SHA1 Message Date
peter
78c2af7b3c * set vo_explicit_paraloc flag 2004-12-07 16:11:52 +00:00
peter
2b6456fe16 * procvar handling for tp procvar mode fixed
* proc to procvar moved from addrnode to typeconvnode
  * inlininginfo is now allocated only for inline routines that
    can be inlined, introduced a new flag po_has_inlining_info
2004-12-05 12:28:10 +00:00
Jonas Maebe
bd04491f50 * patch from Peter to fix inlining of case statements 2004-11-30 18:13:39 +00:00
peter
89b1b583c9 * ttempcreatenode.create_reg merged into .create with parameter
whether a register is allowed
  * funcret_paraloc renamed to funcretloc
2004-11-21 17:54:59 +00:00
peter
6458bd0ce1 * tvarsym splitted 2004-11-08 22:09:58 +00:00
mazen
3c79b466b7 * remove non needed parathesys as in 1.140 2004-10-15 10:35:23 +00:00
mazen
581b52422c - remove $IFDEF DELPHI and related code
- remove $IFDEF FPCPROCVAR and related code
2004-10-15 09:14:16 +00:00
peter
6180168a5a * register loopvarsym for fields instead of record variable
* don't allow class fields as loop var
2004-09-27 15:15:52 +00:00
peter
8fb3536f6e * simple regvar support, not yet finished 2004-09-26 17:45:29 +00:00
peter
33a834821f * paraloc branch merged 2004-09-21 17:25:12 +00:00
peter
4df1a1f378 * no difference for withnode when debuginfo is generated 2004-09-21 16:00:50 +00:00
peter
67548d9f91 * for loop variable assignment is not allowed anymore 2004-09-13 20:28:26 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
florian
588e2c38bf * dwarf branch merged 2004-06-16 20:07:06 +00:00
peter
b86f2c6a25 * methodpointer is loaded into a temp when it was a calln 2004-05-23 18:28:40 +00:00
peter
9a0a2ccd81 * give error when goto jumps to label outside current proc scope 2004-05-23 11:39:37 +00:00
peter
9625256d22 * better check for maybe_call_procvar 2004-03-04 17:22:10 +00:00
peter
e9b91887d5 * withsymtables need to have the original tobject owner instead of
the parent objectdef. Needed to check for visibility
2004-02-26 16:14:48 +00:00
peter
c844c5a505 * procvar cleanup 2004-02-20 21:55:59 +00:00
peter
ecfbbeffc3 * renamed xNNbittype to xNNinttype
* renamed registers32 to registersint
  * replace some s32bit,u32bit with torddef([su]inttype).def.typ
2004-02-03 22:32:53 +00:00
Jonas Maebe
43306edc96 * don't put the temp of a withnode in a register if debugging info is on,
because then our stabs generation internalerror's
2004-02-03 19:47:45 +00:00
Jonas Maebe
694eee6cae + support to store ttempcreate/ref/deletenodes in registers
* put temps for withnodes and some newnodes in registers
   Note: this currently only works because calling ungetregister()
     multiple times for the same register doesn't matter. We need again
     a way to specify that a register is currently a regvar and as such
     should not be freed when you call ungetregister() on it.
2004-02-03 16:46:51 +00:00
peter
607b41f22e * except is also an end of block token
* after a label don't try to parse a statement when the next token
    is an end token
2004-01-22 17:24:49 +00:00
peter
32173c41fa * removed asmmode_direct 2004-01-12 16:36:53 +00:00
Jonas Maebe
62394e45d7 * moved count_locals from pstatmnt to symutils
* use count_locals in powerpc/cpupi to check whether we should set the
    first temp offset (and as such generate a stackframe)
2003-12-07 16:40:45 +00:00
florian
1a87a5ed45 * fixed several arm calling conventions issues
* fixed reference reading in the assembler reader
  * fixed a_loadaddr_ref_reg
2003-12-03 17:39:04 +00:00
florian
1af574ceca * assembler readers OOPed
+ typed currency constants
  + typed 128 bit float constants if the CPU supports it
2003-11-12 16:05:39 +00:00
peter
a1cb920b51 * remove temporary stdcall hack 2003-11-11 21:10:12 +00:00
peter
f663d2488f * cross unit inlining fixed 2003-11-10 22:02:52 +00:00
peter
fae3eaf83d * move check for unused object constructor result to blocknode 2003-10-29 20:34:20 +00:00
peter
003ea697c0 * object constructor results are always used 2003-10-29 20:01:41 +00:00
peter
5925d38ac7 * support indexing and offset retrieval for locals 2003-10-29 15:40:20 +00:00
peter
d0de3b3ea8 * 64k registers supported
* fixed some memory leaks
2003-10-17 14:38:32 +00:00
peter
fb81b7ebbb * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
* tregisteralloctor renamed to trgobj
  * removed rgobj from a lot of units
  * moved location_* and reference_* to cgobj
  * first things for mmx register allocation
2003-10-10 17:48:13 +00:00
peter
95f132db3d * set_varstate cleanup 2003-10-08 19:19:45 +00:00
peter
5fb06316f1 * set calling convention before assembler block is parsed 2003-10-07 20:06:37 +00:00
peter
13101d50e8 * delphi mode uses register calling by default for assembler 2003-10-02 21:15:59 +00:00
peter
70fe77ca7c * procinfo unit contains tprocinfo
* cginfo renamed to cgbase
  * moved cgmessage to verbose
  * fixed ppc and sparc compiles
2003-10-01 20:34:48 +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
b9d09a4e5c * preparations for different default calling conventions
* various RA fixes
2003-09-07 22:09:34 +00:00
peter
6a8d5eb25d * NEWRA branch merged 2003-09-03 15:55:00 +00:00
peter
1b633246b9 * sparc fixes 2003-07-08 21:23:24 +00:00
Jonas Maebe
404d344d92 * lots of newra fixes (need getfuncretparaloc implementation for i386)!
* renamed all_intregisters to volatile_intregisters and made it
    processor dependent
2003-06-17 16:34:44 +00:00
peter
0dceec9a64 * current_procdef removed, use current_procinfo.procdef instead 2003-06-13 21:19:30 +00:00
peter
19c9bdbf60 * load calln in temprefn in with statement 2003-06-09 18:27:14 +00:00
florian
995f7e0f11 * fix some small flaws which prevent sparc linux system unit from compiling
* some reformatting done
2003-05-23 22:33:48 +00:00
peter
e91cc82200 * better error for undefined ordinal labels 2003-05-23 15:15:36 +00:00
Jonas Maebe
cb279b2029 * changed tt_persistant to tt_persistent :)
* tempcreatenode now doesn't accept a boolean anymore for persistent
    temps, but a ttemptype, so you can also create ansistring temps etc
2003-05-17 13:30:08 +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
05c05f2555 * failn removed
* inherited result code check moven to pexpr
2003-05-13 19:14:41 +00:00
peter
15b0132f6f * tloadnode does not support objectsymtable,withsymtable anymore
* withnode cleanup
  * direct with rewritten to use temprefnode
2003-05-11 14:45:12 +00:00
peter
1a2eedd767 * self moved to hidden parameter
* removed hdisposen,hnewn,selfn
2003-05-09 17:47:02 +00:00
florian
72df326165 * some 64 bit adaptions in ncgadd
* x86-64 now uses ncgadd
  * tparamanager.ret_in_acc doesn't return true anymore for a void-def
2003-04-30 22:15:59 +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
florian
15c0b633ab * fixed the powerpc to work with the new function result handling 2003-04-26 11:30:59 +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
daniel
6aa01a99a9 * Ifdefs around a lot of calls to cleartempgen
* Fixed registers that are allocated but not freed in several nodes
  * Tweak to register allocator to cause less spills
  * 8-bit registers now interfere with esi,edi and ebp
    Compiler can now compile rtl successfully when using new register
    allocator
2003-04-25 08:25:26 +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
peter
fe6518a49c * allow more tokens instead of only semicolon after inherited 2003-03-17 18:55:30 +00:00
daniel
86bcea6ef5 * Code generator converted to new register notation
- Horribily outdated todo.txt removed
2003-02-19 22:00:14 +00:00
daniel
55a161bbbf * Tregister changed into a record 2003-01-08 18:43:56 +00:00
peter
2b6f661cbc * fixed assembler methods stackpointer optimization that was
broken after the previous change
2003-01-01 21:05:24 +00:00
peter
215ccaafe2 * fixed parsing of declarations before asm statement 2002-12-29 18:59:34 +00:00
peter
da3ef8b6d0 * check for else after empty raise statement 2002-12-27 18:18:56 +00:00
peter
34e8266af4 * case statement inlining added
* fixed inlining of write()
  * switched statementnode left and right parts so the statements are
    processed in the correct order when getcopy is used. This is
    required for tempnodes
2002-11-27 02:37:12 +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
florian
bf32e2d2cf + tcg.direction is used now 2002-09-07 19:34:08 +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
8a75d59544 * fixed parsing of register names with lowercase 2002-09-02 18:40:52 +00:00
peter
90308521d5 * fixed direct assembler for i386 2002-09-01 14:43:12 +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
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
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
carl
18b102ce95 + moved target_cpu_string to cpuinfo
* renamed asmmode enum.
  * assembler reader has now less ifdef's
  * move from nppcmem.pas -> ncgmem.pas vec. node.
2002-08-10 14:46:29 +00:00
carl
6b9e686ae3 + reading of used registers in assembler routines is now
cpu-independent
2002-08-09 19:11:44 +00:00
florian
b136cecacd * first part of ppc calling conventions fix 2002-08-06 20:55:20 +00:00
florian
3fe0229843 + added direct assembler reader for PowerPC 2002-07-28 20:45:22 +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
31da813d1d * exit is now a syssym instead of a keyword 2002-07-16 15:34:20 +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
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
carl
682c2289fa + added more patches from Mazen for SPARC port 2002-05-06 19:54:50 +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
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
peter
8af460ac31 * using inherited; without a parent having the same function
will do nothing like delphi
2002-04-16 16:11:17 +00:00
carl
5befcda7e5 + target_info.size_of_pointer -> pointer_Size 2002-04-15 18:57:22 +00:00
carl
9ea5003a82 + asm statement uses ALL_REGISTERS 2002-04-14 16:53:54 +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
peter
58218bf81f * Regenerated with updated fpcmake 2002-03-11 19:10:28 +00:00
peter
4b2aa039e6 * allow oridinal labels again 2002-03-04 17:54:59 +00:00
peter
cdf0df1808 * allow accessing locals in other lexlevel when the current assembler
routine doesn't have locals.
2002-01-29 21:32:03 +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
816cfa08b3 * allow recursive calls again in assembler procedure 2001-11-09 10:06:56 +00:00
peter
d2e1952377 * procsym definition rewrite 2001-11-02 22:58:00 +00:00
florian
b0e3e03f08 * fixed ranges in case statements with widechars 2001-10-26 22:36:42 +00:00
peter
e37dbf904d * calling convention rewrite 2001-10-25 21:22:32 +00:00
marco
7215d46735 * Make new/dispose system functions instead of keywords 2001-10-24 11:51:39 +00:00
florian
451ca157c4 * several widechar fixes, case works now 2001-10-17 22:41:04 +00:00
Jonas Maebe
d8c104b25d * fixed goto/label/try bugs 2001-10-16 15:10:34 +00:00
peter
67f5dc7f76 * "fpc -P?" command to query for used ppcXXX compiler 2001-09-22 11:11:43 +00:00
Jonas Maebe
ca27b25d5e * fixed superfluous generation of stackframes for assembler procedures
with no local vars or para's (this broke the backtrace printing in case
    of an rte)
2001-09-06 10:21:50 +00:00
Jonas Maebe
f98641013f * set funcretsym for assembler procedures too (otherwise using __RESULT
in assembler procedures causes a crash)
2001-09-03 13:19:12 +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
peter
81200dc9ef * funcret moved from tprocinfo to tprocdef 2001-08-06 21:40:46 +00:00
peter
f86ce17588 + hint directive parsing support 2001-06-03 21:57:35 +00:00
Jonas Maebe
f4ab3095c2 * fixed web bugs 1480 and 1481 2001-05-17 13:25:24 +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
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
5677fbe1b4 * fixed crash in labelnode
* easier detection of goto and label in try blocks
2001-04-15 09:48:29 +00:00
peter
af5d6e60e7 * moved more code from pass_1 to det_resulttype 2001-04-14 14:07:10 +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
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
32b9cdb7cf + new tlinkedlist class (merge of old tstringqueue,tcontainer and
tlinkedlist objects)
2000-12-25 00:07:25 +00:00
peter
b7c591affd * object to class for ow/og objects
* split objectdata from objectoutput
2000-12-23 19:59:35 +00:00
Jonas Maebe
595bf10fa7 * fixed case statements with int64 values 2000-12-16 22:45:55 +00:00
florian
b9796f6a7f * unused units removed from uses clause
* some changes for widestrings
2000-11-29 00:30:30 +00:00
Jonas Maebe
587d9bb7cf * fix for web bug #1251 (example 1) 2000-11-27 15:47:19 +00:00
peter
e6d423e466 * fixed crash with exception without sysutils (merged) 2000-11-22 22:43:34 +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
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
peter
5218af7926 * delphi compile fixes 2000-09-24 21:19:48 +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
bd6d4c3d17 * fixed bug #1096 (merged) 2000-08-12 15:41:15 +00:00
florian
cd6180fe99 + case statement for int64/qword implemented 2000-08-12 06:46:06 +00:00
michael
665c1f6410 + patched to 1.1.0 with former 1.09patch from peter 2000-07-13 12:08:24 +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
peter
757f68ec58 * fixed internalerror 2002 when case expr is not correct, by creating
a temp correct case expression
2000-06-30 22:15:39 +00:00
pierre
40f1da8f8e * bug found by Kovacs Attila Zoltan corrected 2000-05-04 12:59:10 +00:00