Commit Graph

445 Commits

Author SHA1 Message Date
florian
38b90c987b + enable non local goto in macpas mode, test/tmacnonlocalgoto.pp does not fail anymore
git-svn-id: trunk@16265 -
2010-10-30 15:23:11 +00:00
joost
07bf44517c * Merged XPCom branch into trunk, added support for constref and changed
the IInterface implementation to be XPCom-compatible
--- Merging r15997 through r16179 into '.':
U    rtl/inc/variants.pp
U    rtl/inc/objpash.inc
U    rtl/inc/objpas.inc
U    rtl/objpas/classes/persist.inc
U    rtl/objpas/classes/compon.inc
U    rtl/objpas/classes/classesh.inc
A    tests/test/tconstref1.pp
A    tests/test/tconstref2.pp
A    tests/test/tconstref3.pp
U    tests/test/tinterface4.pp
A    tests/test/tconstref4.pp
U    tests/webtbs/tw10897.pp
U    tests/webtbs/tw4086.pp
U    tests/webtbs/tw15363.pp
U    tests/webtbs/tw2177.pp
U    tests/webtbs/tw16592.pp
U    tests/tbs/tb0546.pp
U    compiler/sparc/cpupara.pas
U    compiler/i386/cpupara.pas
U    compiler/pdecsub.pas
U    compiler/symdef.pas
U    compiler/powerpc/cpupara.pas
U    compiler/avr/cpupara.pas
U    compiler/browcol.pas
U    compiler/defcmp.pas
U    compiler/powerpc64/cpupara.pas
U    compiler/ncgrtti.pas
U    compiler/x86_64/cpupara.pas
U    compiler/opttail.pas
U    compiler/htypechk.pas
U    compiler/tokens.pas
U    compiler/objcutil.pas
U    compiler/ncal.pas
U    compiler/symtable.pas
U    compiler/symsym.pas
U    compiler/m68k/cpupara.pas
U    compiler/regvars.pas
U    compiler/arm/cpupara.pas
U    compiler/symconst.pas
U    compiler/mips/cpupara.pas
U    compiler/paramgr.pas
U    compiler/psub.pas
U    compiler/pdecvar.pas
U    compiler/dbgstabs.pas
U    compiler/options.pas
U    packages/fcl-fpcunit/src/testutils.pp

git-svn-id: trunk@16180 -
2010-10-17 20:58:22 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
Jonas Maebe
f13f6627c4 * moved use_fixed_stack from cgutils to a method in paramgr so it can
be used outside the code generator
  * renamed tabstractprocdef.requiredargarea into callerargareasize,
    and also added calleeargareasize field; added init_paraloc_info(side)
    method to init the parameter locations and init those size fields and
    replaced all "if not procdef.has_paraloc_info then ..." blocks with
    procdef.init_paraloc_info(callersize)"
  * moved detection of stack tainting parameters from psub to
    symdef/tabstractprocdef
  + added tcallparanode.contains_stack_tainting_call(), which detects
    whether a parameter contains a call that makes use of stack paramters
  * record for each parameter whether or not any following parameter
    contains a call with stack parameters; if not, in case the current
    parameter itself is a stack parameter immediately place it in its
    final location also for use_fixed_stack platforms rather than
    first putting it in a temporary location (part of mantis #17442)
  * on use_fixed_stack platforms, always first evaluate parameters
    containing a stack tainting call, since those force any preceding
    stack parameters of the current call to be stored in a temp location
    and copied to the final location afterwards

git-svn-id: trunk@16050 -
2010-09-26 21:24:14 +00:00
joost
65ab1e820b * Safecall on linux/i386 now behaves like cdecl plus hidden exception support.
* Adapted tests because safecall on linux/i386 now does not include high() 
   support anymore

git-svn-id: trunk@15913 -
2010-08-27 19:07:22 +00:00
florian
ad23569cf1 * renamed pi_has_goto into pi_has_label because the problematic thing is if a procedure has a label as target and not if it has some goto
* moved inclusion of pi_has_label to tlabelnode.pass_1

git-svn-id: trunk@15712 -
2010-08-05 19:22:12 +00:00
florian
24fea58b92 + initial implementation of iso style gotos in iso mode
* made setjmp/longjmp accessible to the compiler by compiler proc, they are used by the iso goto code

git-svn-id: trunk@15711 -
2010-08-05 19:20:46 +00:00
Jonas Maebe
5b0962b735 * fixed misplaced bracket in condition test that caused all blocks
in libraries to be parsed as if they were the main module block,
    which in practice mainly mean that local variables with default
    values were never initialisation (mantis #16949)

git-svn-id: trunk@15596 -
2010-07-18 09:46:04 +00:00
Jonas Maebe
c30279cdc8 * no longer create implicit fail-cleanup code for TP-style object
constructors without an implicit exception frame (bug introduced
    in r15583, fixes cycle on linux/i386)

git-svn-id: trunk@15594 -
2010-07-17 19:45:03 +00:00
Jonas Maebe
86d2316a76 * check for self<>nil again before calling afterconstruction, fixes
tclass5.pp, tw1283.pp and tw10790.pp after r15583

git-svn-id: trunk@15585 -
2010-07-16 07:12:31 +00:00
Jonas Maebe
a07bb94fcb * separate the finally block that dezals with cleaning up temps and the
except block that deals with exceptions raised inside the constructor
    (including afterconstruction), so that afterconstruction is always
    called after all temps have been finalised (necessary because in case
    of tinterfacedobject it decreases the reference count of the instance
    without every freeing the instance, so if that is done before a temp
    that also holds a refernce is finalised, the temp may wrongly free
    the instance (mantis #16592, #16592)

git-svn-id: trunk@15583 -
2010-07-15 19:25:40 +00:00
Jonas Maebe
0cef599317 * removed a number of unnecessary calls to
cg.set_regalloc_live_range_direction

git-svn-id: trunk@15518 -
2010-07-03 13:07:20 +00:00
Jonas Maebe
f5c52b25cd * removed "and not is_class()" condition from is_managed_type(), because
tobjectdef.needs_inittable returns false for classes nowadays (and already
    since quite some time)
  * nevertheless replaced all usages in the compiler of x.needs_inittable with
    is_managed_type(x) (in case some other condition is added again in the
    future) and removed all remaining accompanying "and not is_class(x)"
    checks

git-svn-id: trunk@15320 -
2010-05-22 21:28:24 +00:00
Jonas Maebe
f2e1819bae * put the call to afterconstructor inside the implicit try/catch block
block of the constructor, so that exceptions thrown there also
    properly abort construction (mantis #16311)

git-svn-id: trunk@15156 -
2010-04-21 20:06:54 +00:00
paul
ceccce93f5 compiler: add class constructors, class destructors to the initfinal table as regular initialization/finalization sections (class constructors is still not striped away with the class)
git-svn-id: trunk@15143 -
2010-04-15 07:37:41 +00:00
paul
24d8a7d833 compiler: start implementation of class constructors/destructors: parsing is ready but at the moment neither class constructors nor destructors are called - this is to be implemented
git-svn-id: trunk@15109 -
2010-04-03 09:14:12 +00:00
paul
fcaac0ebe1 compiler,rtl - safecall handling:
- pass address to SafeCallException  method(rtl needed a modification)
  - improve code generation for regular safecall routines (not methods)
  - improve test - check that passed exception and address are valid

git-svn-id: trunk@14946 -
2010-02-27 04:41:52 +00:00
paul
cf0a1b1af9 compiler: safecall exception handling:
- move safecall exception handling from codegenerator to generate_except_block method (which generates nodes)
  - call SafeCallException for safecall methods which raises an exception

git-svn-id: trunk@14940 -
2010-02-26 10:17:24 +00:00
Jonas Maebe
e89d0bcee3 + also print node tree after firstpass with -vp (patch by Adriaan van Os,
mantis #15710)

git-svn-id: trunk@14883 -
2010-02-10 16:41:16 +00:00
paul
4b53a54b51 compiler: implement 'var' and 'class var' sections for classes + tests
git-svn-id: trunk@14598 -
2010-01-10 13:48:43 +00:00
paul
3ed4c58502 compiler:
- implement class properties: properties which can access only static fields and static class methods
  - tests
  - fix a possibility to call an instance method from the class method

git-svn-id: trunk@14585 -
2010-01-09 18:37:54 +00:00
florian
c1f3d8dcaa * unified names of system_*/systems_* sets
git-svn-id: trunk@14566 -
2010-01-07 18:16:20 +00:00
paul
bf45b463bc compiler: fix no finalization calls for libraries caused by r14543
git-svn-id: trunk@14552 -
2010-01-06 09:03:09 +00:00
paul
556afdca51 compiler: fix uninitialized result caused by r14543
git-svn-id: trunk@14547 -
2010-01-05 19:15:16 +00:00
paul
f25c21c287 compiler: fix wrong typecast
git-svn-id: trunk@14545 -
2010-01-05 16:22:26 +00:00
paul
8b27daae2c compiler: don't generate code for empty initialization and finalization sections (with help of Florian) (issue #0013482)
git-svn-id: trunk@14543 -
2010-01-05 16:07:37 +00:00
florian
9955e6b2bf * dfa fixes by Sergei Gorelkin, resolve #15402
git-svn-id: trunk@14455 -
2009-12-20 21:02:11 +00:00
Jonas Maebe
9d5b597105 * don't push/pop the unit/program's static symtable on/off the symtable stack
before parsing the main begin/end, because that symtable is already on the
    symtable stack at that point   

git-svn-id: trunk@14233 -
2009-11-21 00:11:39 +00:00
paul
e784ec1079 merge revisions 13898-13899:
- compiler: allow message after the *deprecated* keyword
 - compiler: raise an internal error if deprecated message is trying to set to a non clear string pointer

git-svn-id: trunk@13997 -
2009-11-01 14:06:30 +00:00
florian
515774b864 * merged armthum branch
-- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«:
U    rtl/arm/setjump.inc
A    rtl/arm/thumb2.inc
U    rtl/arm/divide.inc
A    rtl/embedded/arm/stm32f103.pp
U    rtl/inc/system.inc
U    compiler/alpha/cgcpu.pas
U    compiler/sparc/cgcpu.pas
U    compiler/i386/cgcpu.pas
U    compiler/ncgld.pas
U    compiler/powerpc/cgcpu.pas
U    compiler/avr/cgcpu.pas
U    compiler/aggas.pas
U    compiler/powerpc64/cgcpu.pas
U    compiler/x86_64/cgcpu.pas
U    compiler/cgobj.pas
U    compiler/psystem.pas
U    compiler/aasmtai.pas
U    compiler/m68k/cgcpu.pas
U    compiler/ncgutil.pas
U    compiler/rautils.pas
U    compiler/arm/raarmgas.pas
U    compiler/arm/armatts.inc
U    compiler/arm/cgcpu.pas
U    compiler/arm/armins.dat
U    compiler/arm/rgcpu.pas
U    compiler/arm/cpubase.pas
U    compiler/arm/agarmgas.pas
U    compiler/arm/cpuinfo.pas
U    compiler/arm/armop.inc
U    compiler/arm/narmadd.pas
U    compiler/arm/aoptcpu.pas
U    compiler/arm/armatt.inc
U    compiler/arm/aasmcpu.pas
U    compiler/systems/t_embed.pas
U    compiler/psub.pas
U    compiler/options.pas

git-svn-id: trunk@13801 -
2009-10-04 09:03:44 +00:00
florian
c0d4efed2e * forbid passing derived classes to call by reference parent classes (for objects, this is still allowed), resolves #13135
git-svn-id: trunk@13551 -
2009-08-17 21:46:25 +00:00
Jonas Maebe
6505b4f9c5 * reverted rest of r13469 because it causes crashes for linux/ppc64
git-svn-id: trunk@13473 -
2009-07-29 20:35:51 +00:00
Jonas Maebe
f265fbe343 * fixed GOT loading for i386 in stubs for external procedures whose external
name is (re)defined in the implementation (mantis #14221)

git-svn-id: trunk@13469 -
2009-07-28 17:28:17 +00:00
Jonas Maebe
2465126f60 * also check that nested procedures don't have any nested procedures
of their own that are marked as inline, instead of only doing so
    for non-nested procedures (mantis #13553)

git-svn-id: trunk@13025 -
2009-04-22 15:12:42 +00:00
yury
b3b538e215 * Removed unused local vars.
git-svn-id: trunk@12840 -
2009-03-01 11:44:15 +00:00
florian
c8fae83c57 * forgotten commit of loop strength reduction patch
git-svn-id: trunk@12174 -
2008-11-19 11:03:20 +00:00
peter
0f6f1a9c97 * remove obsolete unchain_overloads
git-svn-id: trunk@12065 -
2008-11-12 22:42:19 +00:00
peter
8419161964 * current_objectdef is now always valid when parsing is within the
context of a class. This can be either the class declaration or
    a method implementation
  * replaced all current_procinfo.procdef._class with current_objectdef

git-svn-id: trunk@12059 -
2008-11-12 18:54:39 +00:00
Jonas Maebe
7626a91592 * disabled last safecall code for non-windows (mantis #12237)
git-svn-id: trunk@12021 -
2008-11-02 15:13:20 +00:00
peter
466f0c0064 * fixed crash in error message when specialization is not resolved
git-svn-id: trunk@11991 -
2008-10-28 16:31:55 +00:00
Jonas Maebe
c65f8e7652 * safecall is only supposed to do anything for Windows targets. Removed
partial implementation for other targets and run test only for Windows

git-svn-id: trunk@11593 -
2008-08-16 14:46:20 +00:00
peter
6c586e4eca * store specializations in globalsymtable for units, use localsymtable
for programs. this allows speciailizations to be done in the interface
    part of the unit
  * support tobject.typemember.typemember nesting for generics
  * fix generic parameter checking when a typemember was created with the
    type of a parameter
  * known issue is nested specializations don't work yet because the token
    replay can't handled nested replays yet

git-svn-id: trunk@11404 -
2008-07-18 23:30:44 +00:00
Jonas Maebe
21f14aaeff * fixed "array of const" check in r10473 (+ fixed indentation)
git-svn-id: trunk@10475 -
2008-03-12 10:48:19 +00:00
peter
beb01e6e79 * give warning for disabling inline if assembler
is detected

git-svn-id: trunk@10473 -
2008-03-11 17:57:24 +00:00
florian
39250de33a * don't load stack size value when generic stack checking is done, resolves #10924
git-svn-id: trunk@10429 -
2008-03-02 16:44:08 +00:00
florian
cd4b05f3de * better detection of source file change while writing debug info
* set module index before replaying tokens of a generic

git-svn-id: trunk@9767 -
2008-01-15 21:36:58 +00:00
Jonas Maebe
cdfb7c8f26 * patch from Sergei Gorelkin to return ansi/widestrings by reference
in an invisible parameter (Delphi compatible, faster/smaller code)

git-svn-id: trunk@9718 -
2008-01-11 22:36:50 +00:00
peter
6058b2c247 * renamed t_times to executionweight and moved it to
code generation pass
  * include executionweight in the spilling decision

git-svn-id: trunk@9330 -
2007-11-25 16:38:05 +00:00
Jonas Maebe
9f705776c9 * fixed disabling of inlining procedures/functions with nested
procedures/functions

git-svn-id: trunk@9232 -
2007-11-13 18:12:25 +00:00
yury
13d948c07b * Fixed: import Address Table should contain the same data as Import Lookup Table.
* Perform import by name with index as hint, if both import name and import index are specified.
* Fixed import by ordinal when external linker is used.
* Fixed some warnings and notes.

git-svn-id: trunk@9083 -
2007-11-02 23:07:15 +00:00