Commit Graph

282 Commits

Author SHA1 Message Date
Jonas Maebe
d1538ab023 o added ARM VPFv2/VFPv3 support:
+ RTL support:
      o VFP exceptions are disabled by default on Darwin,
        because they cause kernel panics on iPhoneOS 2.2.1 at least
      o all denormals are truncated to 0 on Darwin, because disabling
        that also causes kernel panics on iPhoneOS 2.2.1 (probably
        because otherwise denormals can also cause exceptions)
    * set softfloat rounding mode correctly for non-wince/darwin/vfp
      targets
    + compiler support: only half the number of single precision
      registers is available due to limitations of the register
      allocator
    + added a number of comments about why the stackframe on ARM is
      set up the way it is by the compiler
    + added regtype and subregtype info to regsets, because they're
      also used for VFP registers (+ support in assembler reader)
    + various generic support routines for dealing with floating point
      values located in integer registers that have to be transferred to
      mm registers (needed for VFP)
    * renamed use_sse() to use_vectorfpu() and also use it for
      ARM/vfp support
    o only superficially tested for Linux (compiler compiled with -Cpvfpv6
      -Cfvfpv2 works on a Cortex-A8, no testsuite run performed -- at least
      the fpu exception handler still needs to be implemented), Darwin has
      been tested more thoroughly
  + added ARMv6 cpu type and made it default for Darwin/ARM
  + ARMv6+ implementations of atomic operations using ldrex/strex
  * don't use r9 on Darwin/ARM, as it's reserved under certain
    circumstances (don't know yet which ones)
  * changed C-test object files for ARM/Darwin to ARMv6 versions
  * check in assembler reader that regsets are not empty, because
    instructions with a regset operand have undefined behaviour in that
    case
  * fixed resultdef of tarmtypeconvnode.first_int_to_real in case of
    int64->single type conversion
  * fixed constant pool locations in case 64 bit constants are generated,
    and/or when vfp instructions with limited reach are present

  WARNING: when using VFP on an ARMv6 or later cpu, you *must* compile all
    code with -Cparmv6 (or higher), or you will get crashes. The reason is
    that storing/restoring multiple VFP registers must happen using
    different instructions on pre/post-ARMv6.

git-svn-id: trunk@14317 -
2009-12-03 22:46:30 +00:00
Jonas Maebe
559e284bd0 * merged r13762-14047 from trunk
git-svn-id: branches/objc@14048 -
2009-11-04 15:50:26 +00:00
paul
5f7bc2d3b5 compiler:
- don't allow operator enumerator with non object/class/interface result type
  - add some test from Alexander S. Klenin
(issue #0014990)

git-svn-id: trunk@14043 -
2009-11-04 12:59:05 +00:00
paul
aa5a5e79ce merge revisions: 13909,13923,13924,13934,13935,13942,13943,13944,13946,13948,13950,13951,13952,13983,13994:
rtl: add enumerators to the basic classes
tests: add enumerators test which compiles and work both by fpc and dcc
compiler: 
  + start for-in loop implementation: implement for-in loop for types (enumerations and ranges), strings, arrays and sets. todo: perform type checking, optimize array and string loops - use temp for expression, implement for-in loop for classes
test:
  + add a simple test for the 'for-in' loop
compiler: fix string for-in loop. now it uses a temp variable to store string expression result
complier: fix for-in array loop. use a temp variable for the loop expression only if loop is not an open array loop
complier: continue enumerator implementation:
  + add operator enumerator which give an ability to add enumerator for an existent type (for example to override builtin string enumerator)
  + add class enumerator support via delphi compatible GetEnumerator method + enumerator class/object template (function MoveNext: Boolean; property Current)
  + tests
compiler: fix for-in loop for arrays. delphi does not copy arrays to a temp variable and it is possible to change array during loop. + test
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: enumerator directive support:
  + allow to mark methods and properties by 'enumerator MoveNext' and 'enumerator Current' modifiers. Parser checks return types and duplicates.
  + prefer *marked* by enumerator directive methods and properties than GetEnumerator and Current builtin symbols
  + increase ppu version
  + test
rtl: add IEnumerator and IEnumerable interfaces declarations
tests: for-in loop tests:
  + add small comment at the top of test program
compiler: allow 'enumerator MoveNext' for the interface function declaration + test
compiler: move all for-in loop helpers to the nflw unit
compiler: don't allow the compiler to choose the non-valid enumerator operator for the for-in loop

git-svn-id: trunk@14008 -
2009-11-02 03:24:48 +00:00
paul
a901cd3e91 compiler: don't select non-valid assignment operator (have more than 1 argument) since this cause an internal error (bug #0014962)
git-svn-id: trunk@13998 -
2009-11-01 14:41:33 +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
Jonas Maebe
0c675a4039 * the objc1 unit has been renamed to objc
* the objc unit links against the Foundation instead of against the Cocoa
    framework, and inludes an interface to either the fragile or non-fragile
    obj-c run time depending on the target platform
  + support for the non-fragile Objective-C runtime/ABI, as used on Mac OS X
    for ARM (iPhone) 64 bit (PowerPC/64, x86_64) -- all these targets now
    are now also supported for the objectivec1 modeswitch
  + support for private_extern symbol bindings, required for the above
  * mark objcclasses that are declared in the implementation section of a
    unit as "hidden" (not sure what the effect is, since the Objective-C
    runtime does not seem to do anything with this flag)
  * enabled all obj-c tests for the newly supported platforms

git-svn-id: branches/objc@13763 -
2009-09-27 15:24:50 +00:00
florian
a1179733a7 + tsym.prettyname
* don't complain about unused compiler generated type symbols of generic specializations, resolves #13405

git-svn-id: trunk@13523 -
2009-08-12 18:46:32 +00:00
Jonas Maebe
1f6ec379de * moved field definitions before method/property definitions (see mantis
#13971)

git-svn-id: trunk@13330 -
2009-06-27 11:27:31 +00:00
Jonas Maebe
045ae3ab69 o fixed r13033:
* test now tests both ansistring and widestring constants, instead of only
     ansistring
   * fixed writing of widestring constants to ppu file
   * fixed setting length of read widestring constants (don't only set maxlen)
   * handle cross-endian reading of widestring constants

git-svn-id: trunk@13034 -
2009-04-24 22:29:05 +00:00
Jonas Maebe
37a2cff8fb * fixed loading widestring constsym values from ppu files (mantis #13583)
* null-terminate loaded ansistring/resourcestring constants from ppu files

git-svn-id: trunk@13033 -
2009-04-24 21:36:01 +00:00
florian
6911b70dc4 + write/read alignment to ppu for explicit parameter locations
git-svn-id: trunk@12765 -
2009-02-21 22:59:58 +00:00
Jonas Maebe
2929624ffc * accept overloaded operators that return any shortstring type when needing
a conversion to a shortstring type (so an operator := that returns a
    string[255] can be used to assign this type to a string[80]) (mantis
    #12109)
  * do not allow overloading := with a string[x<>255] as result type,
    because we want one such overload to satisfy all conversions (see
    previous point)

git-svn-id: trunk@12590 -
2009-01-24 15:12:19 +00:00
florian
6e700b38a4 + changed absolute offset variable to aword to avoid range check errors when using addresses > $7fffffff
git-svn-id: trunk@12585 -
2009-01-23 13:28:35 +00:00
peter
36cad44923 * refactor is_visible_for_object
git-svn-id: trunk@12152 -
2008-11-17 21:41:40 +00:00
peter
0f6f1a9c97 * remove obsolete unchain_overloads
git-svn-id: trunk@12065 -
2008-11-12 22:42:19 +00:00
peter
9086a2549d * refactor overload collection in tcallcandidates. separate
the collecting of overloads. The actual building of
    candidate list is now common

git-svn-id: trunk@12064 -
2008-11-12 22:38:38 +00:00
peter
a3a66ba74d * split tvisibility from tsymoptions
* replace current_object_option with symtable.currentvisibility

git-svn-id: trunk@12048 -
2008-11-11 09:05:39 +00:00
peter
af437d5beb * refactor the forward type declaration handling, remove
global typecanbeforward and move 'class of ..' parsing
    to ptype

git-svn-id: trunk@12045 -
2008-11-09 22:07:36 +00:00
Jonas Maebe
0b815a6fff - removed global "resolving_forward" variable (was no longer used)
* moved forward type checking from pdecl/symbase to symtable/symsym

git-svn-id: trunk@11763 -
2008-09-13 12:28:55 +00:00
Jonas Maebe
2b067a427d * give warning if a routine in the interface of a non-interface-only
macpas routine is not implemented and therefore considered to be
    external

git-svn-id: trunk@11703 -
2008-09-04 18:15:26 +00:00
daniel
4ca3a590e8 * Labels that are defined or referenced in a different lexical level
than their declaration need to be code generated as global asmlabels.

git-svn-id: trunk@9791 -
2008-01-19 13:50:58 +00:00
Jonas Maebe
df84ca49b4 * fixed tests/cg/opt/tretopt, and also in more cases
perform the transformation of x:=f(hiddencomplexresult, ..)
    -> f(x, ...) (the compiler now performs some very
    conservative escape analysis for such types)

git-svn-id: trunk@8361 -
2007-09-02 21:27:37 +00:00
daniel
9adb202a92 * Rework the constexprint to allow operations from low(int64) to high(qword).
+ Some initial work on a formaldef which also carries the typinfo of a parameter.

git-svn-id: trunk@7639 -
2007-06-13 07:41:18 +00:00
peter
aa72495049 * fix resourcestring assignment in typedconst
git-svn-id: trunk@7339 -
2007-05-15 06:52:36 +00:00
tom_at_work
635117218e * fix incorrect generation of huge static arrays on 64 bit systems; however, GAS only supports 2^31-1 sized ones
git-svn-id: trunk@6382 -
2007-02-08 22:11:27 +00:00
Jonas Maebe
e541f19ef5 * fixed debug info generation for static symbols + IE in case it cannot
be generated (rather than an undefined function result)

git-svn-id: trunk@6187 -
2007-01-25 17:07:26 +00:00
Jonas Maebe
b957d59391 * don't override varregable for tabstractvarsyms loaded from a ppu when
setting their vardef (since the varregable was stored/loaded in the ppu
    and should be kept the same -- fixes webtbs/tw7817a.pp and tw7817b.pp
    when both compiled separately and with regvars)

git-svn-id: trunk@5540 -
2006-12-04 14:16:43 +00:00
peter
0557ddc342 * removed typed const, it is now handled by staticvarsym
* globalvarsym renamed to staticvarsym
  * fixed invalid regvar use in init when the finalize also uses the var

git-svn-id: trunk@5290 -
2006-11-08 21:04:22 +00:00
peter
3cae449fda * moved rtti to ncgrtti
git-svn-id: trunk@5219 -
2006-11-04 10:43:27 +00:00
florian
c465b95bdf * win64 compilation fixed
git-svn-id: trunk@5217 -
2006-11-04 09:12:19 +00:00
peter
e17b424e28 * refactor procsym procdef list
git-svn-id: trunk@5210 -
2006-11-03 18:44:46 +00:00
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
peter
05183ac829 * AsmSymbolDict changed to FPHashObjectList
git-svn-id: trunk@5139 -
2006-11-01 00:22:13 +00:00
peter
cb246eb781 * Remove dos,strings units, use SysUtils instead
* replace split* functions with Extract* functions
  * Add Directory caching

git-svn-id: trunk@5102 -
2006-10-30 23:29:35 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
peter
d27fda4b01 * fix rtti for overriden properties
git-svn-id: trunk@5079 -
2006-10-29 23:20:00 +00:00
peter
3078a1927f * remove ttype
* rename old ttype variables *type to *def
  * rename resulttypepass to pass_typecheck
  * rename pass_2 to pass_generate_code

git-svn-id: trunk@5077 -
2006-10-29 22:19:39 +00:00
peter
d4d4309e44 * use unique symid and defid per module
git-svn-id: trunk@5061 -
2006-10-29 13:00:22 +00:00
florian
30ea65a89c * varspez shouldn't be part of the crc
git-svn-id: trunk@5058 -
2006-10-29 12:37:05 +00:00
florian
a806fe3954 * disabled previous patch, can't be done this way
git-svn-id: trunk@5056 -
2006-10-29 11:03:11 +00:00
florian
a0b1fbfa0e + write varstate for parameter symbols, enables constant folding for
inlined procedures loaded from ppu files

git-svn-id: trunk@5055 -
2006-10-29 10:46:47 +00:00
peter
0f6355e805 * fix property overriding
git-svn-id: trunk@5045 -
2006-10-28 20:35:53 +00:00
Marc Weustink
88e00bd264 * removed write depend def, write only defs when needed
git-svn-id: trunk@4816 -
2006-10-06 23:54:38 +00:00
peter
2c7bc12ad6 * support indexed stored methods
git-svn-id: trunk@4740 -
2006-09-27 18:32:18 +00:00
Jonas Maebe
7528a28287 * keep track of a sym's initial location to use during the generation
of init code

git-svn-id: trunk@4611 -
2006-09-11 18:55:40 +00:00
Jonas Maebe
1f42ee201b + support for bitpacked records, except for:
* rtti
    * typed constants

git-svn-id: trunk@4489 -
2006-08-23 15:44:13 +00:00
peter
4506394cfa * pass contextobjdef for visibility of methods. There are different
requirements for normal searching and for overloaded searching.
    For overloaded searching we need to have the context of the
    object where the overload is defined and not the current
    module

git-svn-id: trunk@4391 -
2006-08-07 21:12:38 +00:00
Jonas Maebe
4861472e7b * declared tlabelsym.mangledname as override
git-svn-id: trunk@4184 -
2006-07-14 17:33:29 +00:00
florian
3261281184 * fixed stabs generation for static class variables
git-svn-id: trunk@3614 -
2006-05-21 17:34:30 +00:00