Commit Graph

504 Commits

Author SHA1 Message Date
pierre
6230de31bb * Second patch xml-node-dump-defs.patch from J. Gareth Moreton from bug report 36882.
With same changes to ensure that xmllint find no errors in generated xml files.

git-svn-id: trunk@47667 -
2020-12-02 21:01:40 +00:00
Jonas Maebe
1c61c30cd2 * added "const" to some string parameters
git-svn-id: trunk@47299 -
2020-11-03 21:34:15 +00:00
Jonas Maebe
cc315e0ac7 * fix tw3930 after r37927
o "unique" class (and interface) type aliases should actually not exist at
     all except for overload resolution. All the rest (VMT, UUID, RTTI, ...)
     should be taken from the aliased class/interface
   o there is one Delphi-incompatibily left after this change, but it shouldn't
     matter: tw8180 does not compile if you change the declaration to
     "tcl=class(TInterfacedObject,XStr,iinterface)", while Kylix does compile
     that. It doesn't really matter though, because in Kylix this actually
     adds iinterface twice as implemented interface, so there is no point
     in accepting this.

git-svn-id: trunk@46773 -
2020-09-05 12:25:09 +00:00
florian
6dac888ae5 * 0 is a valid label in iso mode, resolves #37428
git-svn-id: trunk@46362 -
2020-08-11 12:05:13 +00:00
florian
f6f5cb45a3 + strip leading zeros in numeric labels in iso/extended pascal mode also in label declarations, resolves #37323
git-svn-id: trunk@45764 -
2020-07-11 07:12:37 +00:00
svenbarth
60345366f2 * fix for Mantis #35140: apply patch by Ryan Joseph together with some further changes by me to add support for constant parameters in generics
+ added tests

git-svn-id: trunk@45080 -
2020-04-25 22:12:35 +00:00
florian
c146aecc01 * throw an error if the forward interface type and the actual interface type do not match, resolves #36720
git-svn-id: trunk@44230 -
2020-02-21 20:35:27 +00:00
pierre
d1e4066477 Hopefully fix problems related to loading of ppufile generated with other endianess for generics
git-svn-id: trunk@44056 -
2020-01-28 23:43:56 +00:00
svenbarth
8111e92e1f * rework syntax for cblocks: now a cblock directive is required
* additionally implicit calling conventions of cdecl or mwpascal now work as well
* adjusted tests
+ added tests

Note: the generator for packages/univint needs to be fixed, until then building on macOS will be broken

git-svn-id: trunk@43684 -
2019-12-14 16:45:38 +00:00
svenbarth
bf5d75e594 * move the common sequence to build a VMT for an objectdef into a separate procedure (based on a patch by Blaise.ru)
git-svn-id: trunk@43674 -
2019-12-11 22:42:53 +00:00
svenbarth
85637ad5fa * register constant symbols
git-svn-id: trunk@43537 -
2019-11-21 21:44:26 +00:00
Jonas Maebe
a051b8d225 - remmoved doregister parameter from t*sym constructors, as the registration
is handled automatically nowadays

git-svn-id: trunk@42998 -
2019-09-14 17:30:45 +00:00
Jonas Maebe
956aab3be0 * implement support for the Objective-C "related result type" convention
as described on
    http://releases.llvm.org/8.0.0/tools/clang/docs/LanguageExtensions.html#objective-c-features
    (rest of mantis #35994)

git-svn-id: trunk@42816 -
2019-08-25 15:23:53 +00:00
florian
aac8559a8d * some runtime errors fixed, if compiled with -CrR
git-svn-id: trunk@42479 -
2019-07-21 12:25:55 +00:00
svenbarth
c282f21b1b * don't bother finding the correct constructor if the attribute isn't a TCustomAttribute descendant anyway; simply skip the parameters in that case
+ added tests

git-svn-id: trunk@42470 -
2019-07-20 19:46:03 +00:00
svenbarth
6cde8ab4cb * fix for Mantis #35866: parse_paras does not check whether the expressions are really constant, so check that manually
+ added test

git-svn-id: trunk@42469 -
2019-07-20 19:45:59 +00:00
svenbarth
b7a8dd9479 * adjust error message when attributes are unbound
git-svn-id: trunk@42410 -
2019-07-12 22:08:17 +00:00
svenbarth
87458a065c * allow use of multiple, comma separated attributes as Delphi allows that as well
+ added test

git-svn-id: trunk@42409 -
2019-07-12 22:08:14 +00:00
svenbarth
98b1b04951 * free unbound attributes
git-svn-id: trunk@42407 -
2019-07-12 22:08:07 +00:00
svenbarth
404b465c33 * allow custom attributes for all type declarations that are not a simple alias
+ added tests

git-svn-id: trunk@42405 -
2019-07-12 22:08:00 +00:00
svenbarth
80ebb98431 * correct identation (no code changes)
git-svn-id: trunk@42404 -
2019-07-12 22:07:57 +00:00
svenbarth
8ce4f9606d * explicitely store the procdef of the picked constructor of the attribute
git-svn-id: trunk@42400 -
2019-07-12 22:07:41 +00:00
svenbarth
a64a8f8deb - remove code to create an attribute using a synthetic function
git-svn-id: trunk@42396 -
2019-07-12 22:07:28 +00:00
svenbarth
402728239f * trtti_attribute_list.bind already checks whether the dangling attribute list is assigned or not
git-svn-id: trunk@42395 -
2019-07-12 22:07:24 +00:00
svenbarth
ced3885dbb * generate construction function for the attributes used in a unit using a more straight forward approach
ToDo: "collect" attributes of same type and same argument list and generate constructor only once for them

git-svn-id: trunk@42394 -
2019-07-12 22:07:20 +00:00
svenbarth
0b63e89ba2 * make the reference to the TCustomAttribute type global
git-svn-id: trunk@42393 -
2019-07-12 22:07:15 +00:00
svenbarth
d9d2515ada * move binding of a dangling attribute list to a sym's/def's attribute list to a class procedure of trtti_attribute_list
git-svn-id: trunk@42392 -
2019-07-12 22:07:11 +00:00
svenbarth
5cea374255 * add a remark that's going to be important once extended RTTI is supported (Delphi programs crash if an attribute's constructor is used that does not have any extended RTTI)
git-svn-id: trunk@42391 -
2019-07-12 22:07:08 +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
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
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
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
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
39bab2dbcc * rename trtti_attributesdef to trtti_attributes_list
git-svn-id: trunk@42359 -
2019-07-12 22:05:00 +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
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
e008785152 * insert the hidden parameters for objectdef methods after resolving
overrides but before generating the VMT, so that these hidden parameters
    are part of the procdefs stored in the VMT (fixes some LLVM type errors
    after r41716)

git-svn-id: trunk@41884 -
2019-04-16 16:11:50 +00:00
Jonas Maebe
ed2ae508d0 * only add hidden parameters for objectdef methods after generating the vmt,
so that they take into account inherited calling conventions (mantis #35233)
   o don't needlessly calculate the paraloc info when generating a JVM mangled
     name

git-svn-id: trunk@41716 -
2019-03-16 19:14:14 +00:00
Jonas Maebe
91d5457b38 * moved around/replaced the following procedures to stop nflw from depending
on pdecsub (node units should not depend on parser units):
   o maybe_add_public_default_java_constructor()
   o handle_calling_convention()
   o create_finalizer_procdef() (replaced with create_outline_procdef())
   o insert_record_hidden_paras()
   o handle_calling_convention()
   o proc_add_definition()
   o build_parentfpstruct()
   o maybe_guarantee_record_typesym()
   o get_first_proc_str()
  * factored out the creation of a procinfo for a nested procdef based on a
    subnodetree of the current procdef into tprocinfo.create_for_outlining()

git-svn-id: trunk@40773 -
2019-01-05 16:26:33 +00:00
Jonas Maebe
28df55fe08 * moved handle_calling_convention() to pparautl
git-svn-id: trunk@40772 -
2019-01-05 16:26:29 +00:00
svenbarth
251dfb6776 * don't allow constants of the record type that is currently being parsed; this would fail as soon as another field is added after the constant declaration
+ added tests
Note: unlike what bug report 27880 suggests Delphi also does *NOT* allow this (at least a current Delphi Tokyo) and fails with a "type is not completely defined" error, so this test belongs into the "failure" category

git-svn-id: trunk@40285 -
2018-11-11 22:08:29 +00:00
Jonas Maebe
ae087b92d7 * when creating a unique type alias for an object, class or interface,
create a child object/class/interface instead of a copy of the original.
    This fixes override/inheritance checks, and is also Delphi-compatible

git-svn-id: trunk@37927 -
2018-01-07 12:25:16 +00:00
svenbarth
a1c910d892 * fix for Mantis #32108: ensure that types are registered once there is no more specialization is going on
git-svn-id: trunk@37341 -
2017-09-27 20:47:16 +00:00
svenbarth
68c5f45593 * also add a generic dummy symbol to the current module's dummy symbols after it had been parsed
git-svn-id: trunk@36467 -
2017-06-09 14:31:20 +00:00