Commit Graph

56438 Commits

Author SHA1 Message Date
svenbarth
f9cda608fa * take a copy of the constructor assignment node (and free it together with the attribute)
git-svn-id: trunk@42388 -
2019-07-12 22:06:57 +00:00
svenbarth
d31dd4ac7b * better check for a valid call node
git-svn-id: trunk@42387 -
2019-07-12 22:06:52 +00:00
svenbarth
8cd1f1973b - remove unneeded local variable
git-svn-id: trunk@42386 -
2019-07-12 22:06:48 +00:00
svenbarth
affa9f9d9c * to be on the safe side: don't include AttributeTable fields when cycling
git-svn-id: trunk@42385 -
2019-07-12 22:06:44 +00:00
svenbarth
99914b4279 * instead of collecting the raw parameters we need to collect the parameters as passed to the call as there might be type conversions involved
git-svn-id: trunk@42384 -
2019-07-12 22:06:41 +00:00
svenbarth
b5e6c0b98d * ensure that any potentially created constructor call is freed if the attribute is not bound to a def or sym
git-svn-id: trunk@42383 -
2019-07-12 22:06:38 +00:00
svenbarth
0e04d9b4de * store the parameter nodes in the attribute object as well (we need to write them to the RTTI as well as store them in the PPU)
git-svn-id: trunk@42382 -
2019-07-12 22:06:34 +00:00
svenbarth
3a20178d96 * fix code formatting (no code changes)
git-svn-id: trunk@42381 -
2019-07-12 22:06:31 +00:00
svenbarth
c214648224 + add a test for overloaded attribute constructors
git-svn-id: trunk@42380 -
2019-07-12 22:06:28 +00:00
svenbarth
db37146f12 * rework code for parsing attributes to only allow constant expressions; Delphi only allows those as well and better we don't open *that* pandora's box just yet
git-svn-id: trunk@42379 -
2019-07-12 22:06:24 +00:00
svenbarth
ab2fa724ec * fix code formatting (no code changes)
git-svn-id: trunk@42378 -
2019-07-12 22:06:20 +00:00
svenbarth
62c137a6d8 * check that we indeed have a type node and nothing else
* with a type node it's not necessary to check whether it's typedef is assigned

git-svn-id: trunk@42377 -
2019-07-12 22:06:16 +00:00
svenbarth
f1715ff337 * fix code formatting (no code changes)
git-svn-id: trunk@42376 -
2019-07-12 22:06:13 +00:00
svenbarth
3ad24c9db8 * as attributes can be part of any type they are best suited in a common part of TTypeData
git-svn-id: trunk@42375 -
2019-07-12 22:06:09 +00:00
svenbarth
a1b556d211 * considering that at least in theory every symbol and every def can carry RTTI attributes (Delphi only supports property and field symbols), move the rtti_attribute_list to tstoredsym/tstoreddef
git-svn-id: trunk@42374 -
2019-07-12 22:06:05 +00:00
svenbarth
de15025a47 * streamline retrieval of attributes (both in TypInfo and RTTI units)
git-svn-id: trunk@42373 -
2019-07-12 22:06:02 +00:00
svenbarth
5532ac3355 * fix test
git-svn-id: trunk@42372 -
2019-07-12 22:05:58 +00:00
svenbarth
e060a43d70 * rename TAttributeData to the more appropriate TAttributeTable
git-svn-id: trunk@42371 -
2019-07-12 22:05:55 +00:00
svenbarth
c17dafc2f9 * fix TClassData by including the AttributeTable at the right location
git-svn-id: trunk@42370 -
2019-07-12 22:05:51 +00:00
svenbarth
e296b26e9e - remove unit info and related code again as that will be handled similar, but differently with dynamic packages
git-svn-id: trunk@42369 -
2019-07-12 22:05:47 +00:00
svenbarth
ee940c8270 * always write a class' reference to the attribute table, even if the unit does not have attributes
git-svn-id: trunk@42368 -
2019-07-12 22:05:42 +00:00
svenbarth
788d976f3a * use a Word instead of a Byte for the attribute index (after all the compiler writes a Word to the count field)
git-svn-id: trunk@42367 -
2019-07-12 22:05:39 +00:00
svenbarth
5153a288dc * it's more correct for GetPropAttribute to return a TCustomAttribute instead of a TObject
git-svn-id: trunk@42366 -
2019-07-12 22:05:33 +00:00
svenbarth
d137e06ade * instead of embedding the attributes inside the class' and property's type data only store a reference to a table of attributes
git-svn-id: trunk@42365 -
2019-07-12 22:05:29 +00:00
svenbarth
38fad4b5cf * also check for invalid attribute data in tests
git-svn-id: trunk@42364 -
2019-07-12 22:05:25 +00:00
svenbarth
ba413bcdfc * fix typo
git-svn-id: trunk@42363 -
2019-07-12 22:05:21 +00:00
svenbarth
24c4b90343 * instead of declaring another type with a 'attribute' suffix, *search* for another type with a 'ATTRIBUTE' suffix (Delphi allows declaring both a TFoo and TFooAttribute in the same unit)
+ added test

git-svn-id: trunk@42362 -
2019-07-12 22:05:18 +00:00
svenbarth
869664c6da * rename custom attributes related tests to something more sensible
git-svn-id: trunk@42361 -
2019-07-12 22:05:12 +00:00
svenbarth
ed5f19e7e3 * change boolean parameters for try_consume_unitsym to a set
git-svn-id: trunk@42360 -
2019-07-12 22:05:05 +00:00
svenbarth
39bab2dbcc * rename trtti_attributesdef to trtti_attributes_list
git-svn-id: trunk@42359 -
2019-07-12 22:05:00 +00:00
svenbarth
84848df18d Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 3/3]
Added FPC_REQUIRES_PROPER_ALIGNMENT to TUnitInfo definition. Added FPC_HAS_EXTENDED_RTTI define.

git-svn-id: trunk@42358 -
2019-07-12 22:04:56 +00:00
svenbarth
f91e38d1bd Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 2/3]
Regenerated compiler/msgidx.inc and compiler/msgtxt.inc.

git-svn-id: trunk@42357 -
2019-07-12 22:04:53 +00:00
svenbarth
b2932393df Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 1/3]
Implemented attributes for class types and properties (based on work by Joost van der Sluis). Added TCustomAttribute - a base class for attributes. Added TUnitInfo record to RTTI. It contains the unit name and unit options (for now only a flag which specifies if the unit contains attributes). Added several tests for attributes.

git-svn-id: trunk@42356 -
2019-07-12 22:04:48 +00:00
Mattias Gaertner
28e07f77e4 pastojs: fixed createcallback inside anonymous method
git-svn-id: trunk@42355 -
2019-07-12 16:56:35 +00:00
svenbarth
2a7b750d70 * write a name for the none property access entry (looks nicer than a "(Nil)" at the start of the line)
git-svn-id: trunk@42354 -
2019-07-12 16:25:36 +00:00
svenbarth
54c4fb2a00 * write an entry name for the property options
git-svn-id: trunk@42353 -
2019-07-12 16:25:33 +00:00
svenbarth
1607e15e48 * ensure that the toString constant is used instead of TObject's ToString method
git-svn-id: trunk@42352 -
2019-07-12 16:25:30 +00:00
michael
a516b6fd74 * Fix bug ID #0035817
git-svn-id: trunk@42351 -
2019-07-11 20:33:39 +00:00
michael
fde8697032 * Always try to show the field name when possible
git-svn-id: trunk@42350 -
2019-07-11 20:17:29 +00:00
michael
0fb74a0f57 * Always try to show the field name when possible
git-svn-id: trunk@42349 -
2019-07-11 20:16:35 +00:00
Mattias Gaertner
3d662b5e5c fcl-passrc: fixed helper in other unit
git-svn-id: trunk@42348 -
2019-07-10 08:28:11 +00:00
Mattias Gaertner
e5214b94a5 fcl-passrc: fixed parsing class var a:t;b:t
git-svn-id: trunk@42347 -
2019-07-10 07:55:28 +00:00
nickysn
0a94f8fc08 + parse the IMPDEF record in TOmfObjInput.ReadImpDef
git-svn-id: trunk@42346 -
2019-07-09 12:31:11 +00:00
michael
ebd005d1a7 * Fix bug ID #35796, codepage issue when getting string as variant
git-svn-id: trunk@42344 -
2019-07-08 10:27:11 +00:00
michael
2425b97462 * Patch from Maciej Izak to allow loading multiple times
git-svn-id: trunk@42343 -
2019-07-08 10:24:00 +00:00
Jonas Maebe
7f772683cb * fix tobjectdef.vmt_def to search in the correct symtable
* always register vmt defs (so they get written to the ppu) in case of llvm,
    because it may need this def in case a method from a class defined in the
    implementation of unit gets called from an inlined routine that gets
    inlined in another unit (normally that vmt def would not get written to
    the ppu file, as it can't be referenced from the interface and it's also
    not necessarily directly referenced from the inline routine's nodes)
    (fixes sdo_dataobject compilation with LLVM after enabling cross-unit
     inlining of methods accessing static symbol table symbols)

git-svn-id: trunk@42342 -
2019-07-07 21:33:51 +00:00
Jonas Maebe
e56b58c2b0 * factored out checks whether a procdef's symbol needs to be global, and
the generation of the procdef's asmsymbols
   o also removed unnecessary definition of procdef alias symbols for Darwin
     (they are already defined in ncgutil.alloc_proc_symbol)

git-svn-id: trunk@42341 -
2019-07-07 21:33:47 +00:00
Jonas Maebe
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +00:00
Jonas Maebe
449a14dddf - disabled ogmacho, as it can no longer deal with the assembly we generate
git-svn-id: trunk@42339 -
2019-07-07 21:33:39 +00:00
Jonas Maebe
0f57327bff * maybereplacewithtemp/maybereplacewithtempref: also create a temp in case
of possible side effects

git-svn-id: trunk@42338 -
2019-07-07 21:33:36 +00:00