Commit Graph

150 Commits

Author SHA1 Message Date
pierre
3d34a8a3b0 Makefiles updated with fpcmake rev 27428
git-svn-id: trunk@27508 -
2014-04-10 09:58:17 +00:00
sergei
217bac7a0b - Removed fpc_pi_real compilerproc, it is no longer used. At least two releases (2.6.2 and 2.6.4) emit Pi directly as a constant.
git-svn-id: trunk@27500 -
2014-04-07 09:16:24 +00:00
Jonas Maebe
49ccedbff1 * r27142 for the JVM target, so its system unit compiles again
git-svn-id: trunk@27381 -
2014-03-30 16:54:59 +00:00
sergei
d004607876 * fpc_raiseexception does not return a result.
git-svn-id: trunk@26837 -
2014-02-22 15:18:31 +00:00
yury
73c26bd6be * mipsel-android: Regenerated makefiles. From now the mipsel-android target can be built and used.
git-svn-id: trunk@26705 -
2014-02-07 12:37:17 +00:00
marco
dea2c743d5 * Initial active version of
rtl-extra : objects matrix ucomplex
   rtl-objpas: convutil(s) dateutil(s) stdconvs variants varutils
   

git-svn-id: trunk@26398 -
2014-01-05 19:20:15 +00:00
sergei
f42c1b3720 * Return dynamic arrays in parameter, this was the only managed type still returned in register. Returning managed types in registers requires catching and re-raising exceptions at callee side in order to finalize result and avoid memory leaks. While such behavior makes little difference with generic setjmp-based exception handling, it becomes very inefficient as SEH-styled exception handling is being introduced.
The new behavior is also Delphi-compatible.

git-svn-id: trunk@26180 -
2013-12-04 13:43:22 +00:00
Jonas Maebe
d4b6406e62 * fixed compilation of new str<->float code on the JVM target (patch by
Max Nazhalov) and use that code by default on the JVM target
  * adapted JVM tests for the new str<->float code similar to how the
    generic tests were adapted

git-svn-id: trunk@25954 -
2013-11-06 16:13:50 +00:00
Jonas Maebe
ee0d80ac19 * force use of real2str.inc after r25888 because it doesn't compile (yet?)
for the jvm target (mantis #25267)

git-svn-id: trunk@25910 -
2013-11-01 19:20:47 +00:00
sergei
9ad98a2c4d * Handle "SarInt64" always as internal procedure, introduced virtual method tinlinenode.first_sar that by default converts it into call to "fpc_sarint64" unless target CPU is 64-bit. This provides a point to insert target-specific optimizations.
git-svn-id: trunk@25876 -
2013-10-28 14:31:36 +00:00
nickysn
1bea98995b * regenerated fpcmake makefiles after r25642
git-svn-id: trunk@25644 -
2013-10-05 10:11:27 +00:00
sergei
b99cf8d680 * RTL: Changed 'shift' parameter of 64-bit shift helpers to CPU-native size, it doesn't have to be 64-bit because only its lower 6 bits are used. Not using 64 bit parameter improves code quality a bit.
git-svn-id: trunk@25478 -
2013-09-13 08:32:45 +00:00
Jonas Maebe
3c3ad705f1 * changed fpc_(u)char_to_shortstr() from a procedure into a function, like
the other fpc_(u)char_to_*str() routines (exception dates back to the
    time calls to these routines were still inserted "manually" in the
    compiler). Fixes the compilation of "shortstr:=widecharconstant" after
    r23613 and simplifies other code calling this helper + test

git-svn-id: branches/cpstrrtl@25428 -
2013-09-06 08:02:46 +00:00
Jonas Maebe
1a560e9875 * when concatenating ansistrings, do not map CP_NONE (rawbytestring) to
CP_ACP (defaultsystemcodepage), because if all input strings have the
    same code page then the result should also have that code page if it's
    assigned to a rawbytestring rather than getting defaultsystemcodepage
  * do not consider empty strings to determine the code page of the result
    in fpc_AnsiStr_Concat_multi(), because that will cause a different
    result than when using a sequence of fpc_AnsiStr_Concat() calls (it
    ignores empty strings to determine the result code page) and it's also
    slower
  * do not consider the run time code page of the destination string in
    fpc_AnsiStr_Concat(_multi)() because Delphi does not do so either. This
    was introduced in r19118, probably to hide another bug
  + test

git-svn-id: branches/cpstrrtl@25143 -
2013-07-19 16:33:14 +00:00
Jonas Maebe
aaa5bb48de + ToSingleByteFileSystemEncodedFileName(array of widechar) overload for more
efficient operation in certain platform's dos units (avoid
    array-of-widechar -> unicodestring conversion)

git-svn-id: branches/cpstrrtl@25138 -
2013-07-19 16:31:21 +00:00
Jonas Maebe
a5273abc9c + support for CP_OEMCP
* changed all mappings from CP_ACP to DefaultSystemCodePage to calls to the
    new TranslatePlaceholderCP() routine (which also handles CP_OEMCP)
  * removed unnecessary CP_ACP adaptations in fpc_AnsiStr_Concat_multi()
    for JVM target (now handled in the ansistring to unicodestring conversion
    routine)

git-svn-id: branches/cpstrrtl@25091 -
2013-07-12 17:18:24 +00:00
Jonas Maebe
8a4b092ab9 * made ToSingleByteFileSystemEncodedFileName(unicodestring) overridable by
target-specific code and implemented a JVM-compatible version

git-svn-id: branches/cpstrrtl@25001 -
2013-06-27 21:38:17 +00:00
Jonas Maebe
da7a67bc74 + FPCRTL_FILESYSTEM_SINGLE_BYTE_API define that is set for targets where we
use a single byte API for file system operations
  + FPCRTL_FILESYSTEM_TWO_BYTE_API define that is set for targets where we
    use a single byte API for file system operations
   o in principle, both can be set if both are supprted and implemented in
     the RTL in order to minimise conversions depending on the scenario

git-svn-id: branches/cpstrrtl@24991 -
2013-06-27 21:37:39 +00:00
Jonas Maebe
ecd3cba02b * synchronised with trunk up to r24912
o resolved conflict in updated morphos sysutils unit
   o moved code that had been added to the now deleted  sysunix.inc to the
     unix-specific block of the fpwidestring unit's init code

git-svn-id: branches/cpstrrtl@24913 -
2013-06-17 20:50:02 +00:00
paul
d90445e5ee compiler, rtl, tests: write Delphi compatible (more or less) type information for Class Reference and Pointer types (mantis #0024367)
git-svn-id: trunk@24421 -
2013-05-04 12:47:05 +00:00
pierre
78a7043352 Regenerate all Makefiles with an up-to-date fpcmake binary (dummy commit)
git-svn-id: trunk@24367 -
2013-04-29 12:30:54 +00:00
florian
3d7033d81e * Makefiles regenerated
git-svn-id: trunk@24325 -
2013-04-25 20:25:57 +00:00
Jonas Maebe
e1e11f81e3 * fixed using readstr/writestr inside routines called from the parameter
list of another readstr/writestr expression (mantis #23912)

git-svn-id: trunk@23888 -
2013-03-17 14:23:33 +00:00
florian
21c154d60a Merged r22903
git-svn-id: trunk@23757 -
2013-03-09 20:56:07 +00:00
yury
22116ce9be * Revert changes to java-related files by r23604.
git-svn-id: trunk@23606 -
2013-02-13 13:13:21 +00:00
yury
2fc220cc6c * Regenerated makefiles.
git-svn-id: branches/targetandroid@23410 -
2013-01-16 14:52:36 +00:00
yury
d26f0552a0 * Sync with trunk r23404.
* Regenerated makefiles.

git-svn-id: branches/targetandroid@23405 -
2013-01-16 13:21:51 +00:00
Jonas Maebe
9777699c70 * fixed compilation for targets with internal stack checking after r23325
* added (commented out) fpc_stackcheck() compilerproc to java version of
    compproc.inc

git-svn-id: trunk@23326 -
2013-01-06 15:51:46 +00:00
Jonas Maebe
69c29a415f * pass the procdef to getintparaloc instead of only the proccalloption, so
that the type of the parameters can be determined automatically
   o added compilerproc declarations for all helpers called in the compiler
     via their assembler name, so we can look up the corresponding procdef

git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
Jonas Maebe
7c578c3541 * made the pascal name of the string range checking helpers match
their assembler name

git-svn-id: trunk@23324 -
2013-01-06 15:05:33 +00:00
Jonas Maebe
4ea78538e4 * enabled threading feature for jvm target so that rtl/inc/genmath.inc
compiles again there (it's possible to take the address of arbitrary
    threadvars on the jvm platform, but not of arbitrary other variables)
  - disabled inclusion of generic thread manager and threadvar support
    on the jvm target if the threading feature is enabled

git-svn-id: trunk@23322 -
2013-01-06 15:05:24 +00:00
Jonas Maebe
fe5a4baa15 - removed FPC 2.4 bootstrapping support
git-svn-id: trunk@23321 -
2013-01-06 15:05:20 +00:00
Jonas Maebe
14b1c8a99c * moved fpc_threadvar_relocate_proc from systemh.inc to thread.inc
and gave it the correct type (TRelocateThreadVarHandler)
  * changed parameter type of InitThread also to TRelocateThreadVarHandler

git-svn-id: trunk@23130 -
2012-12-09 22:42:46 +00:00
Jeppe Johansen
3ee29eb219 Fixed ARMv7-EM code generation and RTL compilation
Added LM4F120H5 controller type and startup code

git-svn-id: branches/laksen/arm-embedded@22903 -
2012-11-01 17:25:01 +00:00
Jonas Maebe
d40d207552 * workaround because "public,alias" isn't supported yet on JVM targets
git-svn-id: trunk@22495 -
2012-09-28 08:15:05 +00:00
Jonas Maebe
21e162604c * fixed "make install" for jvm targets
+ implemented top level "make (cross)zipinstall" for jvm targets
    (mantis #23005)

git-svn-id: trunk@22493 -
2012-09-27 21:35:17 +00:00
Jonas Maebe
598d2feeb6 + rtldefs.inc file for every target that contains defines shared by multiple
RTL units. Comes with a FPCRTL_FILESYSTEM_UTF8 define that can be
    activated for targets whose single byte filesystem interface enforces
    UTF-8; included in inc/systemh.inc and unix/cwstring.pp until now
  + DefaultFileSystemCodePage variable that holds the code page used for
    communicating with the OS single byte file system APIs, and for the
    strings returned by those same APIs. Initialized with
   o the result of GetACP in the system unit of Windows platforms, except for
     WinCE which uses UTF-8 since its file system OS API calls already use
     the UTF-16 versions
   o CP_UTF8 on Unix platforms with FPCRTL_FILESYSTEM_UTF8 defined, and with
     DefaultSystemCodePage on other Unix platforms
   o DefaultSystemCodePage on Java/Android JVM targets
  + DefaultRTLFileSystemCodePage variable that holds the code page used to
    encode strings returned by RTL routines that return filenames obtained
    from OS API calls. By default the same as DefaultFileSystemCodePage on
    all platforms. Separate from DefaultFileSystemCodePage for clarity on
    platforms that may use either utf-16 or single byte OS API calls to
    send/receive file names (such as most Windows platforms)
  + new scpFileSystemSingleByte enum that can be passed to
    GetStandardCodePage() to get the default code page for OS single byte file
    system APIs, with implementations for Unix and Windows
  + SetMultiByteFileSystemCodePage() procedure to override the value of
    DefaultFileSystemCodePage

  In principle, in the long run unchanged programs only using generic
  ansistrings and unicodestrings should (mostly) behave the same as in
  FPC 2.6.0 as far as RTL-level file system APIs are concerned if
  they set DefaultFileSystemCodePage and DefaultRTLFileSystemCodePage
  to DefaultSystemCodePage at the start of their execution

git-svn-id: branches/cpstrrtl@22466 -
2012-09-27 07:54:06 +00:00
Jonas Maebe
91d92c4732 * make ansistring unique when changing the code page without conversion
(like on other platforms)

git-svn-id: trunk@22463 -
2012-09-26 19:48:37 +00:00
Jonas Maebe
f2e1ec2771 * merged changes to systemh.inc/compproc.inc from r22289/r22290/r22310
git-svn-id: trunk@22349 -
2012-09-06 21:41:35 +00:00
florian
9be3ca04ad * split FPC_HAS_INTERNAL_BSX_* defines into FPC_HAS_INTERNAL_BSF_* and FPC_HAS_INTERNAL_BSR_*
git-svn-id: trunk@22308 -
2012-09-04 12:56:18 +00:00
Jonas Maebe
060e3ed4ee * changes from r21697, 21707, 21843, 21861, 21701, 21887, 21899 and 21900
to systemh.inc/system.inc/compproc.inc 'merged' into as of yet still
    JVM-specific copies of those files

git-svn-id: trunk@22125 -
2012-08-19 13:51:15 +00:00
Jonas Maebe
504544e173 * fixed null-termination in StringToWideChar() if the buffer is larger than
the string (mantis #22669)

git-svn-id: trunk@22124 -
2012-08-19 13:48:02 +00:00
tom_at_work
f252fd369e Tried to reorganize the ARM define mess in rtl/arm/arm.inc. Instead of requiring to enumerate all possible ARM variants each time a CPU feature is used, add a define of the format CPUARM_HAS_XXX and use that. Note that a better solution would be to properly implement the compiler cpuinfo infrastructure, however that is much more work.
+ CPUARM_HAS_BX is defined if the CPU supports the BX* instruction
  + CPUARM_HAS_REV is defined if the CPU supports the REV instruction. Note that you still have to check for compiler versions > 2.6.0 since the assembler reader of 2.6.0 does not understand that instruction.
  + CPUARM_HAS_IDIV is defined if the CPU supports the sdiv, udiv instructions. Use of this fixes a bug where previously these instruction were only used for armv7-m, while cortex3m cpus also support it.
  + CPUARM_HAS_LDREX is defined if the CPU supports the ldrex/strex instructions. Use of this fixes a bug with armv7(-a) cpus where this path has not been used.
  + SYSTEM_HAS_KUSER_CMPXCHG is defined if the system (mainly OS) support the kuser_cmpxchg functions. Use of this fixes a bug where ARMHF systems did not use it for synchronization (although ARMHF is armv7+ only, i.e. the LDREX path is used anyway)

git-svn-id: trunk@22081 -
2012-08-14 19:45:03 +00:00
tom_at_work
810adb2f65 Merge with trunk r22040. Regenerated makefiles.
git-svn-id: branches/targetandroid@22046 -
2012-08-09 08:12:34 +00:00
Jonas Maebe
56fcc87cb2 * add get_frame as an internal symbol for the jvm target because that target
defines INTERNAL_BACKTRACE (which assumes get_frame to be internal rather
    than a system unit procedure)
  * changed fpc_assert() declaration for jvm to be the same as for other
    targets, so the same code can be used to call it in ninl now that's
    called from the first pass

git-svn-id: trunk@21903 -
2012-07-12 13:25:02 +00:00
Jonas Maebe
596d359e02 * use current code page when converting ansichar to unicodestring
git-svn-id: trunk@21877 -
2012-07-11 15:22:31 +00:00
Jonas Maebe
aba6923187 * moved g_test_self() from cgobj to hlcgobj
git-svn-id: trunk@21861 -
2012-07-11 08:25:51 +00:00
Jonas Maebe
595f28e6fa + AnsistringClass.Create(unicodestring) constructor that implicitly selects
the DefaultSystemCodePage for use from Java code

git-svn-id: trunk@21724 -
2012-06-27 16:13:47 +00:00
pierre
8469741700 + Added additional addr pointer parameter to
get_caller_frame, get_caller_addr and dump_stack
  with default NIL value to systemh.inc.
  + Added new get_addr function.
  system.inc: Use get_addr and get_frame to call
  HandleErrorAddrFrame instead of HandleErrorFrame
  in several error functions.
  Modify dump_stack to use frame and addr parameters.
  Provide a dummy get_addr function returning nil.
  i386/i386.inc, x86_64./x86_64.inc: Provide real
  implementation of get_addr function.

git-svn-id: trunk@21697 -
2012-06-24 21:22:09 +00:00
Jonas Maebe
7a0ae38700 + also specify the parameter def when allocating a parameter via
getintparaloc + adapted all call sites of getintparaloc. This
    led to a number of additional, related changes:
   o corrected the type information for some getintparaloc parameters
   o don't allocate some intparalocs in cases they aren't used
   o changed "const tvardata" parameter into "constref tvardata" for
     fpc_variant_copy_overwrite to make pass-by-reference semantics
     explicit
   o moved a number of routines that now have to call find_system_type()
     from cgobj to hlcgobj so that cgobj doesn't have to start depending
     on the symtable unit
   o added versions of the cpureg alloc/dealloc methods to hlcgobj that
     call through to their cgobj counter parts, so we can call save/restore
     the cpu registers before/after calling system helpers from hlcgobj
     (not implemented in hlcgobj itself, because all basic register
      allocator functionality is still part of cgobj/cgcpu)

git-svn-id: trunk@21696 -
2012-06-24 15:02:12 +00:00