Commit Graph

49852 Commits

Author SHA1 Message Date
Jonas Maebe
b936d8f012 * don't internalerror when performing an LLVM tc_equal conversion from one
TP-style object to another and the sizes differ, at least if they are
    related
  * restructured and commented the LLVM type conversion checks

git-svn-id: trunk@35137 -
2016-12-16 22:38:01 +00:00
svenbarth
86207c9b55 - remove no longer valid {otNone} comment
git-svn-id: trunk@35136 -
2016-12-16 14:23:14 +00:00
svenbarth
a9d14fe30b * extend TOrdType by entries for 64-bit values
* have tkInt64 and tkQWord entries also contain the OrdType field (basically the compiler can now use the same function to generate them only with different type kinds)

+ added test

git-svn-id: trunk@35135 -
2016-12-16 14:22:04 +00:00
svenbarth
460f309035 * fix for Mantis #31123, applied patch by Maciej Izak
* adjusted test trtti10.pp due to renamed RecInitTable field

Original commit message:

Public interface for init table for records in TypInfo:

* Rename RecInitTable to RecInitInfo (because it is special kind of PTypeInfo for init table of record). Has more sense in practical usage.
+ New structure TRecInitData (and related PRecInitData) to handle data for (init) type info for records (aka init table)
+ New structure TInitManagedField and pointer type PInitManagedField (for init table)
+ Special helper property RecInitData to get PRecInitData for tkRecord

+ test attached

git-svn-id: trunk@35134 -
2016-12-16 13:43:12 +00:00
svenbarth
121a857af8 * fix for Mantis #31118: applied patch by Maciej Izak to fix usage of wrong variable
+ added test

git-svn-id: trunk@35133 -
2016-12-15 13:47:26 +00:00
Károly Balogh
cabcc52db1 less occurred, a.k.a. revert of r35128 in fpmkunitsrc.inc. don't break the build by fixing typos with search & replace in generated files
git-svn-id: trunk@35132 -
2016-12-15 02:04:10 +00:00
michael
e342d3e15c * Not the complete fix for bug ID #31092 was committed
git-svn-id: trunk@35131 -
2016-12-14 22:21:49 +00:00
marco
7ef8f00100 * more occured -> occurred spelling fixes.
git-svn-id: trunk@35130 -
2016-12-14 20:05:21 +00:00
marco
7effa642b8 * more occured
git-svn-id: trunk@35129 -
2016-12-14 20:01:35 +00:00
svenbarth
7089677a22 * change RecInitTable into a direct reference to avoid an unnecessary indirection as both the full and init RTTI of a record always reside inside the same unit
git-svn-id: trunk@35128 -
2016-12-14 18:40:16 +00:00
svenbarth
e580e22576 * extend ref_rtti() with the possibility to use a direct reference if really desired
git-svn-id: trunk@35127 -
2016-12-14 18:38:54 +00:00
michael
d90738c784 * Fix by Graeme Geldenhuys for bug ID #31092
git-svn-id: trunk@35126 -
2016-12-14 17:42:57 +00:00
svenbarth
12dba952f0 * integration of Part 2 patch of Mantis #30687 with a few adjustments:
- indentation in ncgrtti.pas
  - fewer ifdefs in rtti.inc
  - InitTable/Terminator field as first field to avoid padding on targets that require proper alignment and have SizeOf(Pointer) > 4

Original message by Maciej Izak:

Breaking change for rtti layout for record rtti. Init table
is always accessible from regular rtti. Rtti table contains indirect
reference to init table, additionally init table contains nil-terminator (for
rtl purposes - the only way to determine kind of info : init or rtti). Pros:

* will be possible to create more Delphi compatible code for RTTI, finally end-user can access to *real* managed fields of records (some work on TypInfo.pp is still required but is not necessary).
* important step forward for management operators (anyway this commit is not directly related to management operators)
* much more optimal memory allocation/initialization/finalization for records created/destroyed by InitializeArray/FinalizeArray, for example:

type
  TBar = record
    f1,f2,f3,f4,f5,f6,f7,f8,f9: byte;
    s: string;
  end;

previously:

  GetMem(PB, SizeOf(TBar));
  InitializeArray(PB, TypeInfo(TBar), 1); // FPC_INITIALIZE was executed 10 times

now:

  GetMem(PB, SizeOf(TBar));
  InitializeArray(PB, TypeInfo(TBar), 1); // FPC_INITIALIZE is executed just once

+ test attached

git-svn-id: trunk@35125 -
2016-12-13 23:03:11 +00:00
svenbarth
43212c4507 * use a separate OS set for the Rtti unit than CommonSrcOSes
git-svn-id: trunk@35124 -
2016-12-13 22:06:28 +00:00
svenbarth
17154fedaa * move rtti unit from common directory to inc directory as the former is basically for non-Windows files
git-svn-id: trunk@35123 -
2016-12-13 22:04:32 +00:00
marco
f4213124f2 * some more occured->occurred, mostly in comments
git-svn-id: trunk@35122 -
2016-12-13 14:26:41 +00:00
marco
dce9b9c68c * some more "occured", mantis #31112
git-svn-id: trunk@35121 -
2016-12-13 13:31:50 +00:00
marco
d2fe24ae20 * fix some more occured->occured
git-svn-id: trunk@35120 -
2016-12-13 12:55:32 +00:00
marco
bc39eb29d3 * comment spelling fix (modifed->modified)
git-svn-id: trunk@35119 -
2016-12-13 12:50:38 +00:00
marco
bcb2d5b975 * comment spelling fix
git-svn-id: trunk@35118 -
2016-12-13 12:50:03 +00:00
Károly Balogh
d52c75ba17 powerpc: clean up and simplify the PPC version of the VASM writer (based on the 68k version), and also enable it for AmigaOS4/PPC and Linux/PPC
git-svn-id: trunk@35117 -
2016-12-12 23:36:06 +00:00
Károly Balogh
026f0e99f3 m68k: made the vasm writer use the right section attributes, but disabled named sections until some vlink issues are sorted out
git-svn-id: trunk@35116 -
2016-12-12 22:46:47 +00:00
Károly Balogh
f1f18d6f83 aggas: removed a bunch of amiga related hacks which are unnecessary if those systems use an aout GAS writer. made it possible to inject sectionattrs in a generic way
git-svn-id: trunk@35115 -
2016-12-12 22:44:36 +00:00
Károly Balogh
2dc1d681c2 m68k: inherit the aout assembler writer instead of the normal one for amiga and atari. this allows to remove some of the previously added hacks in the generic writer
git-svn-id: trunk@35114 -
2016-12-12 22:41:53 +00:00
svenbarth
22e579cc74 * fix for Mantis #31107: disallow calling of ordinary record methods using the record's type.
git-svn-id: trunk@35113 -
2016-12-12 22:08:28 +00:00
Károly Balogh
4e51dc2298 m68k: enable named sections for vasm generated objects. have a separate as_m68k_as_aout for a.out objects which doesn't have named sections. amiga and atari gas defaults to a.out, so have it default on these systems. finally enable section smartlinking for amiga and atari, which will be used with vasm assembler
git-svn-id: trunk@35112 -
2016-12-11 23:27:24 +00:00
Károly Balogh
66e651bed0 m68k: build fix
git-svn-id: trunk@35111 -
2016-12-11 16:49:03 +00:00
Károly Balogh
88a91330a3 amiga/powerpc: further tweaks in the upcoming pascal startup code
git-svn-id: trunk@35110 -
2016-12-11 16:38:37 +00:00
Károly Balogh
1dd375cd61 powerpc: improved version of int_to_bool casting. now both also passes the improved version of tb0625
git-svn-id: trunk@35109 -
2016-12-11 16:00:27 +00:00
Károly Balogh
df38fd18e0 m68k/powerpc: improved version of int_to_bool casting. now both also passes the improved version of tb0625
git-svn-id: trunk@35108 -
2016-12-11 15:43:58 +00:00
Károly Balogh
442cbed9ad improved tb0625. boolean casting should disregard the upper bits
git-svn-id: trunk@35107 -
2016-12-11 13:26:04 +00:00
Károly Balogh
288a39d86e m68k: indentation fixes. no functional changes.
git-svn-id: trunk@35106 -
2016-12-11 03:58:41 +00:00
Károly Balogh
15f67e6f5b m68k: in int to bool conversion, only try to zero/sign extend the value, if the destination is actually larger than the source
git-svn-id: trunk@35105 -
2016-12-11 03:57:55 +00:00
svenbarth
8fee10f45b * fix the handling of ordinals of which the size is less than 64-bit (fixes Rtti unit on big endian CPU)
git-svn-id: trunk@35104 -
2016-12-10 21:46:01 +00:00
svenbarth
5fa181b5d9 * second fix for Mantis #31033: also check for df_specialization instead of is_specialization for parameters to correctly handle nested types that aren't really true specializations themselves
+ added additional test

git-svn-id: trunk@35103 -
2016-12-10 19:47:09 +00:00
svenbarth
c4bc31b083 * fix for Mantis #31094: apply patch by Silvio Clécio to fix a typo
git-svn-id: trunk@35102 -
2016-12-10 19:32:49 +00:00
svenbarth
0c372f0beb * fix compilation of Rtti unit on PowerPC: converting a Int64 to a Boolean failed (in this case with an internal error)
+ added a test though we should probably extend tcnvint2.pp to test converting ints to different sized boolean types...

git-svn-id: trunk@35101 -
2016-12-10 19:13:07 +00:00
marco
02e2b8752d * allow to set value on cmdline since llvm versions don't work atm.
* also patch gprt0.as

git-svn-id: trunk@35100 -
2016-12-10 15:04:32 +00:00
svenbarth
e51da008fe * consider the Rtti unit as experimental for now
git-svn-id: trunk@35099 -
2016-12-09 23:38:27 +00:00
svenbarth
f14759356f * regenerated Makefile after r35097
git-svn-id: trunk@35098 -
2016-12-09 20:48:34 +00:00
svenbarth
43d5dacf70 + add ability to execute tests that reside in $fpcdir/packages/*/tests
For now only rtl-objpas is used as the tests nevertheless need to adhere to the rules: t*.pp, ExitCode for result, no parameters

git-svn-id: trunk@35097 -
2016-12-09 20:48:11 +00:00
svenbarth
3e5f8af01d + add RTTI unit from Joost's Attribute branch
* adjust unit to work without attributes
* adjust unit to work without unit list (TRttiContext.GetTypes is disabled due to this)
+ add ShortString support (due to an intermediary test I had done in $H-)
+ add unit test from Joost's Attribute branch
* adjust unit test accordingly (no attributes, no TRttiContext.GetTypes)
+ add ShortString tests
+ add testrunner for RTL-ObjPas tests using the new simpletestrunner

git-svn-id: trunk@35096 -
2016-12-09 20:45:46 +00:00
svenbarth
933e449848 + add a simple test runner for FPCUnit (no parameters, only plain output, sets ExitCode depending on any failures/errors) that can be used with FPC's testsuite
git-svn-id: trunk@35095 -
2016-12-09 20:22:33 +00:00
michael
9749ddc3bb * Some Range Checking fixes from Graeme Geldenhuys
git-svn-id: trunk@35094 -
2016-12-09 17:50:22 +00:00
svenbarth
d133f210ca * correct comment, cause forward declarations for generic functions *do* indeed work (cause they use the same mechanism as forward definitions in the interface section)
git-svn-id: trunk@35093 -
2016-12-09 16:24:17 +00:00
svenbarth
52673d34f1 * fix for Mantis #31033: don't check for is_specialization(), but for df_specialization (this way we also get pointers or nested types that aren't by themselves real specializations)
+ added test

git-svn-id: trunk@35092 -
2016-12-09 16:22:14 +00:00
svenbarth
f8c23c84b6 * have pointerdefs and classrefdefs "inherit" the df_generic and df_specialization flags from the def they point to and set the genericdef accordingly
git-svn-id: trunk@35091 -
2016-12-09 16:20:36 +00:00
michael
7ead78e71b * Forgot to add fpfonttextmapping.pp
git-svn-id: trunk@35090 -
2016-12-09 14:24:14 +00:00
Jonas Maebe
18077d9530 * when determining the best candidates for overloaded method calls, apply
the scope penalty relative to the nearest symtable that contains one of
    the applicable overloads, rather than relative to the nearest symtable
    that simply contains a method with this name (based on patch by
    Maciej Izak, mantis #25607)

git-svn-id: trunk@35089 -
2016-12-09 13:39:42 +00:00
Jonas Maebe
04f7e47df7 * create stubs for library exports on Unix at at the node tree level instead
of using thlcg.g_external_wrapper() for high level targets, because that
    way the creation of a new procdef for this stub and adding appropriate
    entry/exit code can be handled using the standard compiler infrastructure
    (fixes webtbs/tw8730* for LLVM)

git-svn-id: trunk@35088 -
2016-12-09 13:39:38 +00:00