Commit Graph

37866 Commits

Author SHA1 Message Date
svenbarth
b0458b55a3 Loosen the restriction regarding operator overloads by applying a (modified) patch from JC Chu. This fixes Mantis #22359.
The changes are built up in a way that all operators on two given types are not allowed if a default implementation for that operator exists. This implies that there is a possibility to have a overload work for (in this order) type A and B, but not for B and A. This is for example the case for Set + Enum (which seems to have a default implementation) where Enum + Set is allowed. The added tests try to detect as many default implementations as feasible, but can't cover everything...

git-svn-id: trunk@21975 -
2012-07-26 18:02:01 +00:00
sergei
1763309d8e * Fixed test crash with -Cg on non-Darwin targets: the GOT slot stores address of symbol, not its value.
git-svn-id: trunk@21974 -
2012-07-26 14:52:22 +00:00
Jonas Maebe
44fd18a041 * correctly set expectloc for bool->cbool type conversions (mantis #22502)
git-svn-id: trunk@21973 -
2012-07-26 14:50:28 +00:00
Jonas Maebe
df2eddd169 * correctly deal with writing debug information in the Stabs writer for class
hierarchies from other units that were compiled without debug information
    in case not all classes from the hierarchy are explicitly used
    (mantis #22495, #21503, #21259)

git-svn-id: trunk@21972 -
2012-07-26 14:27:10 +00:00
sergei
1d09005542 + Implemented two-stage removal of empty exe sections. Candidates for removal are first marked with oso_disabled flag, then actually removed. Descendants of TExeOutput that override MemPos_Start may modify list of sections pending removal. In particular, the COFF-specific .reloc section no longer has to be handled in base TExeOutput class.
git-svn-id: trunk@21971 -
2012-07-26 10:04:12 +00:00
sergei
3d19605fc2 * Using OleVariant type should trigger inclusion of Variants unit into uses clause the same way as using Variant type does. Mantis #22504.
git-svn-id: trunk@21970 -
2012-07-26 05:03:56 +00:00
Jonas Maebe
16974d2f08 * empty result of IntParseString() in case the input is empty, fixes double
output lines in generated config files by fpcmkcfg such as mentioned in
    mantis #22505
   

git-svn-id: trunk@21969 -
2012-07-25 11:49:09 +00:00
sergei
31d004e056 + Basic executable stack support in TExeOutput.
+ Two stubs (TExeOutput.Load_DynamicObject and TObjInput.CanReadObjData) to override in ELF linker.
+ Stop linking if errors were detected while loading object files.
* Changed TStaticLibrary to TObject. It is never looked up by name, so hashing is redundant; moreover its name has been changed to TCmdStr, which may be trimmed by TFPHashList. 

git-svn-id: trunk@21968 -
2012-07-25 11:08:54 +00:00
joost
8703a15a83 * Patch from Dimitrios Chr. Ioannidis to fix error-message, bug #22503
git-svn-id: trunk@21967 -
2012-07-24 21:31:43 +00:00
florian
58a7baa62b * build an armhf armv6 compiler if it is built by an armhf armv6 compiler
git-svn-id: trunk@21966 -
2012-07-24 17:11:09 +00:00
sergei
24c7b7f433 * If alignment requirement of data is bigger than alignment of the section being written to, increase section alignment to match. This mostly affects cases of non-smart linking, where wrong initial alignment used to cause hard to catch misalignment issues. It also largely obsoletes the need to supply the initial section alignment (hidden tai_section constructor,etc).
* Likewise, when merging object sections into exe sections, set alignment of exe section to maximum value.

git-svn-id: trunk@21964 -
2012-07-24 08:38:11 +00:00
Jonas Maebe
b50d0aa3d0 * only don't pre-finalize funcret temps that are passed by reference to the
called function, fixes webtbs/tw3742.pp after r21955 (looked at wrong
    testsuite results :/ )

git-svn-id: trunk@21963 -
2012-07-23 23:55:00 +00:00
Jonas Maebe
93c345a099 * always decrease the refcount of the function result of helpers that return
interfaces (since that may not have been done yet in case of an optimized
    assignment before r21955, and will never be done as of r21955)

git-svn-id: trunk@21962 -
2012-07-23 23:54:44 +00:00
masta
f354651180 Fix ARM FPU Exceptions for WinCE
r21952 introduced wrong code (through copy&waste) for the wince
exception-setup routines.

This patch hopefully fixes the code again.

git-svn-id: trunk@21961 -
2012-07-23 22:58:02 +00:00
joost
dde026f5d1 * Reverted file accidentally committed in r21957
git-svn-id: trunk@21960 -
2012-07-23 21:13:09 +00:00
joost
160c2fec65 * Use fpmkunit in the fppkg package, to avoid double code.
This also adds (among others) iphonesim support to fppkg

git-svn-id: trunk@21959 -
2012-07-23 20:56:09 +00:00
florian
614afc1c8f * pass march to GNU AS for cpu_armv6 and cpu_armv7
git-svn-id: trunk@21958 -
2012-07-23 20:20:17 +00:00
joost
7b13c9230d * Renamed TLogLevel vl** enumerations to ll**, to avoid
conflicts with fpmkunits TVerboseLevel

git-svn-id: trunk@21957 -
2012-07-23 20:13:19 +00:00
florian
c2eb030632 * for proper alignment in arrays of text, text should be a multiple of 4 in size on 32 bit platforms
git-svn-id: trunk@21956 -
2012-07-23 19:12:27 +00:00
Jonas Maebe
ccbcb36f98 * don't pre-finalize temp nodes that are passed by reference as hidden
function result parameter, because reference counted function results
    are not guaranteed to be initialized (we sometimes even pass the,
    non-finalized, left-hand side of an assignment as hidden function
    result parameter)

git-svn-id: trunk@21955 -
2012-07-23 14:22:36 +00:00
Jonas Maebe
ba4b08261c * fixed (real)modulename memory leak when changing the module name
git-svn-id: trunk@21954 -
2012-07-23 13:49:36 +00:00
Jonas Maebe
0a1157da38 * fixed memory leaks in the compiler introduced in r21862 by marking and
releasing temporarily created function result locations

git-svn-id: trunk@21953 -
2012-07-23 13:49:29 +00:00
masta
386738a7c3 Fix ARM FPU exception masks
This corrects the handling of exception masks and ARM VFP
implementations. The old code enable the exception when it was present
in the mask. So in fact it did the contrary of what it was supposed to
do.

VFP-Support is currently broken, this patch at least allows to build a
working VFP-native compiler. But the full build still breaks because of
some compiler options not properly beeing passed down to packages/ which
results in:

"Trying to use a unit which was compiled with a different FPU mode"

because somehow OPT="-Cfvfpv2" did not get passed down.

git-svn-id: trunk@21952 -
2012-07-23 07:26:57 +00:00
masta
109eb8bf75 Add a couple of ARM Linux syscalls
This adds the following syscalls from Linux 3.5.0:

syscall_nr_preadv
syscall_nr_pwritev
syscall_nr_rt_tgsigqueueinfo
syscall_nr_perf_event_open
syscall_nr_recvmmsg

git-svn-id: trunk@21951 -
2012-07-22 22:58:16 +00:00
florian
d5aa89449e * generate less register wasting code for 64 bit comparions
git-svn-id: trunk@21950 -
2012-07-22 21:07:33 +00:00
masta
be6bf6e3f7 Fix possible access violation introduces in r21885
r21885 added a new peephole optimizer. The associated code refactoring
missed a check for

  tai(hp1).typ = tai_instruction

Which can lead to an access violation later on, because the rest of the
code expects to find a taicpu in hp1.

git-svn-id: trunk@21949 -
2012-07-22 18:06:08 +00:00
Jonas Maebe
bdc62289b4 * the safecall -> cdecl mapping is also activated for x86_64
(tf_safecall_clearstack is set for it) -> also use pocalls_cdecl for it
    and adjust the safecall tests not to try parameter scenarios that are
    unsupported for cdecl

git-svn-id: trunk@21948 -
2012-07-22 16:59:04 +00:00
Jonas Maebe
3798b79fd7 + optimization that (re)orders instance fields of Delphi-style classes in
order to minimise memory losses due to alignment padding. Not yet enabled
    by default at any optimization level, but can be (de)activated separately
    via -Oo(no)orderfields
   o added separate tdef.structalignment method that returns the alignment
     of a type when it appears in a record/object/class (factors out
     AIX-specific double alignment in structs)
   o changed the handling of the offset of a delegate interface
     implemented via a field, by taking the field offset on demand
     rather than at declaration time (because the ordering optimization
     causes the offsets of fields to be unknown until the entire
     declaration has been parsed)

git-svn-id: trunk@21947 -
2012-07-22 16:47:19 +00:00
michael
5b3026d0ce * Keep variable information in a more structured way
git-svn-id: trunk@21946 -
2012-07-22 14:57:30 +00:00
florian
9672f0537a * handle exports with a name consisting of a single character correctly
git-svn-id: trunk@21945 -
2012-07-22 14:23:09 +00:00
sergei
06844fdb23 * Entirely moved relocation fixup functionality from TObjSection to TExeOutput.
git-svn-id: trunk@21944 -
2012-07-22 07:21:11 +00:00
michael
1c894ba71d * Fixed last known access violations
git-svn-id: trunk@21942 -
2012-07-21 08:54:35 +00:00
florian
e10a95bf16 - removed unneeded firstcomplex calls, pass_left_right calls already firstcomplex
git-svn-id: trunk@21941 -
2012-07-21 07:09:06 +00:00
sergei
2bc792fe97 * TObjData.FName made protected.
* Allow EntryName to remain unspecified.

git-svn-id: trunk@21940 -
2012-07-20 12:50:21 +00:00
michael
34c126a2d0 * Fix access violation in case statement
git-svn-id: trunk@21939 -
2012-07-19 16:39:01 +00:00
michael
cd01ae3bd0 * Fixed compilation and finalization
git-svn-id: trunk@21938 -
2012-07-19 06:29:38 +00:00
michael
252c2bbc83 * FormatMessageA -> FormatMessage (W version)
git-svn-id: trunk@21937 -
2012-07-18 09:17:30 +00:00
michael
8a9bd38cd7 * Copied non-sysutils solution of win32/64
git-svn-id: trunk@21936 -
2012-07-18 07:38:21 +00:00
michael
78bfc145c1 * No SysErrorMessage on WinCE ?
git-svn-id: trunk@21935 -
2012-07-18 07:36:24 +00:00
michael
f5e36a8510 * Fixed memory leak with unary expressions
git-svn-id: trunk@21934 -
2012-07-17 23:43:25 +00:00
michael
f6662b7f3c * Fixed memory leak
git-svn-id: trunk@21933 -
2012-07-17 23:18:03 +00:00
michael
09275660d8 * Fix access violation when file not found. Better GetCurColumn
git-svn-id: trunk@21932 -
2012-07-17 22:47:04 +00:00
michael
60022280f0 * Test case for undefine and define
git-svn-id: trunk@21931 -
2012-07-17 22:39:22 +00:00
michael
8b8ccb9e05 * Fixed $UNDEF
git-svn-id: trunk@21930 -
2012-07-17 22:38:04 +00:00
michael
113c97a306 * Some more reference count fixes
git-svn-id: trunk@21929 -
2012-07-17 21:51:13 +00:00
florian
0e9139c914 * retrieve stack size correctly
git-svn-id: trunk@21928 -
2012-07-17 20:14:15 +00:00
florian
f6f6df2780 * removed line breaks
git-svn-id: trunk@21927 -
2012-07-17 20:13:21 +00:00
florian
a6a1f2a0a1 * properly retrieve the stacktop on win64
git-svn-id: trunk@21926 -
2012-07-17 19:47:35 +00:00
Jonas Maebe
6cc78635d7 * send full x/y ansi position information in case of an X-coordinate
overflow (don't know what the y-coordinate is at that point, because the
    window may be  wider than the artificial screenwidth) (mantis #20880)

git-svn-id: trunk@21925 -
2012-07-17 18:03:23 +00:00
Jonas Maebe
408f459f5a * the code generator bugs referred to in r21921 weren't completely fixed yet
after all, although for some reason the problems only showed up with the
    external assembler on x86-64 platforms other than Darwin. Now we never use
    GOT entries on x86-64 anymore for local symbols, regardless of their nature,
    and instead use plain RIP-relative addressing for them.

git-svn-id: trunk@21924 -
2012-07-17 14:36:37 +00:00