Commit Graph

748 Commits

Author SHA1 Message Date
pierre
1b4fb37948 Merge commit r42337, to fix avr-embedded packages compilation
------------------------------------------------------------------------
r42337 | laksen | 2019-07-07 14:37:45 +0000 (Sun, 07 Jul 2019) | 1 line

- Fix result type of SizeOf and BitSizeOf to use sizesint instead of sint.
------------------------------------------------------------------------
--- Merging r42337 into '.':
U    compiler/ninl.pas
U    compiler/pexpr.pas
--- Recording mergeinfo for merge of r42337 into '.':
 U   .

git-svn-id: branches/fixes_3_2@43514 -
2019-11-19 22:28:04 +00:00
marco
d24f4b0926 --- Merging r42998 into '.':
U    compiler/blockutl.pas
U    compiler/jvm/njvmutil.pas
U    compiler/jvm/pjvm.pas
U    compiler/ncal.pas
U    compiler/ninl.pas
U    compiler/pdecl.pas
U    compiler/pdecsub.pas
U    compiler/pdecvar.pas
U    compiler/pexpr.pas
U    compiler/pgenutil.pas
U    compiler/pmodules.pas
U    compiler/pparautl.pas
U    compiler/pstatmnt.pas
U    compiler/psub.pas
U    compiler/psystem.pas
U    compiler/ptype.pas
U    compiler/symcreat.pas
U    compiler/symdef.pas
U    compiler/symsym.pas
U    compiler/symutil.pas
--- Recording mergeinfo for merge of r42998 into '.':
 U   .
--- Merging r43116 into '.':
G    compiler/symsym.pas
A    tests/webtbf/tw36114.pp
--- Recording mergeinfo for merge of r43116 into '.':
 G   .

# revisions: 42998,43116

git-svn-id: branches/fixes_3_2@43442 -
2019-11-10 16:12:48 +00:00
marco
89e051bac9 # revisions: 41828,41830,41831,41832,41833,41834,41835,41836,41837,41838,41839,41841,41842,42025,42031,42032,42033,42034,42035,42036,42065,42066,42067,42068,42069,42070,42071,42072,42073,42089,42150,42151,42181,42182,42183,42184,42185,42219,42220,42221,42222
git-svn-id: branches/fixes_3_2@43400 -
2019-11-05 16:17:53 +00:00
Jonas Maebe
846da37c9f --- Merging r41243 into '.':
U    rtl/inc/objc.pp
--- Recording mergeinfo for merge of r41243 into '.':
 U   .
--- Merging r41335 into '.':
U    compiler/arm/cgcpu.pas
U    compiler/cgobj.pas
--- Recording mergeinfo for merge of r41335 into '.':
 G   .
--- Merging r41422 into '.':
U    compiler/scanner.pas
--- Recording mergeinfo for merge of r41422 into '.':
 G   .
--- Merging r41474 into '.':
U    compiler/pexpr.pas
A    tests/webtbf/tw35149a.pp
A    tests/webtbs/tw35149.pp
--- Recording mergeinfo for merge of r41474 into '.':
 G   .
--- Merging r41650 into '.':
U    compiler/aarch64/racpugas.pas
--- Recording mergeinfo for merge of r41650 into '.':
 G   .
--- Merging r41651 into '.':
U    tests/test/taarch64abi.pp
--- Recording mergeinfo for merge of r41651 into '.':
 G   .
--- Merging r41905 into '.':
U    compiler/utils/ppuutils/ppudump.pp
--- Recording mergeinfo for merge of r41905 into '.':
 G   .

git-svn-id: branches/fixes_3_2@41943 -
2019-04-27 19:21:30 +00:00
Jonas Maebe
3ac703506c * rest of the previous accidental partial commit
git-svn-id: branches/fixes_3_2@41250 -
2019-02-07 19:56:21 +00:00
marco
338873d7a7 --- Merging r39785 into '.':
U    packages/fcl-stl/src/gset.pp
--- Recording mergeinfo for merge of r39785 into '.':
 U   .
--- Merging r39786 into '.':
A    tests/tbs/tb0651.pp
U    compiler/symdef.pas
--- Recording mergeinfo for merge of r39786 into '.':
 G   .
--- Merging r39787 into '.':
U    compiler/pexpr.pas
A    tests/webtbs/uw34287a.pp
A    tests/webtbs/tw34287.pp
A    tests/webtbs/uw34287b.pp
--- Recording mergeinfo for merge of r39787 into '.':
 G   .
--- Merging r39788 into '.':
U    compiler/nbas.pas
--- Recording mergeinfo for merge of r39788 into '.':
 G   .
--- Merging r39812 into '.':
G    compiler/pexpr.pas
--- Recording mergeinfo for merge of r39812 into '.':
 G   .

# revisions: 39785,39786,39787,39788,39812

git-svn-id: branches/fixes_3_2@39835 -
2018-09-27 13:01:08 +00:00
svenbarth
0aee319fdb * do_member_read() takes ownership of the specialization context, so Nil it after the call
git-svn-id: trunk@39559 -
2018-08-03 20:24:10 +00:00
florian
93c5eae528 * accept dereferences in generics definitions, resolves #33700 properly
git-svn-id: trunk@39447 -
2018-07-13 21:00:33 +00:00
svenbarth
441fc2fab6 * also parse postfix operators after parsing a _STRING token (required for class functions on type helpers for String)
+ added tests

git-svn-id: trunk@39399 -
2018-07-06 15:57:11 +00:00
nickysn
e813a11e85 + support TP7-compatible @proc^ (as in FillChar(@proc^,...))
git-svn-id: trunk@39343 -
2018-06-29 14:16:35 +00:00
nickysn
88d9dd23ae * the 'again' parameter of factor_read_id() changed to 'out' instead of 'var'
git-svn-id: trunk@39317 -
2018-06-27 15:59:40 +00:00
svenbarth
22a5e5e4ee * the symbol parsed for "specialize" does not need to be a type; it could be a procsym or some other type (e.g. a constant of the same name in a third unit)
git-svn-id: trunk@39233 -
2018-06-15 13:49:26 +00:00
svenbarth
e7f29e9e28 * also pass the pattern with which the potential unit/namespace symbol had been found to try_consume_unitsym*()
git-svn-id: trunk@38913 -
2018-05-05 17:18:31 +00:00
nickysn
3318703ece * moved nf_typedaddr to addrnodeflags (anf_typedaddr)
git-svn-id: trunk@38671 -
2018-04-03 16:41:01 +00:00
nickysn
213e61eae5 + introduce the anf_ofs address node flag - indicates that the node was
generated by ofs()

git-svn-id: trunk@38670 -
2018-04-03 15:28:27 +00:00
Jonas Maebe
2919d97f91 * support asssigning @class.classmethod to a procvar of object in FPC modes
(mantis #14103)

git-svn-id: trunk@37925 -
2018-01-06 17:47:44 +00:00
nickysn
78e0f6c68b + added an i8086-specific FarAddr() function, similar to Addr(), but always
returns a far pointer, regardless of the current memory model

git-svn-id: trunk@37628 -
2017-11-27 16:41:48 +00:00
svenbarth
f6a867ef04 * move handling of Concat to tinlinenode so that it can be easily extended for dynamic arrays
+ added test

git-svn-id: trunk@37429 -
2017-10-08 10:39:34 +00:00
svenbarth
83f5b27e02 * check helpertype instead of the extendeddef to judge whether inherited should be allowed or not
git-svn-id: trunk@37224 -
2017-09-15 20:52:42 +00:00
svenbarth
6acba684d4 * class helpers: fix calling virtual methods of the extended type using inherited
git-svn-id: trunk@37060 -
2017-08-25 19:36:56 +00:00
svenbarth
0b02dab684 + new Delphi-compatible intrinsic GetTypeKind() which returns the TTypeKind of a type as a constant value (and thus can be optimized away in If- and Case-statements)
+ added test

git-svn-id: trunk@36875 -
2017-08-11 22:12:53 +00:00
svenbarth
eb9b4fb71f * fix for Mantis #31973: resolve dummy symbols earlier and print a nice error message if a generic dummy could not be resolved to an ordinary symbol
+ added test
* adjusted test tw9673 which should have never worked as is (what if TList would have been "of T" instead of "of byte"?)

git-svn-id: trunk@36468 -
2017-06-09 14:41:26 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
svenbarth
1aa80f77cb - remove no longer needed global variable allow_array_constructor
git-svn-id: trunk@36103 -
2017-05-04 21:58:14 +00:00
svenbarth
6d512ddac7 * allow nested array constructors inside normal code blocks (body & except)
git-svn-id: trunk@36102 -
2017-05-04 21:56:33 +00:00
svenbarth
82b2d22ed6 * keep track of allow_array_constructor as part of the array constructor node
git-svn-id: trunk@36099 -
2017-05-04 21:52:21 +00:00
maciej-izak
16a11c8b7a Bug fix for getting pointer to function result (mantis #10933 #19861)
git-svn-id: trunk@35495 -
2017-03-01 13:23:02 +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
florian
2b6ccb3565 * better error recovery
git-svn-id: trunk@34923 -
2016-11-19 22:00:00 +00:00
svenbarth
531829c072 * don't check for hints if we have a specialization with the same name as the to be used generic (though since the typedef would be errordef it wouldn't print anything anyway...)
git-svn-id: trunk@34531 -
2016-09-16 15:15:19 +00:00
svenbarth
50f2aab0ef * fix for Mantis #22192: handle the case that a specialization has the same name as the generic it's based on as in that case the typedef of the symbol is an errordef; therefor we need to use the symbol's real name
+ added test

git-svn-id: trunk@34530 -
2016-09-16 15:13:27 +00:00
svenbarth
7dd0130ac2 * generate_specialization_phase2() might also return an errordef, so check for that instead of simply using the symbol; fixes access violations of tgenconstraint{38,39,40}.pp
git-svn-id: trunk@34460 -
2016-09-08 18:34:30 +00:00
svenbarth
aaceb5518f * fix Mantis #30494 by applying patch from Maciej Izak
+ added test

git-svn-id: trunk@34381 -
2016-08-26 14:23:23 +00:00
nickysn
c2305809dc + added an i8086-embedded target support to the compiler (RTL and makefile
support are not done yet)

git-svn-id: trunk@33999 -
2016-06-17 19:15:24 +00:00
svenbarth
a2c9c75e97 Convert Insert() and Delete() to intrinsics in preparation for dynamic array support for these two procedures.
Since overloading compilerprocs does not work each procedure got its own unique name, but they are using the new compilerproc extension to map them to the Insert and Delete symbol so that error messages can be shown with the respective name for the procedure declarations instead of fpc_shortstr_delete for example.

git-svn-id: trunk@33895 -
2016-06-03 21:25:49 +00:00
svenbarth
04adcf2a12 Fix for Mantis #30179 and #30203.
pexpr.pas:
  * handle_factor_typenode: rework code for records and objects so that Delphi style specializations are handled as well
  * sub_expr.generate_inline_specialization: also do a typecheck pass on pload to be sure that we have a resultdef

+ added tests

git-svn-id: trunk@33876 -
2016-06-01 20:06:40 +00:00
svenbarth
c3c345d569 Fix for Mantis #30202.
pexpr.pas, sub_expr.generate_inline_specialization:
  * do_member_read() needs to happen independently of whether we're calling a method of the same object (was incorrectly copypasted code... :/ )

+ added test

git-svn-id: trunk@33875 -
2016-06-01 20:03:59 +00:00
Jonas Maebe
712e4f90d6 - removed (unnecessary) use of ctemprefnode.create_offset() while parsing
array constructors

git-svn-id: trunk@33732 -
2016-05-21 10:28:25 +00:00
Jonas Maebe
661be0baad * replaced ctemprefnode.create_offset() usage in variant array indexing
operations

git-svn-id: trunk@33731 -
2016-05-21 10:28:22 +00:00
Jonas Maebe
a0296d7311 * fixed indentation
git-svn-id: trunk@33192 -
2016-03-06 14:44:17 +00:00
svenbarth
94c0938edd Reverted accidentally committed inline if-then-else expression (committed in r33048 when I reverted the IfThen()... -.- )
git-svn-id: trunk@33111 -
2016-02-19 21:51:56 +00:00
svenbarth
25744dd3f1 Fix for Mantis #29609.
pexpr.pas, factor.factor_read_id:
  * don't use a cloadvmtaddrnode for accessing class properties in records

+ added test

git-svn-id: trunk@33110 -
2016-02-19 21:37:02 +00:00
svenbarth
8287773b16 Reverted revision 33036. This feature is too controverse to be left in.
git-svn-id: trunk@33048 -
2016-02-04 19:26:51 +00:00
svenbarth
ed94ca4b24 Add support for IfThen() instrinsic that works like the if-statement in that it evaluates only the expression that is indeed executed.
The result type of the intrinsic is determined by the Then-expression to provide a bit of control. There might however be some situations in which this fails, for this exceptions need to be added (e.g. a constant string needs to be converted to a normal string).

compinnr.inc:
  + add new constant in_ifthen_x_y_z for the IfThen() intrinsic
psystem.pas: 
  + create_intern_symbols: add symbol for IfThen() intrinsic
pexpr.pas:
  * statement_syssym: parse parameters of IfThen() intrinsic and return corresponding inline node
ninl.pas, tinlinenode:
  + new method handle_ifthen() which converts the inline node to an if-node which assigns the expressions to a temp node that is returned
  * pass_typecheck: handle in_ifthen_x_y_z using handle_ifthen()
  * pass_1: in_ifthen_x_y_z does not need a first pass as it's already converted after the typecheck pass

+ added tests

git-svn-id: trunk@33036 -
2016-01-31 14:29:12 +00:00
svenbarth
61b12af82b Fix for Mantis #29321.
pexpr.pas, postfixoperators:
  * also handle type helpers for static arrays

+ added test

git-svn-id: trunk@32845 -
2016-01-04 22:02:24 +00:00
Jonas Maebe
9ea38f4577 * support static fields in nested types in records, by always including
support for nested types when generating an access to a static fied;
    we also always do that when generating the mangled name of a static
    field declaration in symcreat.make_field_static() (mantis #29030)

git-svn-id: trunk@32517 -
2015-11-24 16:04:19 +00:00
svenbarth
b2988ad8c0 pexpr.pas, sub_expr:
* generate_inline_specialization: fix Delphi-style inline specializations of generic methods

git-svn-id: trunk@32438 -
2015-11-21 15:59:11 +00:00
florian
1142fdeccd * initialize variables to avoid warnings
git-svn-id: trunk@32428 -
2015-11-21 14:14:30 +00:00
svenbarth
89d37c1e69 pgentype.pas:
+ new constant inline_specialization_block_types to easily keep track of block types in which inline specialization is allowed
pexpr.pas:
  * use new inline_specializatio_block_types instead of a inline constant set

git-svn-id: trunk@32388 -
2015-11-21 11:05:58 +00:00