Commit Graph

4200 Commits

Author SHA1 Message Date
Károly Balogh
51e28ac717 atari: reworked param handling once more, based on the Amiga code, fixes argv/argc
git-svn-id: trunk@35205 -
2016-12-27 17:12:49 +00:00
Károly Balogh
8760ff96e1 atari: new pascal startup code, reworked build, also ParamStr/ParamCount works now
git-svn-id: trunk@35201 -
2016-12-27 08:14:34 +00:00
svenbarth
150441627a + add test for Boolean RTTI
git-svn-id: trunk@35187 -
2016-12-23 16:05:57 +00:00
marcus
3f4e9cfcb7 Ami-Extra: example code for muihelper
git-svn-id: trunk@35165 -
2016-12-18 15:17:02 +00:00
marcus
b93a685ab8 Amiga: moved muihelper to ami-extra, added more macros, 64bit ready
git-svn-id: trunk@35163 -
2016-12-18 14:11:38 +00:00
svenbarth
d34acf3bc7 * fix for Mantis #31120: check current_genericdef only if the current_procinfo isn't used
+ added test

Note: the test is added to webtbs although it's right now still failing, cause I'll remove the restriction for nested procedures since the compiler now supports them correctly. Due to the way we handle generics we don't have problems with them unlike Delphi.

git-svn-id: trunk@35147 -
2016-12-17 21:20:44 +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
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
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
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
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
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
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
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
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
michael
4406ec7e68 * Forgot to add subsetter font
git-svn-id: trunk@35084 -
2016-12-09 13:22:48 +00:00
michael
b7083402cf * Fix from Graeme adding Font subset embedding and underline/strikethrough
git-svn-id: trunk@35083 -
2016-12-09 12:51:06 +00:00
svenbarth
d499163ef5 * provisional fix for Mantis #31076: fail gracefully instead of with an internal error if a generic method is declared inside a generic class or record. This will change once we support nested generics however.
* adjusted error message to reflect that we're not only dealing with generic classes
+ added test; note: it's added in webtbs, cause the test will loose its %FAIL attribute in the future

git-svn-id: trunk@35079 -
2016-12-06 22:26:53 +00:00
svenbarth
70817baf98 * since we already allow inline specializations in mode ObjFPC due to generic functions it's only consequential to also allow specializations after pointers (they are already allowed in mode Delphi).
+ added tests
* tgeneric87.pp and tgeneric88.pp are no longer considered as tests that should fail

git-svn-id: trunk@35078 -
2016-12-06 21:37:22 +00:00
Károly Balogh
eb6fe91208 amiga: proof-of-concept untested implementation for OS4/PowerPC Pascal startup code
git-svn-id: trunk@35076 -
2016-12-05 21:12:23 +00:00
Károly Balogh
b356b18675 amiga: forgot to commit the actual buildrtl.pp in the previous commit
git-svn-id: trunk@35069 -
2016-12-04 18:37:47 +00:00
Károly Balogh
788c622307 amiga: pascal startup code for 68k and buildrtl refactor
git-svn-id: trunk@35068 -
2016-12-04 18:21:24 +00:00
Károly Balogh
f3e33a9dde morphos: new pascal-written internal startup code. also refactored the rtl build process for morphos
git-svn-id: trunk@35054 -
2016-12-04 00:15:41 +00:00
svenbarth
4fb77b71ec * fix for Mantis #31029, based on the patch provided by Silvio Clécio: PArrayOfByte is not necessary and in fact the purpose of TArrayOfByte is a different one from reference counting (namely to ensure correct passing of the parameter), so renamed accordingly (plus a comment); similar change in SetDynArrayProp. Also Get-/SetPropValue in Variants unit has been adjusted to make use of Get-/SetDynArrayProp.
+ added adjusted test

git-svn-id: trunk@35025 -
2016-11-30 19:32:41 +00:00
svenbarth
d9ea6aae4d * fix for Mantis #30761: always return the symbol found in the helper instead of doing this dependant on the presence of the overload attribute; for this the collection of all suitable overloads is done in tcallcandidates instead.
+ added test

git-svn-id: trunk@35024 -
2016-11-30 17:52:25 +00:00
svenbarth
6ba85c2a70 * second fix for Mantis #30626: also search in parent classes for a suitable pre-existing specialization
+ added test

git-svn-id: trunk@35014 -
2016-11-29 17:04:07 +00:00
svenbarth
ebfeb5b62a * fix for Mantis #30830: also remove unregistered specializations from the procsym's deflist when they're removed to avoid an access to freed data
+ added tests (adjusted original test plus a mode Delphi variant)

git-svn-id: trunk@35012 -
2016-11-29 14:12:02 +00:00
svenbarth
bfaa26d16a Commit r35010 also fixed Mantis #30524.
+ added tests

git-svn-id: trunk@35011 -
2016-11-28 18:37:20 +00:00
svenbarth
a535d54bcb * fix for Mantis #30939: Rework generation of the generic name to be less relying on the type hierarchy as a specialization inside the parameter declaration would want to have the full name of the procdef including its parameters, but those are still parsed at that stage (the pretty name is still a topic onto itself however...)
+ added tests (original test was only mode fpc, test for mode delphi is added as well)

git-svn-id: trunk@35010 -
2016-11-28 18:16:49 +00:00
svenbarth
3f77ce3b12 * leave parse_proc_head() (with some error recovery) if the interface could not be found instead of running straight into an access violation
+ added test

git-svn-id: trunk@35007 -
2016-11-28 17:54:48 +00:00
florian
7bb8873c83 * do not throw an internal error if in case of an previous error the parameter class of an errordef is requested, resolves #31016
git-svn-id: trunk@34984 -
2016-11-27 13:16:12 +00:00
florian
48fbd569fd * support for the CDQE instruction, by Emelyanov Roman, resolves #30978
git-svn-id: trunk@34982 -
2016-11-27 12:42:22 +00:00
florian
da7e1b3769 + tavraddrnode.pass_generate_code, avoiding unneeded moves
git-svn-id: trunk@34973 -
2016-11-26 19:31:33 +00:00
sergei
133fcb5ab2 * Fixed VMOVQ instruction encoding, now assembles correctly also in 32-bit code.
+ Test

git-svn-id: trunk@34949 -
2016-11-21 13:59:44 +00:00
Jonas Maebe
48ef33a8b3 * fixed interprocedural gotos for llvm
o ensure that the label's local "jumpbuf" variable gets moved to the
     parentfpstruct soon enough
   o don't generate global symbols for interprocedural labels: they're not
     necessary if they are only used via setjmp/longjmp (all references are
     local in that case), and if they are referenced via an assembler block
     then we'll have to handle them by passing a blockaddress() expression
     as parameter to that assembler block (which does not require a global
     symbol, but which is not yet implemented)

git-svn-id: trunk@34946 -
2016-11-21 07:39:13 +00:00
sergei
ebe134febc * Fixed memory reference size for MOVSS instruction, Mantis #29954.
git-svn-id: trunk@34943 -
2016-11-21 03:31:25 +00:00
Jonas Maebe
a89a4d905f + test for already fixed mantis #30948
git-svn-id: trunk@34928 -
2016-11-20 11:44:25 +00:00
florian
10132bfafa * removed accidently committed file
git-svn-id: trunk@34927 -
2016-11-20 11:26:48 +00:00
sergei
edf943a4f6 * Changed memory operand size for VMOVSS instruction to 32 bits, Mantis #29957.
git-svn-id: trunk@34918 -
2016-11-18 23:37:01 +00:00
florian
56252d59f0 + support for the PREFETCHTW1 instruction based on a patch by Emelyanov Roman, resolves #30933
git-svn-id: trunk@34917 -
2016-11-18 20:19:39 +00:00
svenbarth
63b0024e4c * fix for Mantis #30626: unset current_procinfo so that further specializations don't use a symtable to specialize themselves in that they shouldn't use (cause current_procinfo takes precedence)
git-svn-id: trunk@34916 -
2016-11-18 16:17:09 +00:00
svenbarth
0e7a9ad375 * partial fix for Mantis #30831 (partial, because no exception has been encountered yet): when checking whether the left node of a vmtaddrnode is a generic, don't rely on df_generic, but instead use is_generic which checks for a true generic (the other will also be true if it's merely a structured type declared (or specialized) inside another generic)
+ added test

git-svn-id: trunk@34915 -
2016-11-18 14:43:45 +00:00
svenbarth
fc5ce63134 * fix for Mantis #30832: instead of checking a procdef's struct for df_generic check the procdef itself, this way global generic methods or generic methods that are part of non-generic classes or records are caught as well.
+ added test

git-svn-id: trunk@34914 -
2016-11-18 14:01:03 +00:00
florian
67570a6262 + patch to support assigning class procedures to procedure variables by Ondrej Pokorny, resolves #30936
+ additional tests

git-svn-id: trunk@34909 -
2016-11-17 19:40:42 +00:00
florian
3f072b3e29 * workaround for issue #30348, FPC allowes now 65535 sections in coff object files, but as the section index is normally signed, this is only a dirty workaround
git-svn-id: trunk@34904 -
2016-11-15 22:06:00 +00:00
sergei
b4904deea8 * MIPS: Fixed code generation for PIC global symbols with large offset, resolves #30552.
git-svn-id: trunk@34902 -
2016-11-15 20:04:27 +00:00