Commit Graph

193 Commits

Author SHA1 Message Date
Jonas Maebe
86f90d8ac1 + support for setting the name of "main" (-XM command line parameter) in
the code using {$pascalmainname x} + storing it in the ppu file
    (and give a warning if it's overridden multiple times + test)

git-svn-id: trunk@10406 -
2008-03-01 13:05:01 +00:00
Jonas Maebe
f36e5411af * split cpu64bit compiler define into
a) cpu64bitaddr, which means that we are generating a compiler which
       will generate code for targets with a 64 bit address space/abi
    b) cpu64bitalu, which means that we are generating a compiler which
       will generate code for a cpu with support for 64 bit integer
       operations (possibly running in a 32 bit address space, depending
       on the cpu64bitaddr define)
   All cpus which had cpu64bit set now have both the above defines set,
   and none of the 32 bit cpus have cpu64bitalu set (and none will
   compile with it currently)
  + pint and puint types, similar to aint/aword (not pword because that
    that conflicts with pword=^word)
  * several changes from aint/aword to pint/pword
  * some changes of tcgsize2size[OS_INT] to sizeof(pint)

git-svn-id: trunk@10320 -
2008-02-13 20:44:00 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
peter
793fd8fc09 * Add -Xg to help pages
* -Xg now produces a .dbg file with debuginfo
    that can be used by gdb. The main executable gets
    a debuglink section that references the .dbg file.

git-svn-id: trunk@9778 -
2008-01-17 01:20:37 +00:00
Jonas Maebe
cf295c8e88 * increased ppu version number because the ansi/widestring result patch
makes the generated code ABI-incompatible with code compiled with
    older compilers

git-svn-id: trunk@9719 -
2008-01-11 22:50:07 +00:00
Jonas Maebe
ada2c3ca35 * increased ppu version since the darwin name mangling change
breaks compatibility with previously compiled units

git-svn-id: trunk@9474 -
2007-12-16 11:46:57 +00:00
florian
5c96c4a671 + first part of support for an unicodestring type
git-svn-id: trunk@9382 -
2007-12-02 16:39:13 +00:00
Jonas Maebe
80b8494b5c * fixed wrong unaligned() changes
git-svn-id: trunk@9303 -
2007-11-20 12:15:47 +00:00
Jonas Maebe
3b4eba9f86 * fixed handling of unaligned in assignments
git-svn-id: trunk@9302 -
2007-11-20 11:59:15 +00:00
peter
cc77ccb52e * don't use readdata for getbyte/getword/getlongint
git-svn-id: trunk@9300 -
2007-11-19 22:52:58 +00:00
florian
4fed8c4ab5 + write aliasnames to ppu as well
+ ppudump updated
* ppu version increased

git-svn-id: trunk@9064 -
2007-11-02 20:50:01 +00:00
peter
273bfffe5b * store defstates in ppu, this field keeps the info what
is generated for a def so it can be reused, e.g. dwarf debuginfo

git-svn-id: trunk@8920 -
2007-10-23 21:50:10 +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
Jonas Maebe
c5b3180f5f * save/load LinkOtherFrameworks to/from ppu files
git-svn-id: trunk@8344 -
2007-08-31 17:03:33 +00:00
Jonas Maebe
fc70aa545c * changed boolean fields in ttempinfo to a set for easier
extensibility without increasing the size of the record

git-svn-id: trunk@8199 -
2007-07-29 19:37:06 +00:00
Jonas Maebe
49a2084ea0 * fixed calling inline functions (with exit statements) from inside
finally blocks
  * fixed the handling of function results of inlined functions with
    exit statements
  + test for the above two issues and for bug fixed in r8091
  * copy may_be_in_reg field inside ttempcreatenode.dogetcopy (allows
    some more temps which were needlessly forced into memory to be in
    registers)

git-svn-id: trunk@8108 -
2007-07-20 16:49:35 +00:00
Jonas Maebe
28bab3fb4f - removed some unused variables
* fixed some (harmless) ptrint warnings
  - removed some commented code in agppcmpw
  * added one missing field in a typed constant in cp1251

git-svn-id: trunk@8081 -
2007-07-17 13:57:15 +00:00
daniel
b64558620f * Fix set endian handling.
git-svn-id: trunk@7918 -
2007-07-01 22:30:43 +00:00
daniel
52458b965f * ... and when writing too.
git-svn-id: trunk@7875 -
2007-06-30 20:43:15 +00:00
daniel
a90fe1dc41 * Add endian swapping for deflistsize and symlistsize.
git-svn-id: trunk@7874 -
2007-06-30 20:38:59 +00:00
daniel
935902de35 * Reals can need endian conversions too.
git-svn-id: trunk@7873 -
2007-06-30 19:48:27 +00:00
daniel
9b50dc572b * Change rest of compiler to system unit swapendian routines.
- Remove endian swapping routines from cutils.

git-svn-id: trunk@7859 -
2007-06-30 08:13:46 +00:00
daniel
b7b45919d0 * Convert to system unit endian swap routines.
* Endian conversion should be done while reading only, not while writing.

git-svn-id: trunk@7858 -
2007-06-30 07:54:50 +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
yury
2b84a4643a * Fixed bug #6501: multiple resource files are correctly linked to executable.
It is done in the following way:

When unit is compiled, .rc file are compiled to .res and list of unit's resource files is stored in .ppu
Before final linking all program's .res files are collected into global .res file (.res files are easily concatenated). 
Then this global .res files is compiled to single .or file, which is linked to executable. 
As a result global resource index is created and the problem is fixed.

Old resource processing behavior still supported when tresinfo.rcbin is not set for target.
New resource processing is activated for windows and linux. Cross compiled windres can be used to compile .rc files on linux.

git-svn-id: trunk@7515 -
2007-05-29 15:51:02 +00:00
Jonas Maebe
a0b57eddb5 * new internal set format for big endian systems. Advantages:
* varsets ({$packset x}) are now supported on big endian targets
    * gdb now displays sets properly on big endian systems
    * cleanup of generic set code (in, include/exclude, helpers), all
      based on "bitpacked array[] of 0..1" now
  * there are no helpers available yet to convert sets from the old to
    the new format, because the set format will change again slightly
    in the near future (so that e.g. a set of 24..31 will be stored in
    1 byte), and creating two classes of set conversion helpers would
    confuse things (i.e., it's not recommended to use trunk currently for
    programs  which load sets stored to disk by big endian programs compiled
    by previous FPC versions)
  * cross-endian compiling has been tested and still works, but one case
    is not supported: compiling a compiler for a different endianess
    using a starting compiler from before the current revision (so first
    cycle natively, and then use the newly created compiler to create a
    cross-compiler)

git-svn-id: trunk@7395 -
2007-05-19 17:15:15 +00:00
peter
aa72495049 * fix resourcestring assignment in typedconst
git-svn-id: trunk@7339 -
2007-05-15 06:52:36 +00:00
Jonas Maebe
76b190b723 - removed caretn and related code
git-svn-id: trunk@7257 -
2007-05-04 10:53:25 +00:00
Jonas Maebe
3e5f64e16f * increased ppu version for setdef patch
git-svn-id: trunk@6366 -
2007-02-07 20:33:10 +00:00
Jonas Maebe
d614eab0fb * don't call afterconstruction/beforedestruction in case an exception
is raised in a constructor (mantis 8222)

git-svn-id: trunk@6202 -
2007-01-26 17:38:53 +00:00
florian
1d3a9cd87a * fixing writing of setdefs
* fixed copying of setdefs
* increased ppu version

git-svn-id: trunk@6189 -
2007-01-25 19:29:54 +00:00
Jonas Maebe
e1c994a3be * don't call blockwrite if there's nothing to write
git-svn-id: trunk@6166 -
2007-01-24 16:05:39 +00:00
Jonas Maebe
f2b07704b5 * proper initialised/used warnings for variables used
in complex with-statements + tests

git-svn-id: trunk@6024 -
2007-01-17 12:04:53 +00:00
yury
bcd86ef782 * added support for very big/small currency constants for non x86 CPUs.
git-svn-id: trunk@5937 -
2007-01-13 12:12:20 +00:00
peter
56379c37a9 * write vmt always according to the order of definitions
* remove obsolete lastvtableindex

git-svn-id: trunk@5811 -
2007-01-04 22:39:12 +00:00
Jonas Maebe
e4a2fb7f35 * fixed mantis 7975 and 7107 (ie 200311075 when working using somewhat
complex method calls in inlined procedures)

git-svn-id: trunk@5666 -
2006-12-21 21:03:47 +00:00
Jonas Maebe
26f81bfe08 * fixed arithmetic overflow when loading the recorddef of large
(> high(aint)/8 bytes) records from ppu files

git-svn-id: trunk@5595 -
2006-12-14 20:24:20 +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
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
d4d4309e44 * use unique symid and defid per module
git-svn-id: trunk@5061 -
2006-10-29 13:00:22 +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
Jonas Maebe
3bb41dcf9a * fixed writing "packed" status of bitpacked records to ppu files.
Not sure how it ever worked, nor how exactly symtable ppu entries
    work -- but it's now stored with the recorddef (which also means
    that bitpacking is disabled currently for objects and classes,
    since they are based on tabstractrecorddef rather than trecorddef)

git-svn-id: trunk@4679 -
2006-09-21 20:39:36 +00:00
florian
d7fe89c63d * Real is now defined in the system unit being an unique type, fixes #7425
git-svn-id: trunk@4628 -
2006-09-17 08:58:20 +00:00
Jonas Maebe
733f559267 * also perform C varargs type conversions for cdecl procedures declared
as "varargs" instead of using an array of const parameter

git-svn-id: trunk@4572 -
2006-09-08 16:04:15 +00:00
peter
bf1c390027 * refactor import library generation
* support variable imports in internal linker

git-svn-id: trunk@4544 -
2006-09-03 19:22:31 +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
Jonas Maebe
eccbc78e04 + support for bitpacked arrays:
+ use {$bitpacking on/+} to change the meaning of "packed"
      into "bitpacked" for arrays. This is the default for MacPas.
      You can also define individual arrays as "bitpacked", but
      this is not encouraged since this keyword is not known by
      other compilers and therefore makes your code unportable.
    + pack(unpackedarray,index,packedarray) to pack
      length(packedarray) elements starting at
      unpackedarray[index] into packedarray.
    + unpack(packedarray,unpackedarray,index) to unpack
      packedarray into unpackedarray, with the first
      element being stored at unpackedarray[index]
  * todo:
    * "open packed arrays" and rtti for packed arrays are not
      yet supported
    * gdb does not properly support bitpacked arrays

git-svn-id: trunk@4449 -
2006-08-19 12:54:12 +00:00
peter
eb829ea21b * store procdef messageinf in the ppu
git-svn-id: trunk@4386 -
2006-08-07 19:39:32 +00:00