Commit Graph

18522 Commits

Author SHA1 Message Date
Jonas Maebe
231039b224 * since T(Tag)HashSet always forces the size to a power of 2, use "and"
rather than "mod" to select the hash bucket

git-svn-id: trunk@32055 -
2015-10-14 16:44:02 +00:00
yury
9431648b6c * Fixed conversion from float to currency when the currency type is 64-bit integer. Issue #28748.
git-svn-id: trunk@32054 -
2015-10-13 22:30:46 +00:00
Jonas Maebe
1e1e4b96e0 * don't store node trees for inline generic routines, as they contain
references to defs that are not stored in the ppu files (causing
    errors) and are never used for inlining (only the specialisations
    may be inlined) (fixes webtbs/tw27658.pp after r32031)

git-svn-id: trunk@32050 -
2015-10-13 15:59:18 +00:00
Jonas Maebe
cebcf0afa8 * add "doregister" parameter to tfloatdef.create, and don't register temporary
defs created in the scanner for evaluating compile time expressions

git-svn-id: trunk@32049 -
2015-10-13 15:59:15 +00:00
Jonas Maebe
b22e2ef400 * add "doregister" parameter to tsetdef.create, and don't register temporary
defs created in the scanner for evaluating compile time expressions

git-svn-id: trunk@32048 -
2015-10-13 15:59:12 +00:00
Jonas Maebe
e921d7847a * add "doregister" parameter to tstringdef.create*, and don't register
temporary defs created in the scanner for evaluating compile time
    expressions

git-svn-id: trunk@32047 -
2015-10-13 15:59:09 +00:00
Jonas Maebe
2778bf55c7 * add "doregister" parameter to torddef.create, and don't register temporary
defs created in the scanner for evaluating compile time expressions, or in
    the code generator for range checking

git-svn-id: trunk@32046 -
2015-10-13 15:59:06 +00:00
Jonas Maebe
91be1d0f2d * removed the DWARF label fields from tdef/tobjectdef, and dynamically
allocate them only while necessary
   o also unified the conditions under which we allocate a separate
     struct label

git-svn-id: trunk@32045 -
2015-10-13 15:59:03 +00:00
Jonas Maebe
67b958bb32 * take SizeOfItem() properly into account in T(Tag)HashSet
git-svn-id: trunk@32044 -
2015-10-13 15:59:00 +00:00
Jonas Maebe
dff35e7d03 * fixed overallocation of buckets in T(Tag)HashSet after resize
git-svn-id: trunk@32043 -
2015-10-13 15:58:57 +00:00
Jonas Maebe
192bb3e032 * free the implementation info for procdefs immediately after a module
has been compiled

git-svn-id: trunk@32042 -
2015-10-13 15:58:54 +00:00
yury
2bcd49bbc4 * Fixed i386 case jump table when PIC with GOT and an external assembler is used.
git-svn-id: trunk@32036 -
2015-10-13 12:58:19 +00:00
Jonas Maebe
2d2b8c635d * detect whether or not a def/sym is registered based on its defid, so we
don't need a separate field for this
   o changed the order in which symid and realname are stored to/loaded from
     the ppufile (because tsym.create now initialised tsym.symid, and it's
     called from ppuload) -> increased ppu version

git-svn-id: trunk@32031 -
2015-10-12 21:03:09 +00:00
yury
4026cfcf60 * android: Generate PIC executables. It is required for Android 5.0+.
git-svn-id: trunk@32023 -
2015-10-12 08:56:04 +00:00
yury
8b27c3cf27 * Enable PIC by default for i386-android.
git-svn-id: trunk@32021 -
2015-10-12 08:13:42 +00:00
yury
862348c317 * Keep the GOT offset in a virtual register for i386 non-darwin platforms.
It fixes PIC code generation with GOT for i386 with enabled optimizations. Bugs #28667, #28668. 
  Prior the fix I have not been able to compile even RTL with -O2 due to not enough free registers, since EBX is reserved for GOT.

  It can be further optimized to teach register allocator to not spill the GOT register if possible.
  

git-svn-id: trunk@32020 -
2015-10-12 08:02:56 +00:00
nickysn
66725cf170 * fixed huge memory model threadvars after r32013
git-svn-id: trunk@32016 -
2015-10-11 12:55:44 +00:00
nickysn
12a9664181 * use 16-bit offsets for threadvars on CPUs with 16-bit address space
git-svn-id: trunk@32013 -
2015-10-11 12:16:26 +00:00
yury
f6045639fc * Removed the tf_safecall_clearstack flag for i386-android. It is useless, since i386-android uses fixed stack.
git-svn-id: trunk@32006 -
2015-10-10 20:43:42 +00:00
yury
d8542bf778 * Do not remove a ret-in-param value from the stack by callee for safecall function when safecall exception check is enabled for a target.
The bug has been triggered only with the following conditions: 
    - tf_safecall_exceptions, tf_safecall_clearstack in target flags;
    - fixed stack is used.
  Since only the i386-android target meets these conditions atm, the bug has been unnoticed.

git-svn-id: trunk@32005 -
2015-10-10 20:40:33 +00:00
svenbarth
d4635f10df Remaining fix for Mantis #28674.
ptype.pas, resolve_forward_types:
  * in case of the def of the forward being the same as the genericdef of the def the forwarddef belongs to the typesym needs to be changed to the one of the specialization

tests/webtbs/tw28674.pp:
  * adjusted text

git-svn-id: trunk@31987 -
2015-10-09 13:18:35 +00:00
Jonas Maebe
5cb2d10c9a * add aarch64 multi-arch library directory (patch by Edmund Grimley Evans)
git-svn-id: trunk@31981 -
2015-10-08 18:56:35 +00:00
Jonas Maebe
21d6b45020 * add i386 multi-arch library directory (patch by Edmund Grimley Evans)
git-svn-id: trunk@31980 -
2015-10-08 18:55:56 +00:00
nickysn
910003848c * fixed code generation of indirect far calls and jumps on the i8086 from the
inline assembler

git-svn-id: trunk@31946 -
2015-10-05 02:19:32 +00:00
nickysn
b3c2765da9 * on i8086, for BP7 compatibility, assemble 'call/jmp dword [ref]' as a far call
git-svn-id: trunk@31945 -
2015-10-05 00:47:17 +00:00
joost
8e2a44db88 * Fixed problem with samplecfg that did not write the fppkg-configuration files when fp was not installed
git-svn-id: trunk@31943 -
2015-10-04 09:36:07 +00:00
Jonas Maebe
95927665ce - removed variable notification support, it's not used and superceded by
DFA

git-svn-id: trunk@31916 -
2015-10-02 17:00:25 +00:00
svenbarth
3afc18f277 Fix for Mantis #28766.
ncgrtti.pas, write_persistent_type_info:
  * do not generate RTTI information for generics

git-svn-id: trunk@31911 -
2015-10-02 13:06:51 +00:00
svenbarth
c25e7491e7 Fix for Mantis #28674.
ptype.pas, resolve_forward_types:
  * fix an access violation in case of inline pointer declarations
  * fix the check whether it's a valid use of a generic (parse_generic is useless here...)

+ added test

git-svn-id: trunk@31910 -
2015-10-02 12:46:13 +00:00
florian
c40240990e * popt386 uses now also all routines of aoptx86
git-svn-id: trunk@31894 -
2015-09-29 19:31:33 +00:00
svenbarth
114dfe41a3 Fix for Mantis #28741.
pexpr.pas:
  * initialize srsym in the classrefdef case; it should not have let to problems, because it's only used if erroroutp1 is false which is only the case if the symbol is assigned, but better save then sorry...

git-svn-id: trunk@31887 -
2015-09-29 12:56:01 +00:00
Jonas Maebe
2b01a7e2c6 * initialize errorp1 for classrefdef after r31856 (mantis #28741, but this
doesn't fix it as there are more problems)

git-svn-id: trunk@31884 -
2015-09-29 07:59:59 +00:00
Jonas Maebe
525685617c * unicode2ascii: give an internalerror when trying to convert to UTF-8, as
this routine does not support this (and isn't/shouldn't be used for that
    purpose in the compiler)

git-svn-id: trunk@31882 -
2015-09-28 22:15:00 +00:00
Jonas Maebe
05bf826342 + support UTF-8 in ascii2unicode(), this fixes the UTF-16 output of
resourcestring data .rsj files in case the source file is interpreted as
    UTF-8. Previously, the individual UTF-8 bytes were each stored in a
    separate widechar in the Json file (mantis #28717)

  * due to the fact that rstconv didn't use the cwstring unit on Unix, rstconv
    until now just concatenated the bytes stored in the widechars of the Json
    file on those platforms, i.e., the strings put in the resource file were
    byte for byte equal to what was in the source file. On Windows, these bytes
    were interpreted as individual widechars, converted to the
    DefaultSystemCodePage and then written. This means that for anything but
    ISO-8859-1 (where every widechar from #0000 to #0255 maps to #0 to #255),
    the output got corrupted.

    In order to keep compatibility with the old behaviour whereby rstconv wrote
    the resource strings using the same encoding as in the source file (except
    if the data got completely corrupted, in which case compatibility is
    useless), we now store all resourcestrings twice in the .rsj file: once as
    the exact byte sequence from the source file, and once (properly) encoded
    in UTF-16.

    By default, rstconv will use the byte string and just write that one to the
    resource file. Additionally, there is a new -p option that accepts a code
    page name (see rstconv -h for the list of supported names), which can be
    used to make rstconv use the UTF-16 version and convert that to the desired
    code page (as long as the system on which rstconv runs supports that
    codepage).

    And this also finally resolves mantis #6477.

git-svn-id: trunk@31881 -
2015-09-28 22:14:56 +00:00
Jonas Maebe
a1ed7cc162 * addending to r31831: disable cs_systemcodepage if the source file code page
is set via an UTF-8 BOM

git-svn-id: trunk@31880 -
2015-09-28 22:14:53 +00:00
Jonas Maebe
0ebee6a825 * enabled assembling via a pipe for clang
git-svn-id: trunk@31879 -
2015-09-28 22:14:50 +00:00
Jonas Maebe
fdf76bc606 * ascii2unicode: consistently use the cp parameter
git-svn-id: trunk@31878 -
2015-09-28 22:14:44 +00:00
svenbarth
e2be6f400f Fix for Mantis #28738.
pexpr.pas:
  * the gettypedef() overload should not have been commented... Note to self: don't test things during commits

git-svn-id: trunk@31875 -
2015-09-28 09:25:07 +00:00
florian
79619df936 + use the or instruction to compare 32 bit values with 0
git-svn-id: trunk@31862 -
2015-09-27 20:50:59 +00:00
florian
298cde6489 + initial code in aoptcpu for i8086: make use of lds/les
git-svn-id: trunk@31861 -
2015-09-27 20:50:57 +00:00
svenbarth
bb873c93af pexpr.pas:
* postfixoperators: generate specialize nodes in mode Delphi
  * factor: don't call postfixoperators() if returned node is a specialize node
  * sub_expr: handle specialize nodes
  * sub_expr: extract common code handling specializations in < and as/is into a nested function

git-svn-id: trunk@31859 -
2015-09-27 20:12:03 +00:00
svenbarth
9dcfec8c63 pexpr.pas:
* extend handle_specialize_inline_specialization() with the ability to handle generic functions
  * have handle_factor_typenode() and postfixoperators() make use of this extension

git-svn-id: trunk@31856 -
2015-09-27 18:53:16 +00:00
Jonas Maebe
8e50695f78 * make the meaning of "string" in {$h+} mode the same as that of ansistring:
"type ansistring(CP_ACP)", rather than "type ansistring(sourcefilecodepage)"

git-svn-id: trunk@31847 -
2015-09-27 14:46:41 +00:00
florian
53ea4fb7d4 * unify x86 peephole optimizer helpers
git-svn-id: trunk@31843 -
2015-09-27 09:36:39 +00:00
nickysn
3e2248f41a + implemented exporting of functions for the win16 target
git-svn-id: trunk@31842 -
2015-09-27 00:48:35 +00:00
nickysn
c513cec740 - disallow mixing 'export' and 'interrupt' for the same procedure
git-svn-id: trunk@31836 -
2015-09-26 18:35:04 +00:00
nickysn
b26e10d53c + generate proper win16 prologue/epilogue for exported routines (we don't yet
actually export them from the .exe or .dll, but they can now be used as
  callbacks)
+ support win16 smart callbacks via the $K switch

git-svn-id: trunk@31835 -
2015-09-26 18:04:59 +00:00
nickysn
ae533e4c77 + made the $W switch control the FarProcsPushOddBP target switch in the i8086
compiler (BP7 compatibility) instead of controlling stack frame elimination
  (which isn't supported by the compiler on i8086 anyway, due to i8086's lack
  of support for stack relative addressing)

git-svn-id: trunk@31834 -
2015-09-26 15:41:44 +00:00
nickysn
e0aa6bf85f * the FarProcsPushOddBP target switch made local instead of global (BP7 compatibility)
git-svn-id: trunk@31833 -
2015-09-26 15:14:15 +00:00
nickysn
3a4afab681 * fixed a bug in the $targetswitch directive, which prevented target switches
from being turned off (they were turned on instead)

git-svn-id: trunk@31832 -
2015-09-26 13:36:51 +00:00