Commit Graph

49922 Commits

Author SHA1 Message Date
Jonas Maebe
6a1c4f9b75 * replaced cg.a_label/a_jmp_always with hlcg.* calls (only for consistency,
does not change anything in practice)

git-svn-id: trunk@35157 -
2016-12-18 13:57:29 +00:00
Jonas Maebe
3ae1f6664a * extracted exception state handling helpers into a utility class so
they can be overridden

git-svn-id: trunk@35156 -
2016-12-18 13:57:25 +00:00
Jonas Maebe
7503c2bd3e * changed llvmgettemprecorddef() to take an open array instead of a tfplist
as list of defs to be stored in the record, so we don't need to create and
    free a class instance every time we call this routine

git-svn-id: trunk@35155 -
2016-12-18 13:57:22 +00:00
Jonas Maebe
5850963ea9 - removed double compilation commands for two units
git-svn-id: trunk@35154 -
2016-12-18 13:57:19 +00:00
Jonas Maebe
d8c4980b2e * don't reuse the same type with the typed const builder for
differently-sized types

git-svn-id: trunk@35153 -
2016-12-18 13:57:15 +00:00
Jonas Maebe
691c2d655e * put multiple statements of the else-part of case between begin..end
git-svn-id: trunk@35152 -
2016-12-18 13:57:12 +00:00
Jonas Maebe
fe6b662c37 * fixed range error
git-svn-id: trunk@35151 -
2016-12-18 13:57:09 +00:00
Jonas Maebe
bcb7fedb3c * fixed indentation
git-svn-id: trunk@35150 -
2016-12-18 13:57:06 +00:00
nickysn
ca46040728 + added 16-bit versions of the InterLocked* functions for i8086
git-svn-id: trunk@35149 -
2016-12-18 00:17:10 +00:00
svenbarth
109dff8b56 * allow nested procedures and functions in generic routines (and get rid of an untranslated error message :P )
git-svn-id: trunk@35148 -
2016-12-17 21:23:07 +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
779799c406 * only record tokens for real generic routines or those that belong to a generic class/record
* don't parse a semicolon at the end for real specializations or specializations of methods that belong to a specialized class/record 

git-svn-id: trunk@35146 -
2016-12-17 21:13:30 +00:00
svenbarth
a76fd967b2 * inherit df_generic and df_specialization from the parent routine and correctly set the genericdef for a specialization
git-svn-id: trunk@35145 -
2016-12-17 21:10:58 +00:00
Jonas Maebe
c0f4e4db34 * group emitting a label of a try-block and restoring the control flow flags
in a single routine, so that both happen at the same time (needed for LLVM
    where inside a try-block all calls need to be performed using "invoke"
    and refer to the current try-block/catching label)

git-svn-id: trunk@35144 -
2016-12-16 22:41:30 +00:00
Jonas Maebe
a1c0d1a1ff * moved exception handling helpers from ncgutil to ncgflw as they are only
used there (could be turned into protected methods if they are ever needed
    by child classes)

git-svn-id: trunk@35143 -
2016-12-16 22:41:28 +00:00
Jonas Maebe
b75a07b713 * clarified comment for fc_unwind_*
git-svn-id: trunk@35142 -
2016-12-16 22:41:24 +00:00
Jonas Maebe
880d438704 * renamed t<cpuname>procinfo to tcpuprocinfo for all targets, so we can
inherit from it for LLVM without a thousand ifdefs

git-svn-id: trunk@35141 -
2016-12-16 22:41:21 +00:00
Jonas Maebe
e35f83ba94 * support building the LLVM compiler for Darwin/x86_64 and Linux/x86_64 by
specifyng LLVM=1 to make (does not yet work for the top-level makefile
    on Linux because of the fpmake-based building of the IDE)

git-svn-id: trunk@35140 -
2016-12-16 22:41:17 +00:00
Jonas Maebe
d6ccd54da5 - removed unused doexceptlabel
git-svn-id: trunk@35139 -
2016-12-16 22:38:07 +00:00
Jonas Maebe
5bd03651a9 * clarify/ensure intended order of evaluation
git-svn-id: trunk@35138 -
2016-12-16 22:38:04 +00:00
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